Some small fixes to enhmetafiles.
This commit is contained in:
parent
9ad9017edd
commit
ae0a73d442
|
@ -4,6 +4,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <assert.h>
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#include "gdi.h"
|
#include "gdi.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
|
@ -26,6 +27,10 @@ HENHMETAFILE32 WINAPI GetEnhMetaFile32A(
|
||||||
DWORD read;
|
DWORD read;
|
||||||
HFILE32 hf = CreateFile32A(lpszMetaFile, GENERIC_READ, 0, 0,
|
HFILE32 hf = CreateFile32A(lpszMetaFile, GENERIC_READ, 0, 0,
|
||||||
OPEN_EXISTING, 0, 0);
|
OPEN_EXISTING, 0, 0);
|
||||||
|
if (hf == INVALID_HANDLE_VALUE32) {
|
||||||
|
FIXME(metafile,"could not open %s\n",lpszMetaFile);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (!ReadFile(hf, &h, sizeof(ENHMETAHEADER), &read, NULL))
|
if (!ReadFile(hf, &h, sizeof(ENHMETAHEADER), &read, NULL))
|
||||||
return 0;
|
return 0;
|
||||||
if (read!=sizeof(ENHMETAHEADER)) return 0;
|
if (read!=sizeof(ENHMETAHEADER)) return 0;
|
||||||
|
@ -34,6 +39,7 @@ HENHMETAFILE32 WINAPI GetEnhMetaFile32A(
|
||||||
hmf = GlobalAlloc32(GPTR, h.nBytes);
|
hmf = GlobalAlloc32(GPTR, h.nBytes);
|
||||||
p = GlobalLock32(hmf);
|
p = GlobalLock32(hmf);
|
||||||
if (!ReadFile(hf, p, h.nBytes, &read, NULL)) return 0;
|
if (!ReadFile(hf, p, h.nBytes, &read, NULL)) return 0;
|
||||||
|
assert(read==h.nBytes);
|
||||||
GlobalUnlock32(hmf);
|
GlobalUnlock32(hmf);
|
||||||
return hmf;
|
return hmf;
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,7 @@ init MAIN_GdiInit
|
||||||
171 stdcall GetDeviceCaps(long long) GetDeviceCaps32
|
171 stdcall GetDeviceCaps(long long) GetDeviceCaps32
|
||||||
172 stub GetDeviceGammaRamp
|
172 stub GetDeviceGammaRamp
|
||||||
173 stub GetETM
|
173 stub GetETM
|
||||||
174 stdcall GetEnhMetaFileA(ptr) GetEnhMetaFile32A
|
174 stdcall GetEnhMetaFileA(str) GetEnhMetaFile32A
|
||||||
175 stdcall GetEnhMetaFileBits(long long ptr) GetEnhMetaFileBits
|
175 stdcall GetEnhMetaFileBits(long long ptr) GetEnhMetaFileBits
|
||||||
176 stdcall GetEnhMetaFileDescriptionA(long long ptr) GetEnhMetaFileDescription32A
|
176 stdcall GetEnhMetaFileDescriptionA(long long ptr) GetEnhMetaFileDescription32A
|
||||||
177 stdcall GetEnhMetaFileDescriptionW(long long ptr) GetEnhMetaFileDescription32W
|
177 stdcall GetEnhMetaFileDescriptionW(long long ptr) GetEnhMetaFileDescription32W
|
||||||
|
|
Loading…
Reference in New Issue