From: Esme Povirk Subject: [PATCH 1/2] user32: Test Get/SetWindowPlacement with invalid length. Message-Id: <20220126205735.394331-1-esme@codeweavers.com> Date: Wed, 26 Jan 2022 14:57:34 -0600 Signed-off-by: Esme Povirk --- dlls/user32/tests/win.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index cb6b61e59c0..b1ef97c01d6 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -12086,6 +12086,17 @@ static void test_window_placement(void) GetWindowRect(hwnd, &rect); ok(EqualRect(&rect, &orig), "got window rect %s\n", wine_dbgstr_rect(&rect)); + ret = SetWindowPlacement(hwnd, &wp); + ok(ret, "failed to set window placement, error %u\n", GetLastError()); + + wp.length = 0; + SetLastError(0xdeadbeef); + ret = SetWindowPlacement(hwnd, &wp); +todo_wine { + ok(!ret, "SetWindowPlacement should have failed\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); +} + DestroyWindow(hwnd); } @@ -12245,7 +12256,7 @@ static void test_arrange_iconic_windows(void) static void other_process_proc(HWND hwnd) { HANDLE window_ready_event, test_done_event; - WINDOWPLACEMENT wp; + WINDOWPLACEMENT wp = {0}; DWORD ret; window_ready_event = OpenEventA(EVENT_ALL_ACCESS, FALSE, "test_opw_window"); -- 2.30.2