v3: As suggested by Alexandre changed NC_HandleNCCalcSize to not return a value.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=37609 Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/user32/controls.h | 2 +- dlls/user32/defwnd.c | 3 ++- dlls/user32/nonclient.c | 9 ++------- dlls/user32/tests/win.c | 6 ------ 4 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h index ce14d13171f..52584748768 100644 --- a/dlls/user32/controls.h +++ b/dlls/user32/controls.h @@ -168,7 +168,7 @@ extern void MENU_EndMenu(HWND) DECLSPEC_HIDDEN; /* nonclient area */ extern LRESULT NC_HandleNCPaint( HWND hwnd , HRGN clip) DECLSPEC_HIDDEN; extern LRESULT NC_HandleNCActivate( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN; -extern LRESULT NC_HandleNCCalcSize( HWND hwnd, WPARAM wParam, RECT *winRect ) DECLSPEC_HIDDEN; +extern void NC_HandleNCCalcSize( HWND hwnd, WPARAM wParam, RECT *winRect ) DECLSPEC_HIDDEN; extern LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN; extern LRESULT NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN; extern LRESULT NC_HandleNCMouseMove( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN; diff --git a/dlls/user32/defwnd.c b/dlls/user32/defwnd.c index abb73e73ca8..a8978c2d847 100644 --- a/dlls/user32/defwnd.c +++ b/dlls/user32/defwnd.c @@ -260,7 +260,8 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa }
case WM_NCCALCSIZE: - return NC_HandleNCCalcSize( hwnd, wParam, (RECT *)lParam ); + NC_HandleNCCalcSize( hwnd, wParam, (RECT *)lParam ); + break;
case WM_WINDOWPOSCHANGING: return WINPOS_HandleWindowPosChanging( hwnd, (WINDOWPOS *)lParam ); diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index 639cca707fb..f944ed568a4 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -346,19 +346,15 @@ BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRectExForDpi( LPRECT rect, DWORD style * * Handle a WM_NCCALCSIZE message. Called from DefWindowProc(). */ -LRESULT NC_HandleNCCalcSize( HWND hwnd, WPARAM wparam, RECT *winRect ) +void NC_HandleNCCalcSize( HWND hwnd, WPARAM wparam, RECT *winRect ) { RECT tmpRect = { 0, 0, 0, 0 }; - LRESULT result = 0; LONG cls_style = GetClassLongW(hwnd, GCL_STYLE); LONG style = GetWindowLongW( hwnd, GWL_STYLE ); LONG exStyle = GetWindowLongW( hwnd, GWL_EXSTYLE );
if (winRect == NULL) - return 0; - - if (cls_style & CS_VREDRAW) result |= WVR_VREDRAW; - if (cls_style & CS_HREDRAW) result |= WVR_HREDRAW; + return;
if (!(style & WS_MINIMIZE)) { @@ -413,7 +409,6 @@ LRESULT NC_HandleNCCalcSize( HWND hwnd, WPARAM wparam, RECT *winRect ) 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 4aeb3816db2..847093710a5 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -1236,7 +1236,6 @@ static void test_nonclient_area(HWND hwnd)
rc = rc_window; ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc); -todo_wine_if(ret != 0) ok(!ret, "got %08lx\n", ret); MapWindowPoints(0, hwnd, (LPPOINT)&rc, 2); ok(EqualRect(&rc, &rc_client), @@ -1255,7 +1254,6 @@ todo_wine_if(ret != 0)
rc = rc_window; ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, (LPARAM)&rc); -todo_wine_if(ret != 0) ok(!ret, "got %08lx\n", ret); MapWindowPoints(0, hwnd, (LPPOINT)&rc, 2); ok(EqualRect(&rc, &rc_client), @@ -12673,25 +12671,21 @@ static void test_WM_NCCALCSIZE(void) params.lppos = &winpos;
ret = SendMessageW(hwnd, WM_NCCALCSIZE, TRUE, (LPARAM)¶ms); -todo_wine ok(!ret, "got %08lx\n", ret); ok(EqualRect(¶ms.rgrc[0], &client_rect), "got %s\n", wine_dbgstr_rect(¶ms.rgrc[0]));
params.rgrc[0] = window_rect; ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, TRUE, (LPARAM)¶ms); -todo_wine ok(!ret, "got %08lx\n", ret); ok(EqualRect(¶ms.rgrc[0], &client_rect), "got %s\n", wine_dbgstr_rect(¶ms.rgrc[0]));
GetWindowRect(hwnd, &window_rect); ret = SendMessageW(hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&window_rect); -todo_wine ok(!ret, "got %08lx\n", ret); ok(EqualRect(&window_rect, &client_rect), "got %s\n", wine_dbgstr_rect(&window_rect));
GetWindowRect(hwnd, &window_rect); ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&window_rect); -todo_wine ok(!ret, "got %08lx\n", ret); ok(EqualRect(&window_rect, &client_rect), "got %s\n", wine_dbgstr_rect(&window_rect));
Hi,
While running your changed tests, 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=106956
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w7u_adm (32 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w7u_el (32 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w8 (32 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w8adm (32 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w864 (32 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w1064v1507 (32 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w1064v1809 (32 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w1064 (32 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w1064_tsign (32 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w10pro64 (32 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w864 (64 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w1064v1507 (64 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w1064v1809 (64 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w1064 (64 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w1064_2qxl (64 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w1064_tsign (64 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w10pro64 (64 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w10pro64_ar (64 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w10pro64_he (64 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w10pro64_ja (64 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== w10pro64_zh_CN (64 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== debian11 (32 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== debian11 (32 bit Arabic:Morocco report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0 win.c:10732: Test failed: Expected foreground window 0, got 00F700B6 win.c:10738: Test failed: Expected foreground window 00020052, got 00F700B6
=== debian11 (32 bit German report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== debian11 (32 bit French report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== debian11 (32 bit Hebrew:Israel report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== debian11 (32 bit Hindi:India report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== debian11 (32 bit Japanese:Japan report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== debian11 (32 bit Chinese:China report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== debian11 (32 bit WoW report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
=== debian11 (64 bit WoW report) ===
user32: menu.c:2337: Test failed: test 25 win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
Marvin testbot@winehq.org wrote:
=== w7u_2qxl (32 bit report) ===
user32: win.c:7292: Test failed: not expected ret: 0 win.c:7306: Test failed: not expected ret: 0
Same here:
All these failures are pre-existing, and supposed to be fixed by the patch user32/tests: Actually test ShowWindow() return value.