More information about different Windows versions: https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversion...
Verified with: https://testbot.winehq.org/JobDetails.pl?Key=139906
-- v6: win32u: Fix ExtCreateRegion when parameters are wrong. gdi32/tests: Add wrong parameters ExtCreateRegion tests. gdi32: Implement FixBrushOrgEx according to test.
From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdi32/dc.c | 6 +++++- dlls/gdi32/tests/brush.c | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c index 0a57d74485e..3f1531b435a 100644 --- a/dlls/gdi32/dc.c +++ b/dlls/gdi32/dc.c @@ -1129,7 +1129,11 @@ BOOL WINAPI SetBrushOrgEx( HDC hdc, INT x, INT y, POINT *oldorg ) */ BOOL WINAPI FixBrushOrgEx( HDC hdc, INT x, INT y, POINT *oldorg ) { - return SetBrushOrgEx( hdc, x, y, oldorg ); + /* From Windows 2000 function don't do anything and returns FALSE */ + if (LOBYTE(LOWORD(GetVersion())) >= 5) + return FALSE; + + return SetBrushOrgEx(hdc, x, y, oldorg); }
/*********************************************************************** diff --git a/dlls/gdi32/tests/brush.c b/dlls/gdi32/tests/brush.c index 8df3c48a20d..57b4ce4f0e0 100644 --- a/dlls/gdi32/tests/brush.c +++ b/dlls/gdi32/tests/brush.c @@ -431,14 +431,12 @@ static void test_brush_org( void ) ok( pt.x == 0 && pt.y == 0, "got %ld,%ld\n", pt.x, pt.y ); pt.x = 10; pt.y = 20; + /* From Windows 2000 function don't do anything and returns FALSE */ ret = FixBrushOrgEx( hdc, 2, 3, &pt ); - todo_wine ok(!ret, "Unexpected return value %d.\n", ret); - todo_wine ok( pt.x == 10 && pt.y == 20, "got %ld,%ld\n", pt.x, pt.y ); ret = GetBrushOrgEx( hdc, &pt ); ok(ret, "Unexpected return value %d.\n", ret); - todo_wine ok( pt.x == 0 && pt.y == 0, "got %ld,%ld\n", pt.x, pt.y );
ReleaseDC( 0, hdc );
From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdi32/tests/clipping.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/tests/clipping.c b/dlls/gdi32/tests/clipping.c index ce66f9cad09..acfe73632f1 100644 --- a/dlls/gdi32/tests/clipping.c +++ b/dlls/gdi32/tests/clipping.c @@ -222,7 +222,17 @@ static void test_ExtCreateRegion(void) verify_region(hrgn, &empty_rect); DeleteObject(hrgn);
- /* Cannot be smaller than sizeof(RGNDATAHEADER) */ + /* Function should return NULL, if dwSize is larger than header size */ + rgn.data.rdh.dwSize = sizeof(rgn.data.rdh) + 1; + SetLastError(0xdeadbeef); + hrgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER), &rgn.data); + todo_wine + ok(!hrgn, "ExtCreateRegion should fail\n"); + ok((GetLastError() == 0xdeadbeef), "Expected: 0xdeadbeef, got %lu\n", GetLastError()); + + rgn.data.rdh.dwSize = sizeof(rgn.data.rdh); + + /* Number of bytes cannot be smaller than sizeof(RGNDATAHEADER) */ SetLastError(0xdeadbeef); hrgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER) - 1, &rgn.data); todo_wine @@ -270,7 +280,6 @@ static void test_ExtCreateRegion(void) todo_wine ok(!hrgn, "ExtCreateRegion should fail\n"); ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %lu\n", GetLastError()); - }
static void test_GetClipRgn(void)
From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdi32/tests/clipping.c | 6 +----- dlls/win32u/region.c | 7 ++++--- 2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/dlls/gdi32/tests/clipping.c b/dlls/gdi32/tests/clipping.c index acfe73632f1..1ee58afce12 100644 --- a/dlls/gdi32/tests/clipping.c +++ b/dlls/gdi32/tests/clipping.c @@ -226,7 +226,6 @@ static void test_ExtCreateRegion(void) rgn.data.rdh.dwSize = sizeof(rgn.data.rdh) + 1; SetLastError(0xdeadbeef); hrgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER), &rgn.data); - todo_wine ok(!hrgn, "ExtCreateRegion should fail\n"); ok((GetLastError() == 0xdeadbeef), "Expected: 0xdeadbeef, got %lu\n", GetLastError());
@@ -235,11 +234,9 @@ static void test_ExtCreateRegion(void) /* Number of bytes cannot be smaller than sizeof(RGNDATAHEADER) */ SetLastError(0xdeadbeef); hrgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER) - 1, &rgn.data); - todo_wine ok(!hrgn, "ExtCreateRegion should fail\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER || - broken(GetLastError() == 0xdeadbeef), "0xdeadbeef, got %lu\n", GetLastError()); + (GetLastError() == 0xdeadbeef), "0xdeadbeef, got %lu\n", GetLastError());
SetLastError(0xdeadbeef); hrgn = ExtCreateRegion(NULL, sizeof(rgn), &rgn.data); @@ -277,7 +274,6 @@ static void test_ExtCreateRegion(void) /* Buffer cannot be smaller than sizeof(RGNDATAHEADER) + 2 * sizeof(RECT) */ SetLastError(0xdeadbeef); hrgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER) + 2 * sizeof(RECT) - 1, &rgn.data); - todo_wine ok(!hrgn, "ExtCreateRegion should fail\n"); ok(GetLastError() == 0xdeadbeef, "0xdeadbeef, got %lu\n", GetLastError()); } diff --git a/dlls/win32u/region.c b/dlls/win32u/region.c index f32984d1c54..40a477ddfd1 100644 --- a/dlls/win32u/region.c +++ b/dlls/win32u/region.c @@ -896,11 +896,12 @@ HRGN WINAPI NtGdiExtCreateRegion( const XFORM *xform, DWORD count, const RGNDATA WINEREGION *obj; const RECT *pCurRect, *pEndRect;
- if (!rgndata || rgndata->rdh.dwSize < sizeof(RGNDATAHEADER)) + if (!rgndata || rgndata->rdh.dwSize != sizeof(RGNDATAHEADER) || + (count < sizeof(RGNDATAHEADER) + rgndata->rdh.nCount * sizeof(RECT))) return 0;
- /* XP doesn't care about the type */ - if( rgndata->rdh.iType != RDH_RECTANGLES ) + /* Up to Windows XP/2003, function return 0, if type is wrong */ + if (rgndata->rdh.iType != RDH_RECTANGLES) WARN("(Unsupported region data type: %u)\n", (int)rgndata->rdh.iType);
if (xform)
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=147437
Your paranoid android.
=== debian11 (32 bit report) ===
gdi32: metafile.c:8340: Test failed: GetClipRgn returned 0, expected 1 metafile.c:8343: Test failed: expected sizeof(rgn), got 32 metafile.c:8346: Test failed: expected sizeof(rgn2), got 32 metafile.c:8358: Test failed: rects don't match metafile.c:8365: Test failed: rects don't match metafile.c:8369: Test failed: expected 1, got 0 metafile.c:8370: Test failed: expected sizeof(RECT), got 0
=== debian11b (64 bit WoW report) ===
ddraw: ddraw1.c:1102: Test failed: Failed to set clip list, hr 0x80004005. ddraw1.c:1146: Test failed: Failed to blit, hr 0x887600cd. ddraw1.c:1154: Test failed: Expected color 0x000000ff at 80,60, got 0x00000000. ddraw1.c:1154: Test failed: Expected color 0x0000ff00 at 240,60, got 0x00000000. ddraw1.c:1154: Test failed: Expected color 0x000000ff at 80,180, got 0x00000000. ddraw1.c:1154: Test failed: Expected color 0x0000ff00 at 240,180, got 0x00000000. ddraw1.c:1154: Test failed: Expected color 0x00ff0000 at 400,300, got 0x00000000. ddraw1.c:1154: Test failed: Expected color 0x00ffffff at 560,300, got 0x00000000. ddraw1.c:1154: Test failed: Expected color 0x00ff0000 at 400,420, got 0x00000000. ddraw1.c:1154: Test failed: Expected color 0x00ffffff at 560,420, got 0x00000000. ddraw1.c:1162: Test failed: Failed to clear destination surface, hr 0x887600cd. ddraw1.c:1170: Test failed: Expected color 0x000000ff at 80,60, got 0x00000000. ddraw1.c:1170: Test failed: Expected color 0x000000ff at 240,60, got 0x00000000. ddraw1.c:1170: Test failed: Expected color 0x000000ff at 80,180, got 0x00000000. ddraw1.c:1170: Test failed: Expected color 0x000000ff at 240,180, got 0x00000000. ddraw1.c:1170: Test failed: Expected color 0x000000ff at 400,300, got 0x00000000. ddraw1.c:1170: Test failed: Expected color 0x000000ff at 560,300, got 0x00000000. ddraw1.c:1170: Test failed: Expected color 0x000000ff at 400,420, got 0x00000000. ddraw1.c:1170: Test failed: Expected color 0x000000ff at 560,420, got 0x00000000. ddraw1.c:1188: Test failed: Failed to get clip list size, hr 0x887600cd. ddraw2.c:950: Test failed: Failed to set clip list, hr 0x80004005. ddraw2.c:994: Test failed: Failed to blit, hr 0x887600cd. ddraw2.c:1002: Test failed: Expected color 0x000000ff at 80,60, got 0x00000000. ddraw2.c:1002: Test failed: Expected color 0x0000ff00 at 240,60, got 0x00000000. ddraw2.c:1002: Test failed: Expected color 0x000000ff at 80,180, got 0x00000000. ddraw2.c:1002: Test failed: Expected color 0x0000ff00 at 240,180, got 0x00000000. ddraw2.c:1002: Test failed: Expected color 0x00ff0000 at 400,300, got 0x00000000. ddraw2.c:1002: Test failed: Expected color 0x00ffffff at 560,300, got 0x00000000. ddraw2.c:1002: Test failed: Expected color 0x00ff0000 at 400,420, got 0x00000000. ddraw2.c:1002: Test failed: Expected color 0x00ffffff at 560,420, got 0x00000000. ddraw2.c:1010: Test failed: Failed to clear destination surface, hr 0x887600cd. ddraw2.c:1018: Test failed: Expected color 0x000000ff at 80,60, got 0x00000000. ddraw2.c:1018: Test failed: Expected color 0x000000ff at 240,60, got 0x00000000. ddraw2.c:1018: Test failed: Expected color 0x000000ff at 80,180, got 0x00000000. ddraw2.c:1018: Test failed: Expected color 0x000000ff at 240,180, got 0x00000000. ddraw2.c:1018: Test failed: Expected color 0x000000ff at 400,300, got 0x00000000. ddraw2.c:1018: Test failed: Expected color 0x000000ff at 560,300, got 0x00000000. ddraw2.c:1018: Test failed: Expected color 0x000000ff at 400,420, got 0x00000000. ddraw2.c:1018: Test failed: Expected color 0x000000ff at 560,420, got 0x00000000. ddraw2.c:1036: Test failed: Failed to get clip list size, hr 0x887600cd. ddraw4.c:1142: Test failed: Failed to set clip list, hr 0x80004005. ddraw4.c:1186: Test failed: Failed to blit, hr 0x887600cd. ddraw4.c:1194: Test failed: Expected color 0x000000ff at 80,60, got 0x00000000. ddraw4.c:1194: Test failed: Expected color 0x0000ff00 at 240,60, got 0x00000000. ddraw4.c:1194: Test failed: Expected color 0x000000ff at 80,180, got 0x00000000. ddraw4.c:1194: Test failed: Expected color 0x0000ff00 at 240,180, got 0x00000000. ddraw4.c:1194: Test failed: Expected color 0x00ff0000 at 400,300, got 0x00000000. ddraw4.c:1194: Test failed: Expected color 0x00ffffff at 560,300, got 0x00000000. ddraw4.c:1194: Test failed: Expected color 0x00ff0000 at 400,420, got 0x00000000. ddraw4.c:1194: Test failed: Expected color 0x00ffffff at 560,420, got 0x00000000. ddraw4.c:1202: Test failed: Failed to clear destination surface, hr 0x887600cd. ddraw4.c:1210: Test failed: Expected color 0x000000ff at 80,60, got 0x00000000. ddraw4.c:1210: Test failed: Expected color 0x000000ff at 240,60, got 0x00000000. ddraw4.c:1210: Test failed: Expected color 0x000000ff at 80,180, got 0x00000000. ddraw4.c:1210: Test failed: Expected color 0x000000ff at 240,180, got 0x00000000. ddraw4.c:1210: Test failed: Expected color 0x000000ff at 400,300, got 0x00000000. ddraw4.c:1210: Test failed: Expected color 0x000000ff at 560,300, got 0x00000000. ddraw4.c:1210: Test failed: Expected color 0x000000ff at 400,420, got 0x00000000. ddraw4.c:1210: Test failed: Expected color 0x000000ff at 560,420, got 0x00000000. ddraw4.c:1228: Test failed: Failed to get clip list size, hr 0x887600cd. ddraw7.c:1228: Test failed: Failed to set clip list, hr 0x80004005. ddraw7.c:1272: Test failed: Failed to blit, hr 0x887600cd. ddraw7.c:1280: Test failed: Expected color 0x000000ff at 80,60, got 0x00000000. ddraw7.c:1280: Test failed: Expected color 0x0000ff00 at 240,60, got 0x00000000. ddraw7.c:1280: Test failed: Expected color 0x000000ff at 80,180, got 0x00000000. ddraw7.c:1280: Test failed: Expected color 0x0000ff00 at 240,180, got 0x00000000. ddraw7.c:1280: Test failed: Expected color 0x00ff0000 at 400,300, got 0x00000000. ddraw7.c:1280: Test failed: Expected color 0x00ffffff at 560,300, got 0x00000000. ddraw7.c:1280: Test failed: Expected color 0x00ff0000 at 400,420, got 0x00000000. ddraw7.c:1280: Test failed: Expected color 0x00ffffff at 560,420, got 0x00000000. ddraw7.c:1288: Test failed: Failed to clear destination surface, hr 0x887600cd. ddraw7.c:1296: Test failed: Expected color 0x000000ff at 80,60, got 0x00000000. ddraw7.c:1296: Test failed: Expected color 0x000000ff at 240,60, got 0x00000000. ddraw7.c:1296: Test failed: Expected color 0x000000ff at 80,180, got 0x00000000. ddraw7.c:1296: Test failed: Expected color 0x000000ff at 240,180, got 0x00000000. ddraw7.c:1296: Test failed: Expected color 0x000000ff at 400,300, got 0x00000000. ddraw7.c:1296: Test failed: Expected color 0x000000ff at 560,300, got 0x00000000. ddraw7.c:1296: Test failed: Expected color 0x000000ff at 400,420, got 0x00000000. ddraw7.c:1296: Test failed: Expected color 0x000000ff at 560,420, got 0x00000000. ddraw7.c:1314: Test failed: Failed to get clip list size, hr 0x887600cd.
gdi32: metafile.c:8340: Test failed: GetClipRgn returned 0, expected 1 metafile.c:8343: Test failed: expected sizeof(rgn), got 32 metafile.c:8346: Test failed: expected sizeof(rgn2), got 32 metafile.c:8358: Test failed: rects don't match metafile.c:8365: Test failed: rects don't match metafile.c:8369: Test failed: expected 1, got 0 metafile.c:8370: Test failed: expected sizeof(RECT), got 0