56 if ((dwFormat >= 0xC000) && (dwFormat <= 0xFFFF))
281 PVOID pClipFileHeader;
282 PVOID pClipFormatArray;
283 DWORD SizeOfFileHeader, SizeOfFormatHeader;
285 WORD wFileIdentifier;
307 if (!
ReadFile(
hFile, &wFileIdentifier,
sizeof(wFileIdentifier), &dwBytesRead,
NULL))
314 switch (wFileIdentifier)
319 pClipFileHeader = &ClipFileHeader;
320 pClipFormatArray = &ClipFormatArray;
327 pClipFileHeader = &NtClipFileHeader;
328 pClipFormatArray = &NtClipFormatArray;
339 dwBytesRead != SizeOfFileHeader)
346 switch (wFileIdentifier)
361 for (
i = 0;
i < wFormatCount;
i++)
376 switch (wFileIdentifier)
455 PVOID pClipFileHeader;
456 PVOID pClipFormatArray;
457 DWORD SizeOfFileHeader, SizeOfFormatHeader;
466 DWORD dwBytesWritten;
481 switch (wFileIdentifier)
486 pClipFileHeader = &ClipFileHeader;
487 pClipFormatArray = &ClipFormatArray;
497 pClipFileHeader = &NtClipFileHeader;
498 pClipFormatArray = &NtClipFormatArray;
512 dwBytesWritten != SizeOfFileHeader)
519 dwOffData = SizeOfFileHeader + wFormatCount * SizeOfFormatHeader;
526 if (
i >= wFormatCount)
538 switch (wFileIdentifier)
579 dwOffData += dwLenData;
void WriteClipboardFile(LPCWSTR lpFileName, WORD wFileIdentifier)
static BOOL ClipboardReadPalette(HANDLE hFile, DWORD dwOffset, DWORD dwLength)
static BOOL ClipboardReadBitmap(HANDLE hFile, DWORD dwOffset, DWORD dwLength)
void ReadClipboardFile(LPCWSTR lpFileName)
static BOOL ClipboardReadEnhMetafile(HANDLE hFile, DWORD dwOffset, DWORD dwLength)
static BOOL ClipboardReadMemory(HANDLE hFile, DWORD dwFormat, DWORD dwOffset, DWORD dwLength, WORD FileIdentifier, PVOID lpFormatName)
static BOOL ClipboardReadMetafile(HANDLE hFile, DWORD dwOffset, DWORD dwLength)
static HGLOBAL ClipboardReadMemoryBlock(HANDLE hFile, DWORD dwOffset, DWORD dwLength)
static BOOL ClipboardWriteMemory(HANDLE hFile, DWORD dwFormat, DWORD dwOffset, PDWORD pdwLength)
#define ERROR_INVALID_FILE_FORMAT
#define CF_DSPENHMETAFILE
#define CF_DSPMETAFILEPICT
struct _CLIPFORMATHEADER CLIPFORMATHEADER
struct _CLIPFILEHEADER CLIPFILEHEADER
struct _NTCLIPFILEHEADER NTCLIPFILEHEADER
struct _NTCLIPFORMATHEADER NTCLIPFORMATHEADER
CLIPBOARD_GLOBALS Globals
void RetrieveClipboardFormatName(HINSTANCE hInstance, UINT uFormat, BOOL Unicode, PVOID lpszFormat, UINT cch)
#define INVALID_SET_FILE_POINTER
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
static DWORD DWORD * dwLength
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
_In_ DWORD _In_ DWORD dwOffset
static const WCHAR szName[]
BOOL WINAPI DeleteMetaFile(_In_ HMETAFILE)
BOOL WINAPI DeleteEnhMetaFile(_In_opt_ HENHMETAFILE)
HPALETTE WINAPI CreatePalette(_In_reads_(_Inexpressible_(2 *sizeof(WORD)+plpal->palNumEntries *sizeof(PALETTEENTRY))) const LOGPALETTE *)
HBITMAP WINAPI CreateBitmapIndirect(_In_ const BITMAP *pbm)
HMETAFILE WINAPI SetMetaFileBitsEx(_In_ UINT cbBuffer, _In_reads_bytes_(cbBuffer) CONST BYTE *lpData)
HENHMETAFILE WINAPI SetEnhMetaFileBits(_In_ UINT nSize, _In_reads_bytes_(nSize) const BYTE *pb)
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)
UINT WINAPI EnumClipboardFormats(_In_ UINT)
HANDLE WINAPI GetClipboardData(_In_ UINT)
int WINAPI CountClipboardFormats(void)
UINT WINAPI RegisterClipboardFormatA(_In_ LPCSTR)
int MessageBoxRes(HWND hWnd, HINSTANCE hInstance, UINT uText, UINT uCaption, UINT uType)
void ShowLastWin32Error(HWND hwndParent)