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