Signed-off-by: Esme Povirk esme@codeweavers.com --- 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");
Signed-off-by: Esme Povirk esme@codeweavers.com --- dlls/user32/tests/win.c | 2 -- dlls/user32/winpos.c | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index b1ef97c01d6..60b19333978 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -12092,10 +12092,8 @@ static void test_window_placement(void) 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); } diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index ff23206b395..eeae9337c33 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -1530,6 +1530,11 @@ BOOL WINAPI SetWindowPlacement( HWND hwnd, const WINDOWPLACEMENT *wpl ) { UINT flags = PLACE_MAX | PLACE_RECT; if (!wpl) return FALSE; + if (wpl->length != sizeof(*wpl)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } if (wpl->flags & WPF_SETMINPOSITION) flags |= PLACE_MIN; return WINPOS_SetPlacement( hwnd, wpl, flags ); }
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=106114
Your paranoid android.
=== w10pro64 (32 bit report) ===
user32: win.c:2392: Test failed: style 0x200000: expected !100 win.c:2392: Test failed: style 0x300000: expected !100
=== w10pro64 (64 bit report) ===
user32: win.c:2392: Test failed: style 0x200000: expected !100 win.c:2392: Test failed: style 0x300000: expected !100
=== w10pro64_zh_CN (64 bit report) ===
user32: win.c:10385: Test failed: pos = 00fa00fa win.c:10389: Test failed: pos = 00fa00fa win.c:10393: Test failed: pos = 00fa00fa
=== debian11 (32 bit French report) ===
user32: win.c:10554: Test failed: Expected foreground window 0, got 01130074 win.c:10560: Test failed: Expected foreground window 00020052, got 01130074 win.c:10577: Test failed: Expected foreground window 00020052, got 01130074 win.c:10579: Test failed: GetActiveWindow() = 00000000 win.c:10579: Test failed: GetFocus() = 00000000 win.c:10581: Test failed: Received WM_ACTIVATEAPP(0), did not expect it. win.c:10589: Test failed: Expected foreground window 00020052, got 00000000 win.c:10591: Test failed: GetActiveWindow() = 00000000 win.c:10591: Test failed: GetFocus() = 00000000 win.c:10599: Test failed: Received WM_ACTIVATEAPP(1), did not expect it.
=== debian11 (64 bit WoW report) ===
user32: menu.c:2337: Test failed: test 25 win.c:10577: Test failed: Expected foreground window 0000000000550126, got 00000000011600EC win.c:10579: Test failed: GetActiveWindow() = 0000000000000000 win.c:10579: Test failed: GetFocus() = 0000000000000000 win.c:10580: Test failed: Received WM_ACTIVATEAPP(1), did not expect it. win.c:10581: Test failed: Received WM_ACTIVATEAPP(0), did not expect it. win.c:10589: Test failed: Expected foreground window 0000000000550126, got 0000000000000000 win.c:10591: Test failed: GetActiveWindow() = 0000000000000000 win.c:10591: Test failed: GetFocus() = 0000000000000000 win.c:10599: Test failed: Received WM_ACTIVATEAPP(1), did not expect it.
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=106113
Your paranoid android.
=== w10pro64 (32 bit report) ===
user32: win.c:2392: Test failed: style 0x200000: expected !100 win.c:2392: Test failed: style 0x300000: expected !100
=== w10pro64 (64 bit report) ===
user32: win.c:2392: Test failed: style 0x200000: expected !100 win.c:2392: Test failed: style 0x300000: expected !100
=== debian11 (32 bit Hindi:India report) ===
user32: win.c:11348: Test succeeded inside todo block: child should be topmost win.c:11351: Test failed: grandchild should be topmost win.c:11359: Test failed: child should NOT be topmost win.c:11362: Test succeeded inside todo block: grandchild should NOT be topmost win.c:11365: Test failed: 012A00B4: expected NOT topmost win.c:11184: Test succeeded inside todo block: 5: hwnd 009C00B6 is still topmost
May I have some feedback for this series?