gdi32: Fix SetEnhMetaFileBits last error handling.
This commit is contained in:
parent
eceed527f6
commit
55fc90220f
|
@ -252,12 +252,16 @@ HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk )
|
|||
HENHMETAFILE hmf;
|
||||
ENHMETAFILEOBJ *metaObj;
|
||||
|
||||
if (emh->iType != EMR_HEADER || emh->dSignature != ENHMETA_SIGNATURE ||
|
||||
if (emh->iType != EMR_HEADER)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_DATA);
|
||||
return 0;
|
||||
}
|
||||
if (emh->dSignature != ENHMETA_SIGNATURE ||
|
||||
(emh->nBytes & 3)) /* refuse to load unaligned EMF as Windows does */
|
||||
{
|
||||
WARN("Invalid emf header type 0x%08x sig 0x%08x.\n",
|
||||
emh->iType, emh->dSignature);
|
||||
SetLastError(ERROR_INVALID_DATA);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -2349,7 +2349,6 @@ static void test_SetEnhMetaFileBits(void)
|
|||
ok(!hemf ||
|
||||
broken(hemf != NULL), /* Win9x, WinMe */
|
||||
"SetEnhMetaFileBits should fail\n");
|
||||
todo_wine
|
||||
ok(GetLastError() == 0xdeadbeef, "Expected deadbeef, got %u\n", GetLastError());
|
||||
DeleteEnhMetaFile(hemf);
|
||||
|
||||
|
@ -2360,7 +2359,6 @@ static void test_SetEnhMetaFileBits(void)
|
|||
ok(!hemf ||
|
||||
broken(hemf != NULL), /* Win9x, WinMe */
|
||||
"SetEnhMetaFileBits should fail\n");
|
||||
todo_wine
|
||||
ok(GetLastError() == 0xdeadbeef, "Expected deadbeef, got %u\n", GetLastError());
|
||||
DeleteEnhMetaFile(hemf);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue