Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/user32/tests/win.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index fc35542..c0d83ef 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -6532,6 +6532,8 @@ static void test_ShowWindow(void) LPARAM ret;
SetRect(&rcMain, 120, 120, 210, 210); + SetRect(&rcMinimized, -32000, -32000, -32000 + GetSystemMetrics(SM_CXMINIMIZED), + -32000 + GetSystemMetrics(SM_CYMINIMIZED));
hwnd = CreateWindowExA(0, "MainWindowClass", NULL, WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | @@ -6568,8 +6570,10 @@ static void test_ShowWindow(void) ok(style & WS_VISIBLE, "window should be visible\n"); ok(style & WS_MINIMIZE, "window should be minimized\n"); ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); - GetWindowRect(hwnd, &rcMinimized); - ok(!EqualRect(&rcMain, &rcMinimized), "rects shouldn't match\n"); + GetWindowRect(hwnd, &rc); + todo_wine + ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); /* shouldn't be able to resize minimized windows */ ret = SetWindowPos(hwnd, 0, 0, 0, (rcMinimized.right - rcMinimized.left) * 2, @@ -6577,7 +6581,9 @@ static void test_ShowWindow(void) SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); ok(ret, "not expected ret: %lu\n", ret); GetWindowRect(hwnd, &rc); - ok(EqualRect(&rc, &rcMinimized), "rects should match\n"); + todo_wine + ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc));
ShowWindow(hwnd, SW_RESTORE); ok(ret, "not expected ret: %lu\n", ret); @@ -6625,7 +6631,9 @@ static void test_ShowWindow(void) ok(style & WS_MINIMIZE, "window should be minimized\n"); ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); GetWindowRect(hwnd, &rc); - ok(!EqualRect(&rcMain, &rc), "rects shouldn't match\n"); + todo_wine + ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc));
ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0); ok(!ret, "not expected ret: %lu\n", ret); @@ -6635,7 +6643,9 @@ static void test_ShowWindow(void) ok(style & WS_MINIMIZE, "window should be minimized\n"); ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); GetWindowRect(hwnd, &rc); - ok(!EqualRect(&rcMain, &rc), "rects shouldn't match\n"); + todo_wine + ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc));
ret = ShowWindow(hwnd, SW_RESTORE); ok(ret, "not expected ret: %lu\n", ret); @@ -6670,9 +6680,8 @@ static void test_ShowWindow(void) ok(style & WS_MINIMIZE, "window should be minimized\n"); GetWindowRect(hwnd, &rc); todo_wine - ok((rc.left == -32000 || rc.left == 3000) && - (rc.top == -32000 || rc.top == 3000), - "expected (-32000,-32000), got (%d,%d)\n", rc.left, rc.top); + ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); DestroyWindow(hwnd);
hwnd = CreateWindowExA(0, "MainWindowClass", NULL, @@ -6685,9 +6694,9 @@ static void test_ShowWindow(void) style = GetWindowLongA(hwnd, GWL_STYLE); ok(style & WS_MINIMIZE, "window should be minimized\n"); GetWindowRect(hwnd, &rc); - ok((rc.left == -32000 || rc.left == 3000) && - (rc.top == -32000 || rc.top == 3000), - "expected (-32000,-32000), got (%d,%d)\n", rc.left, rc.top); + todo_wine + ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); DestroyWindow(hwnd); }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/user32/tests/win.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index c0d83ef..6268042 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -6528,12 +6528,16 @@ static void test_ShowWindow(void) { HWND hwnd; DWORD style; - RECT rcMain, rc, rcMinimized; + RECT rcMain, rc, rcMinimized, rcClient, rcEmpty; LPARAM ret;
- SetRect(&rcMain, 120, 120, 210, 210); + SetRect(&rcClient, 0, 0, 90, 90); + rcMain = rcClient; + OffsetRect(&rcMain, 120, 120); + AdjustWindowRect(&rcMain, WS_CAPTION, 0); SetRect(&rcMinimized, -32000, -32000, -32000 + GetSystemMetrics(SM_CXMINIMIZED), -32000 + GetSystemMetrics(SM_CYMINIMIZED)); + SetRectEmpty(&rcEmpty);
hwnd = CreateWindowExA(0, "MainWindowClass", NULL, WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | @@ -6551,6 +6555,9 @@ static void test_ShowWindow(void) GetWindowRect(hwnd, &rc); ok(EqualRect(&rcMain, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMain), wine_dbgstr_rect(&rc)); + GetClientRect(hwnd, &rc); + ok(EqualRect(&rcClient, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
ret = ShowWindow(hwnd, SW_SHOW); ok(!ret, "not expected ret: %lu\n", ret); @@ -6562,6 +6569,9 @@ static void test_ShowWindow(void) GetWindowRect(hwnd, &rc); ok(EqualRect(&rcMain, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMain), wine_dbgstr_rect(&rc)); + GetClientRect(hwnd, &rc); + ok(EqualRect(&rcClient, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
ret = ShowWindow(hwnd, SW_MINIMIZE); ok(ret, "not expected ret: %lu\n", ret); @@ -6574,6 +6584,10 @@ static void test_ShowWindow(void) todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); + GetClientRect(hwnd, &rc); + todo_wine + ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc)); /* shouldn't be able to resize minimized windows */ ret = SetWindowPos(hwnd, 0, 0, 0, (rcMinimized.right - rcMinimized.left) * 2, @@ -6584,6 +6598,10 @@ static void test_ShowWindow(void) todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); + GetClientRect(hwnd, &rc); + todo_wine + ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
ShowWindow(hwnd, SW_RESTORE); ok(ret, "not expected ret: %lu\n", ret); @@ -6595,6 +6613,9 @@ static void test_ShowWindow(void) GetWindowRect(hwnd, &rc); ok(EqualRect(&rcMain, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMain), wine_dbgstr_rect(&rc)); + GetClientRect(hwnd, &rc); + ok(EqualRect(&rcClient, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
ret = EnableWindow(hwnd, FALSE); ok(!ret, "not expected ret: %lu\n", ret); @@ -6611,6 +6632,9 @@ static void test_ShowWindow(void) GetWindowRect(hwnd, &rc); ok(EqualRect(&rcMain, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMain), wine_dbgstr_rect(&rc)); + GetClientRect(hwnd, &rc); + ok(EqualRect(&rcClient, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0); ok(!ret, "not expected ret: %lu\n", ret); @@ -6622,6 +6646,9 @@ static void test_ShowWindow(void) GetWindowRect(hwnd, &rc); ok(EqualRect(&rcMain, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMain), wine_dbgstr_rect(&rc)); + GetClientRect(hwnd, &rc); + ok(EqualRect(&rcClient, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
ret = ShowWindow(hwnd, SW_MINIMIZE); ok(ret, "not expected ret: %lu\n", ret); @@ -6634,6 +6661,10 @@ static void test_ShowWindow(void) todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); + GetClientRect(hwnd, &rc); + todo_wine + ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0); ok(!ret, "not expected ret: %lu\n", ret); @@ -6646,6 +6677,10 @@ static void test_ShowWindow(void) todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); + GetClientRect(hwnd, &rc); + todo_wine + ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
ret = ShowWindow(hwnd, SW_RESTORE); ok(ret, "not expected ret: %lu\n", ret); @@ -6657,6 +6692,9 @@ static void test_ShowWindow(void) GetWindowRect(hwnd, &rc); ok(EqualRect(&rcMain, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMain), wine_dbgstr_rect(&rc)); + GetClientRect(hwnd, &rc); + ok(EqualRect(&rcClient, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0); ok(!ret, "not expected ret: %lu\n", ret); @@ -6682,6 +6720,10 @@ static void test_ShowWindow(void) todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); + GetClientRect(hwnd, &rc); + todo_wine + ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc)); DestroyWindow(hwnd);
hwnd = CreateWindowExA(0, "MainWindowClass", NULL, @@ -6697,6 +6739,10 @@ static void test_ShowWindow(void) todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); + GetClientRect(hwnd, &rc); + todo_wine + ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc)); DestroyWindow(hwnd); }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/user32/tests/win.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 6268042..f9472ec 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -6528,8 +6528,9 @@ static void test_ShowWindow(void) { HWND hwnd; DWORD style; - RECT rcMain, rc, rcMinimized, rcClient, rcEmpty; + RECT rcMain, rc, rcMinimized, rcClient, rcEmpty, rcMaximized, rcResized; LPARAM ret; + MONITORINFO mon_info;
SetRect(&rcClient, 0, 0, 90, 90); rcMain = rcClient; @@ -6547,6 +6548,12 @@ static void test_ShowWindow(void) 0, 0, 0, NULL); assert(hwnd);
+ mon_info.cbSize = sizeof(mon_info); + GetMonitorInfoW(MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY), &mon_info); + rcMaximized = mon_info.rcWork; + AdjustWindowRectEx(&rcMaximized, GetWindowLongA(hwnd, GWL_STYLE) & ~WS_BORDER, + 0, GetWindowLongA(hwnd, GWL_EXSTYLE)); + style = GetWindowLongA(hwnd, GWL_STYLE); ok(!(style & WS_DISABLED), "window should not be disabled\n"); ok(!(style & WS_VISIBLE), "window should not be visible\n"); @@ -6617,6 +6624,35 @@ static void test_ShowWindow(void) ok(EqualRect(&rcClient, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcClient), wine_dbgstr_rect(&rc));
+ ShowWindow(hwnd, SW_MAXIMIZE); + ok(ret, "not expected ret: %lu\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(!(style & WS_MINIMIZE), "window should be minimized\n"); + ok(style & WS_MAXIMIZE, "window should not be maximized\n"); + GetWindowRect(hwnd, &rc); + ok(EqualRect(&rcMaximized, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcMaximized), wine_dbgstr_rect(&rc)); + /* maximized windows can be resized */ + ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER); + ok(ret, "not expected ret: %lu\n", ret); + SetRect(&rcResized, 300, 300, 500, 500); + GetWindowRect(hwnd, &rc); + ok(EqualRect(&rcResized, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcResized), wine_dbgstr_rect(&rc)); + + ShowWindow(hwnd, SW_RESTORE); + ok(ret, "not expected ret: %lu\n", ret); + style = GetWindowLongA(hwnd, GWL_STYLE); + ok(!(style & WS_DISABLED), "window should not be disabled\n"); + ok(style & WS_VISIBLE, "window should be visible\n"); + ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); + ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); + GetWindowRect(hwnd, &rc); + ok(EqualRect(&rcMain, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMain), + wine_dbgstr_rect(&rc)); + ret = EnableWindow(hwnd, FALSE); ok(!ret, "not expected ret: %lu\n", ret); style = GetWindowLongA(hwnd, GWL_STYLE);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- The test added by this patch requires both this and the next patch to pass under Wine. I would have reversed the order, but the next patch alone causes a failure in the window procedure.
dlls/user32/tests/win.c | 12 ++++++++++++ dlls/user32/winpos.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index f9472ec..4190c7f 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -6609,6 +6609,18 @@ static void test_ShowWindow(void) todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc)); + /* SetWindowPos shouldn't affect the client rect */ + ret = SetWindowPos(hwnd, 0, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER); + ok(ret, "not expected ret: %lu\n", ret); + GetWindowRect(hwnd, &rc); + todo_wine + ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); + GetClientRect(hwnd, &rc); + todo_wine + ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", + wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
ShowWindow(hwnd, SW_RESTORE); ok(ret, "not expected ret: %lu\n", ret); diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 10f0fd0..49e4e3f 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -1661,7 +1661,7 @@ static BOOL SWP_DoWinPosChanging( WINDOWPOS* pWinpos, RECT* pNewWindowRect, RECT
WIN_GetRectangles( pWinpos->hwnd, COORDS_PARENT, &window_rect, &client_rect ); *pNewWindowRect = window_rect; - *pNewClientRect = (wndPtr->dwStyle & WS_MINIMIZE) ? window_rect : client_rect; + *pNewClientRect = client_rect;
if (!(pWinpos->flags & SWP_NOSIZE)) {
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- This mitigates an intermittent failure in the tests for LockWindowUpdate() on the testbot, reducing it from a crash to a normal failure. For as-yet undetermined reasons, the test window is being minimized, causing GetPixel() to attempt to access memory around (-32000,-32000) pixels outside of the window's actual bitmap.
More work should be done in the interest of using actual Win32 minimized windows, rather than icons; this however is just an attempt to fix the tests.
dlls/user32/nonclient.c | 5 +++++ dlls/user32/tests/win.c | 21 +++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index 2b38897..0edf439 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -457,6 +457,11 @@ LRESULT NC_HandleNCCalcSize( HWND hwnd, WPARAM wparam, RECT *winRect ) if (winRect->left > winRect->right) winRect->right = winRect->left; } + else + { + winRect->right = winRect->left; + winRect->bottom = winRect->top; + } return result; }
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 4190c7f..54484ae 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -1082,7 +1082,7 @@ static void wine_AdjustWindowRectEx( RECT *rect, LONG style, BOOL menu, LONG exS static void test_nonclient_area(HWND hwnd) { DWORD style, exstyle; - RECT rc_window, rc_client, rc; + RECT rc_window, rc_client, rc_minimized, rc_empty, rc; BOOL menu; LRESULT ret;
@@ -1124,6 +1124,18 @@ static void test_nonclient_area(HWND hwnd) ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, 0); ok(ret == 0, "NULL rectangle returned %ld instead of 0\n", ret);
+ /* try minimized */ + ShowWindow(hwnd, SW_MINIMIZE); + GetWindowRect(hwnd, &rc_minimized); + SetRectEmpty(&rc_empty); + rc = rc_minimized; + DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc); + MapWindowPoints(0, hwnd, (LPPOINT)&rc, 2); + ok(EqualRect(&rc, &rc_empty), + "client rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d client=%s, calc=%s\n", + style, exstyle, menu, wine_dbgstr_rect(&rc_empty), wine_dbgstr_rect(&rc)); + ShowWindow(hwnd, SW_RESTORE); + /* Win9x doesn't like WM_NCCALCSIZE with synthetic data and crashes */; if (is_win9x) return; @@ -6592,7 +6604,6 @@ static void test_ShowWindow(void) ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc)); /* shouldn't be able to resize minimized windows */ @@ -6606,7 +6617,6 @@ static void test_ShowWindow(void) ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc)); /* SetWindowPos shouldn't affect the client rect */ @@ -6618,7 +6628,6 @@ static void test_ShowWindow(void) ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
@@ -6710,7 +6719,6 @@ static void test_ShowWindow(void) ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
@@ -6726,7 +6734,6 @@ static void test_ShowWindow(void) ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
@@ -6769,7 +6776,6 @@ static void test_ShowWindow(void) ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc)); DestroyWindow(hwnd); @@ -6788,7 +6794,6 @@ static void test_ShowWindow(void) ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc)); DestroyWindow(hwnd);
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=34858
Your paranoid android.
=== wvistau64 (32 bit win) === win.c:988: Test failed: wrong dwStyle: 04c80000 != 14c80000 for 003901BE in hook HCBT_MINMAX win.c:988: Test failed: wrong dwStyle: 04c10000 != 14c10000 for 003C01BE in hook HCBT_MINMAX win.c:988: Test failed: wrong dwStyle: 04e00000 != 14e00000 for 003E01BE in hook HCBT_MINMAX win.c:988: Test failed: wrong dwStyle: 84000000 != 94000000 for 003F01BE in hook HCBT_ACTIVATE win.c:988: Test failed: wrong dwStyle: 84000000 != 94000000 for 004501BE in hook HCBT_ACTIVATE
=== w7pro64 (32 bit win) === win.c:988: Test failed: wrong dwStyle: 05c00000 != 15c00000 for 002E0026 in hook HCBT_ACTIVATE
=== wvistau64 (64 bit win) === win.c:988: Test failed: wrong dwStyle: 24c00000 != 34c00000 for 0000000000360166 in hook HCBT_MINMAX win.c:988: Test failed: wrong dwStyle: 04c00000 != 14c00000 for 0000000000370166 in hook HCBT_MINMAX win.c:988: Test failed: wrong dwStyle: 04c40000 != 14c40000 for 00000000001801F0 in hook HCBT_MINMAX win.c:988: Test failed: wrong dwStyle: 04d00000 != 14d00000 for 00000000001B01F0 in hook HCBT_MINMAX
=== w7pro64 (64 bit win) === win.c:988: Test failed: wrong dwStyle: 24c00000 != 34c00000 for 00000000002E0026 in hook HCBT_MINMAX
Zebediah Figura z.figura12@gmail.com writes:
Signed-off-by: Zebediah Figura z.figura12@gmail.com
This mitigates an intermittent failure in the tests for LockWindowUpdate() on the testbot, reducing it from a crash to a normal failure. For as-yet undetermined reasons, the test window is being minimized, causing GetPixel() to attempt to access memory around (-32000,-32000) pixels outside of the window's actual bitmap.
No matter how screwed up the window position may be, it shouldn't access memory outside of the bitmap. Any chance you could write a test reproducing this crash?
On 12/21/2017 09:22 AM, Alexandre Julliard wrote:
Zebediah Figura z.figura12@gmail.com writes:
Signed-off-by: Zebediah Figura z.figura12@gmail.com
This mitigates an intermittent failure in the tests for LockWindowUpdate() on the testbot, reducing it from a crash to a normal failure. For as-yet undetermined reasons, the test window is being minimized, causing GetPixel() to attempt to access memory around (-32000,-32000) pixels outside of the window's actual bitmap.
No matter how screwed up the window position may be, it shouldn't access memory outside of the bitmap. Any chance you could write a test reproducing this crash?
Sure. I've attached a simple test program that creates a window, minimizes it, and tries to get the pixel at (10,10). On my machine this crashes with the backtrace below. dibdrv_GetPixel() only appears to test whether the requested pixel is within the bounds of the DIB rect relative to the position of the DIB rect, so it doesn't prevent this.
window: (-32000,-32000)-(-31968,-31968) client: (0,0)-(32,32) wine: Unhandled page fault on read access to 0x7e0c769c at address 0x7ebfa5fd (thread 0009), starting debugger... Unhandled exception: page fault on read access to 0x7e0c769c in 32-bit code (0x7ebfa5fd). Register dump: CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b EIP:7ebfa5fd ESP:0061fcac EBP:0061fce8 EFLAGS:00010207( R- -- I - -P-C) EAX:7e4aec9c EBX:0000000a ECX:001287b4 EDX:ffc18a00 ESI:001287b4 EDI:001287a8 Stack dump: 0x0061fcac: 7ebf1750 001287b4 0000000a 0000000a 0x0061fcbc: 7b63a000 0000000a 0000000a 0000000a 0x0061fccc: 70a93e00 00126d88 00010010 7ebf167b 0x0061fcdc: 0011d5f0 0000000a 001283d8 0061fd08 0x0061fcec: 7ebec9b3 001287a8 0000000a 0000000a 0x0061fcfc: 7ebec9f5 0000000a 0000000a 0061fd38 Backtrace: =>0 0x7ebfa5fd get_pixel_32+0x1d(dib=<is not available>, x=<is not available>, y=<is not available>) [/home/hazel/git/wine32/dlls/gdi32/../../../wine/dlls/gdi32/dibdrv/primitives.c:2009] in gdi32 (0x0061fce8) 1 0x7ebf1750 dibdrv_GetPixel+0xdf(dev=0x1287a8, x=0xa, y=0xa) [/home/hazel/git/wine32/dlls/gdi32/../../../wine/dlls/gdi32/dibdrv/graphics.c:1123] in gdi32 (0x0061fce8) 2 0x7ebec9b3 windrv_GetPixel+0x62(dev=<is not available>, x=0xa, y=0xa) [/home/hazel/git/wine32/dlls/gdi32/../../../wine/dlls/gdi32/dibdrv/dc.c:793] in gdi32 (0x0061fd08) 3 0x7ec562b7 GetPixel+0x66(hdc=<couldn't compute location>, x=<couldn't compute location>, y=<couldn't compute location>) [/home/hazel/git/wine32/dlls/gdi32/../../../wine/dlls/gdi32/painting.c:495] in gdi32 (0x0061fd38) 4 0x004016fe in gptest (+0x16fd) (0x0061fdc8) 5 0x0040291d in gptest (+0x291c) (0x0061fde8) 6 0x004013e2 in gptest (+0x13e1) (0x0061fec0) 7 0x7b461f8c call_process_entry+0xb() in kernel32 (0x0061fed8) 8 0x7b463892 start_process+0x111(entry=<couldn't compute location>, peb=<couldn't compute location>) [/home/hazel/git/wine32/dlls/kernel32/../../../wine/dlls/kernel32/process.c:1139] in kernel32 (0x0061ffd8) 9 0x7b461f9a start_process_wrapper+0x9() in kernel32 (0x0061ffec) 0x7ebfa5fd get_pixel_32+0x1d [/home/hazel/git/wine32/dlls/gdi32/../../../wine/dlls/gdi32/dibdrv/primitives.c:2009] in gdi32: movl 0x0(%eax,%edx,1),%eax 2009 return *ptr;
Zebediah Figura z.figura12@gmail.com writes:
On 12/21/2017 09:22 AM, Alexandre Julliard wrote:
Zebediah Figura z.figura12@gmail.com writes:
Signed-off-by: Zebediah Figura z.figura12@gmail.com
This mitigates an intermittent failure in the tests for LockWindowUpdate() on the testbot, reducing it from a crash to a normal failure. For as-yet undetermined reasons, the test window is being minimized, causing GetPixel() to attempt to access memory around (-32000,-32000) pixels outside of the window's actual bitmap.
No matter how screwed up the window position may be, it shouldn't access memory outside of the bitmap. Any chance you could write a test reproducing this crash?
Sure. I've attached a simple test program that creates a window, minimizes it, and tries to get the pixel at (10,10). On my machine this crashes with the backtrace below. dibdrv_GetPixel() only appears to test whether the requested pixel is within the bounds of the DIB rect relative to the position of the DIB rect, so it doesn't prevent this.
Thanks for the test, the crash should be fixed now.
We really shouldn't be creating a surface at all for minimized windows, but I'll fix that one after code freeze.
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=34854
Your paranoid android.
=== w1064 (32 bit win) === win.c:2331: Test failed: expected !100 win.c:2331: Test failed: expected !100
On 12/21/2017 01:31 AM, Marvin wrote:
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=34854
Your paranoid android.
=== w1064 (32 bit win) === win.c:2331: Test failed: expected !100 win.c:2331: Test failed: expected !100
This is a preëxisting failure. I'm not sure about the other one, though; I'll look at it.