diff --git a/dlls/user32/misc.c b/dlls/user32/misc.c index fa0502e25eb..895ccce312a 100644 --- a/dlls/user32/misc.c +++ b/dlls/user32/misc.c @@ -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 ); diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 6b6b26a7c89..10f0fd06990 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -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;