Fix some Wine/ReactOS differences
authorGé van Geldorp <ge@gse.nl>
Tue, 9 Dec 2003 23:36:25 +0000 (23:36 +0000)
committerGé van Geldorp <ge@gse.nl>
Tue, 9 Dec 2003 23:36:25 +0000 (23:36 +0000)
svn path=/trunk/; revision=6941

reactos/lib/user32/windows/mdi.c

index a0506d5..ceae74e 100644 (file)
@@ -1332,7 +1332,11 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
 {
     MDICLIENTINFO *ci;
 
-    if (!(ci = get_client_info( hwnd ))) return 0;
+    if (WM_NCCREATE != message && WM_CREATE != message
+        && NULL == (ci = get_client_info(hwnd)))
+    {
+        return 0;
+    }
 
     switch (message)
     {
@@ -1345,6 +1349,12 @@ static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
 #ifndef __REACTOS__
           WND *wndPtr = WIN_GetPtr( hwnd );
 #endif
+       ci = HeapAlloc(GetProcessHeap(), 0, sizeof(MDICLIENTINFO));
+       if (NULL == ci)
+       {
+           return -1;
+       }
+       SetWindowLongPtr(hwnd, 0, (LONG_PTR) ci);
 
        /* Translation layer doesn't know what's in the cs->lpCreateParams
         * so we have to keep track of what environment we're in. */