Prevent accessing Null

Medland, Bill Bill.Medland at accpac.com
Mon Oct 15 16:06:37 CDT 2001


 <<diff25.txt>> 
-------------- next part --------------
Bill Medland (medbi01 at accpac.com)
Only modify the ancestor if you find it.
I presume it is safe to exclude any else statement and leave the
wIconized in its current state.

Index: wine/windows/winpos.c
===================================================================
RCS file: /home/wine/wine/windows/winpos.c,v
retrieving revision 1.122
diff -u -r1.122 winpos.c
--- wine/windows/winpos.c	2001/10/11 20:49:40	1.122
+++ wine/windows/winpos.c	2001/10/15 19:51:35
@@ -1292,12 +1292,14 @@
     {
         /* walk up to the first unowned window */
         HWND tmp = GetAncestor( hWnd, GA_ROOTOWNER );
-        wndTemp = WIN_FindWndPtr( tmp );
-        /* and set last active owned popup */
-        wndTemp->hwndLastActive = hWnd;
+        if ((wndTemp = WIN_FindWndPtr( tmp )))
+        {
+            /* and set last active owned popup */
+            wndTemp->hwndLastActive = hWnd;
 
-        wIconized = HIWORD(wndTemp->dwStyle & WS_MINIMIZE);
-        WIN_ReleaseWndPtr(wndTemp);
+            wIconized = HIWORD(wndTemp->dwStyle & WS_MINIMIZE);
+            WIN_ReleaseWndPtr(wndTemp);
+        }
         SendMessageA( hWnd, WM_NCACTIVATE, TRUE, 0 );
         SendMessageA( hWnd, WM_ACTIVATE,
 		 MAKEWPARAM( (fMouse) ? WA_CLICKACTIVE : WA_ACTIVE, wIconized),


More information about the wine-patches mailing list