-
Notifications
You must be signed in to change notification settings - Fork 0
/
fileutils.h
55 lines (47 loc) · 1.17 KB
/
fileutils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* PROJECT: ReactOS Clipboard Viewer
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: Clipboard file format helper functions.
* COPYRIGHT: Copyright 2015-2018 Ricardo Hanke
* Copyright 2015-2018 Hermes Belusca-Maito
*/
#pragma once
/* Clipboard file format signatures */
#define CLIP_FMT_31 0xC350
#define CLIP_FMT_NT 0xC351
#define CLIP_FMT_BK 0xC352
#define MAX_FMT_NAME_LEN 79
/*
* Win3.1 Clipboard File Format (default)
*/
#pragma pack(push, 1)
typedef struct _CLIPFILEHEADER
{
WORD wFileIdentifier;
WORD wFormatCount;
} CLIPFILEHEADER;
typedef struct _CLIPFORMATHEADER
{
WORD dwFormatID;
DWORD dwLenData;
DWORD dwOffData;
CHAR szName[MAX_FMT_NAME_LEN];
} CLIPFORMATHEADER;
#pragma pack(pop)
/*
* NT Clipboard File Format
*/
typedef struct _NTCLIPFILEHEADER
{
WORD wFileIdentifier;
WORD wFormatCount;
} NTCLIPFILEHEADER;
typedef struct _NTCLIPFORMATHEADER
{
DWORD dwFormatID;
DWORD dwLenData;
DWORD dwOffData;
WCHAR szName[MAX_FMT_NAME_LEN];
} NTCLIPFORMATHEADER;
void ReadClipboardFile(LPCWSTR lpFileName);
void WriteClipboardFile(LPCWSTR lpFileName, WORD wFileIdentifier);