gdi32: Fix SetEnhMetaFileBits last error handling.

This commit is contained in:
Alexandre Julliard 2009-04-07 20:44:12 +02:00
parent eceed527f6
commit 55fc90220f
2 changed files with 6 additions and 4 deletions

View File

@ -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;
}

View File

@ -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);
}