Vincent Povirk wrote: > On windows, I get: > > metafile.c:705: Test failed: CreateDCA error 1801 Hmm... now that I think about it, I think the call to CreateDCA() should look like this: hdcDisplay = CreateDCA("DISPLAY", NULL, NULL, NULL); > > metafile.c:710: Test failed: BitBlt error 1801 BitBlt() failed because there was no DC to blit from. That should go away when I fix CreateDCA(). > > metafile.c:730: Test failed: unexpected EMF bits: got 01, expected 0xff > > metafile.c:730: Test failed: unexpected EMF bits: got 00, expected 0xff > > metafile.c:730: Test failed: unexpected EMF bits: got 00, expected 0xff > > ... Now this is interesting. I would expect all the bits to be ones, yet here, they're (almost) all zeros. It's like BitBlt(..., WHITENESS) had no effect. Or, maybe I got the meaning of the bits backwards. > > On Wine, I get: > > metafile.c:710: Test failed: BitBlt error 0 Now why does that one fail? I also need to stop printing the last error, because BitBlt() apparently doesn't set the last error. (Need to pay more attention to MSDN...) > wine: Unhandled page fault on read access to 0x00000000 at address > 0x686476e5 (thread 0009), starting debugger... > (same crash that's on bug 4543) Since it crashes, I'll have to if(0) that one out. > > On Tue, Nov 17, 2009 at 2:04 PM, Vincent Povirk > <madewokherd+8...@gmail.com> wrote: >> On closer inspection, you didn't add a call to your static function, >> so that was meaningless. >> >> On Tue, Nov 17, 2009 at 1:59 PM, Vincent Povirk >> <madewokherd+8...@gmail.com> wrote: >>> This passes on my Windows XP vm and on Wine here. >>> >>> On Tue, Nov 17, 2009 at 12:44 PM, Charles Davis <cda...@mymail.mines.edu> >>> wrote: >>>> Hi, >>>> >>>> I have a test that I wrote from scratch for bug 4543. It tests the >>>> operation of BitBlt to a metafile, first from the screen then pure >>>> whiteness. Unfortunately, I have no Windows boxes to test on, so I need >>>> people to run my test on Windows. After all, I need to verify that this >>>> test is an accurate representation of Windows' behavior! >>>> >>>> Also, testing under Wine would be appreciated. As a Mac user, I don't >>>> think my system is representative of the vast majority of Wine users >>>> (who probably run Linux). >>>> >>>> I've attached the patch so you can build a gdi32_test.exe that contains >>>> my tests. >>>> >>>> Thanks in advance. >>>> >>>> Chip >>>> >>>> From db073155c888747b9259cb8fe0d5ff2a59ee5666 Mon Sep 17 00:00:00 2001 >>>> From: Charles Davis <cda...@mymail.mines.edu> >>>> Date: Tue, 17 Nov 2009 11:10:50 -0700 >>>> Subject: [PATCH] gdi32/tests: Test BitBlt() to a metafile. >>>> To: wine-patches <wine-patc...@winehq.org> >>>> Reply-To: wine-devel <wine-devel@winehq.org> >>>> >>>> --- >>>> dlls/gdi32/tests/metafile.c | 68 >>>> +++++++++++++++++++++++++++++++++++++++++++ >>>> 1 files changed, 68 insertions(+), 0 deletions(-) >>>> >>>> diff --git a/dlls/gdi32/tests/metafile.c b/dlls/gdi32/tests/metafile.c >>>> index b559901..6bf25e4 100644 >>>> --- a/dlls/gdi32/tests/metafile.c >>>> +++ b/dlls/gdi32/tests/metafile.c >>>> @@ -665,6 +665,74 @@ static void test_SaveDC(void) >>>> DestroyWindow(hwnd); >>>> } >>>> >>>> +static int CALLBACK test_BitBlt_record(HDC hdc, HANDLETABLE *table, const >>>> ENHMETARECORD *emfr, int nobj, LPARAM data) >>>> +{ >>>> + UINT *pi = (UINT *)data; >>>> + EMRBITBLT *emrbb; >>>> + >>>> + if(emfr->iType != EMR_BITBLT) return 1; >>>> + emrbb = (EMRBITBLT *)emfr; >>>> + >>>> + *pi++; >>>> + if(*pi > 2) return 1; >>>> + ok( emrbb->xDest == 0, "wrong xDest for BitBlt record: got %d, >>>> expected 0\n", emrbb->xDest ); >>>> + ok( emrbb->yDest == 0, "wrong yDest for BitBlt record: got %d, >>>> expected 0\n", emrbb->yDest ); >>>> + ok( emrbb->xSrc == 0, "wrong xSrc for BitBlt record: got %d, expected >>>> 0\n", emrbb->xSrc ); >>>> + ok( emrbb->ySrc == 0, "wrong ySrc for BitBlt record: got %d, expected >>>> 0\n", emrbb->ySrc ); >>>> + ok( emrbb->cxDest == GetSystemMetrics(SM_CXSCREEN), "wrong cxDest for >>>> BitBlt record: got %d\n", emrbb->cxDest ); >>>> + ok( emrbb->cyDest == GetSystemMetrics(SM_CYSCREEN), "wrong cyDest for >>>> BitBlt record: got %d\n", emrbb->cyDest ); >>>> + if(*pi == 1) /* First BitBlt */ >>>> + { >>>> + ok( emrbb->dwRop == SRCCOPY, "wrong ROP for BitBlt record: got >>>> %x, expected SRCCOPY\n", emrbb->dwRop ); >>>> + } >>>> + else >>>> + { >>>> + ok( emrbb->dwRop == WHITENESS, "wrong ROP for BitBlt record: got >>>> %x, expected WHITENESS\n", emrbb->dwRop ); >>>> + } >>>> + return 1; >>>> +} >>>> + >>>> +static void test_emf_BitBlt(void) >>>> +{ >>>> + HDC hdcDisplay, hdcMetafile; >>>> + HENHMETAFILE hMetafile; >>>> + ENHMETAHEADER emh; >>>> + BYTE *bits; >>>> + BOOL ret; >>>> + UINT i; >>>> + >>>> + hdcDisplay = CreateDCA(NULL, "DISPLAY", NULL, NULL); >>>> + ok( hdcDisplay != 0, "CreateDCA error %d\n", GetLastError() ); >>>> + hdcMetafile = CreateEnhMetaFileA(hdcDisplay, NULL, NULL, NULL); >>>> + ok( hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError() >>>> ); >>>> + >>>> + ret = BitBlt(hdcMetafile, 0, 0, GetSystemMetrics(SM_CXSCREEN), >>>> GetSystemMetrics(SM_CYSCREEN), hdcDisplay, 0, 0, SRCCOPY); >>>> + ok( ret, "BitBlt error %d\n", GetLastError() ); >>>> + ret = BitBlt(hdcMetafile, 0, 0, GetSystemMetrics(SM_CXSCREEN), >>>> GetSystemMetrics(SM_CYSCREEN), 0, 0, 0, WHITENESS); >>>> + ok( ret, "BitBlt error %d\n", GetLastError() ); >>>> + >>>> + hMetafile = CloseEnhMetaFile(hdcMetafile); >>>> + ok( hMetafile != 0, "CloseEnhMetaFile error %d\n", GetLastError() ); >>>> + >>>> + ret = GetEnhMetaFileHeader( hMetafile, sizeof(emh), &emh ); >>>> + ok( ret != 0, "GetEnhMetaFileHeader error %d\n", GetLastError() ); >>>> + ok( emh.dSignature == ENHMETA_SIGNATURE, "bad metafile signature >>>> %x\n", emh.dSignature ); >>>> + >>>> + bits = HeapAlloc( GetProcessHeap(), 0, emh.nBytes ); >>>> + if(!bits) >>>> + { >>>> + skip( "not enough memory for EMF bits\n" ); >>>> + return; >>>> + } >>>> + ret = GetEnhMetaFileBits( hMetafile, emh.nBytes, bits ); >>>> + ok( ret != 0, "GetEnhMetaFileBits error %d\n", GetLastError() ); >>>> + for(i = 0; i < emh.nBytes; i++) >>>> + ok( bits[i] == 0xff, "unexpected EMF bits: got %02x, expected >>>> 0xff\n", bits[i] ); >>>> + >>>> + EnumEnhMetaFile(0, hMetafile, test_BitBlt_record, (LPARAM)&i, NULL); >>>> + ok( i == 2, "too many/not enough BitBlt records: got %d, expected >>>> 2\n", i ); >>>> +} >>>> + >>>> static void test_mf_SaveDC(void) >>>> { >>>> HDC hdcMetafile; >>>> -- >>>> 1.6.5.2 >>>> >>>> >>>> >>>> >>>> >>> >>> >>> -- >>> Vincent Povirk >>> >> >> >> -- >> Vincent Povirk >> > > > Thanks.
Chip