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 0156987f529..7ebba960951 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -11965,6 +11965,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); }
@@ -12124,7 +12135,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 --- The DayZ launcher has some invalid calls that, while I can't check this directly, probably also happen on Windows.
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 7ebba960951..8085c40e7a4 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -11971,10 +11971,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=104211
Your paranoid android.
=== w1064v1809 (32 bit report) ===
user32: win.c:4013: Test failed: message 0738 available
=== w10pro64 (32 bit report) ===
user32: win.c:2271: Test failed: style 0x200000: expected !100 win.c:2271: Test failed: style 0x300000: expected !100
=== w10pro64 (64 bit report) ===
user32: win.c:2271: Test failed: style 0x200000: expected !100 win.c:2271: Test failed: style 0x300000: expected !100
=== w10pro64_zh_CN (64 bit report) ===
user32: win.c:10264: Test failed: pos = 00fa00fa win.c:10268: Test failed: pos = 00fa00fa win.c:10272: Test failed: pos = 00fa00fa
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=104210
Your paranoid android.
=== w1064v1809 (32 bit report) ===
user32: win.c:4013: Test failed: message 0738 available
=== w10pro64 (32 bit report) ===
user32: win.c:2271: Test failed: style 0x200000: expected !100 win.c:2271: Test failed: style 0x300000: expected !100
=== w10pro64 (64 bit report) ===
user32: win.c:2271: Test failed: style 0x200000: expected !100 win.c:2271: Test failed: style 0x300000: expected !100