Commit in reactos/lib/user32/windows on MAIN
mdi.c+5-101.16 -> 1.17
- Allocate the MDI client context structure only once (and don't create a second one in WM_CREATE and leak the first one).
- Don't call SetScrollInfo with SB_BOTH.
- Don't add empty system icon to the client menu.

reactos/lib/user32/windows
mdi.c 1.16 -> 1.17
diff -u -r1.16 -r1.17
--- mdi.c	2 Aug 2004 03:03:10 -0000	1.16
+++ mdi.c	5 Dec 2004 03:50:47 -0000	1.17
@@ -1137,7 +1137,8 @@
     hSysMenuBitmap = hBmpClose;
 #endif
 
-    if( !InsertMenuA(menu,0,MF_BYPOSITION | MF_BITMAP | MF_POPUP,
+    if(  hSysMenuBitmap != NULL &&
+         !InsertMenuA(menu,0,MF_BYPOSITION | MF_BITMAP | MF_POPUP,
                      (UINT_PTR)hSysPopup, (LPSTR)hSysMenuBitmap))
     {
         TRACE("not inserted\n");
@@ -1307,7 +1308,7 @@
 {
     MDICLIENTINFO *ci = NULL;
 
-    if (WM_NCCREATE != message && WM_CREATE != message
+    if (WM_NCCREATE != message
         && NULL == (ci = get_client_info(hwnd)))
     {
         return 0;
@@ -1332,12 +1333,6 @@
 #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. */
@@ -2139,14 +2134,14 @@
 			info.nMin = childRect.left;
 			info.nMax = childRect.right - clientRect.right;
 			info.nPos = clientRect.left - childRect.left;
-			SetScrollInfo(hwnd, scroll, &info, TRUE);
+			SetScrollInfo(hwnd, SB_HORZ, &info, TRUE);
 			if (scroll == SB_HORZ) break;
 			/* fall through */
 	case SB_VERT:
 			info.nMin = childRect.top;
 			info.nMax = childRect.bottom - clientRect.bottom;
 			info.nPos = clientRect.top - childRect.top;
-			SetScrollInfo(hwnd, scroll, &info, TRUE);
+			SetScrollInfo(hwnd, SB_VERT, &info, TRUE);
 			break;
     }
 }
CVSspam 0.2.8