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