[PATCH 5/5] user32: Initialize length before calling GetWindowPlacement().

Huw Davies huw at codeweavers.com
Mon Oct 30 05:29:16 CDT 2017


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 dlls/user32/misc.c   | 1 +
 dlls/user32/winpos.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/dlls/user32/misc.c b/dlls/user32/misc.c
index fa0502e25e..895ccce312 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 6b6b26a7c8..10f0fd0699 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;
-- 
2.12.0




More information about the wine-patches mailing list