mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 06:21:15 +00:00
win32u: Reject invalid length in SetWindowPlacement.
This commit is contained in:
parent
f91eb0a9e0
commit
8e73b48f34
|
@ -12504,10 +12504,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 %lu\n", GetLastError());
|
||||
}
|
||||
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
|
|
|
@ -2567,6 +2567,11 @@ BOOL WINAPI NtUserSetWindowPlacement( HWND hwnd, const WINDOWPLACEMENT *wpl )
|
|||
{
|
||||
UINT flags = PLACE_MAX | PLACE_RECT;
|
||||
if (!wpl) return FALSE;
|
||||
if (wpl->length != sizeof(*wpl))
|
||||
{
|
||||
RtlSetLastWin32Error( ERROR_INVALID_PARAMETER );
|
||||
return FALSE;
|
||||
}
|
||||
if (wpl->flags & WPF_SETMINPOSITION) flags |= PLACE_MIN;
|
||||
return set_window_placement( hwnd, wpl, flags );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue