Brendan Shanks : user32: Fix behavior of GetWindowInfo(0, NULL).
Module: wine Branch: master Commit: c8dbb0c4c1ec4cc7979715a6ebc02ece90ae220e URL: https://source.winehq.org/git/wine.git/?a=commit;h=c8dbb0c4c1ec4cc7979715a6e... Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Mon Sep 23 10:41:07 2019 -0700 user32: Fix behavior of GetWindowInfo(0, NULL). Windows doesn't do a NULL check on the WINDOWINFO pointer. Signed-off-by: Brendan Shanks <bshanks(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/win.c | 2 +- dlls/user32/win.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 6b600cb1bc..784849b2ba 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -1007,7 +1007,7 @@ static void test_window_info(const char *hook, HWND hwnd) if (0) { /* crashes on XP, 2003 */ SetLastError(0xdeadbeef); ok(!pGetWindowInfo(0, NULL), "GetWindowInfo should fail\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, + ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got error %d expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError()); } diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 3582262b7d..3323ed3e41 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -3845,9 +3845,13 @@ UINT WINAPI GetWindowModuleFileNameW( HWND hwnd, LPWSTR module, UINT size ) */ BOOL WINAPI DECLSPEC_HOTPATCH GetWindowInfo( HWND hwnd, PWINDOWINFO pwi) { + RECT rcWindow, rcClient; + + if (!WIN_GetRectangles( hwnd, COORDS_SCREEN, &rcWindow, &rcClient )) return FALSE; if (!pwi) return FALSE; - if (!WIN_GetRectangles( hwnd, COORDS_SCREEN, &pwi->rcWindow, &pwi->rcClient )) return FALSE; + pwi->rcWindow = rcWindow; + pwi->rcClient = rcClient; pwi->dwStyle = GetWindowLongW(hwnd, GWL_STYLE); pwi->dwExStyle = GetWindowLongW(hwnd, GWL_EXSTYLE); pwi->dwWindowStatus = ((GetActiveWindow() == hwnd) ? WS_ACTIVECAPTION : 0);
participants (1)
-
Alexandre Julliard