user32: Initialize length before calling GetWindowPlacement().

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2017-10-30 10:29:16 +00:00 committed by Alexandre Julliard
parent 2b8a38169b
commit 9933a0fc86
2 changed files with 3 additions and 0 deletions

View file

@ -415,6 +415,7 @@ HMONITOR WINAPI MonitorFromWindow(HWND hWnd, DWORD dwFlags)
TRACE("(%p, 0x%08x)\n", hWnd, dwFlags);
wp.length = sizeof(wp);
if (IsIconic(hWnd) && GetWindowPlacement(hWnd, &wp))
return MonitorFromRect( &wp.rcNormalPosition, dwFlags );

View file

@ -1255,6 +1255,8 @@ UINT WINAPI GetInternalWindowPos( HWND hwnd, LPRECT rectWnd,
LPPOINT ptIcon )
{
WINDOWPLACEMENT wndpl;
wndpl.length = sizeof(wndpl);
if (GetWindowPlacement( hwnd, &wndpl ))
{
if (rectWnd) *rectWnd = wndpl.rcNormalPosition;