[Win32k|User32]
authorJames Tabor <james.tabor@reactos.org>
Thu, 30 Dec 2010 00:59:10 +0000 (00:59 +0000)
committerJames Tabor <james.tabor@reactos.org>
Thu, 30 Dec 2010 00:59:10 +0000 (00:59 +0000)
- Fix mdi class window function Id, now msi message tests do not assert.

svn path=/trunk/; revision=50218

reactos/dll/win32/user32/windows/mdi.c
reactos/dll/win32/user32/windows/window.c
reactos/subsystems/win32/win32k/ntuser/window.c

index cde115d..e7c091a 100644 (file)
@@ -1111,6 +1111,7 @@ LRESULT WINAPI MDIClientWndProc_common( HWND hwnd, UINT message, WPARAM wParam,
              return FALSE;
            SetWindowLongPtrW( hwnd, 0, (LONG_PTR)ci );
            ci->hBmpClose = 0;
+           NtUserSetWindowFNID( hwnd, FNID_MDICLIENT); // wine uses WIN_ISMDICLIENT
 #else
            WND *wndPtr = WIN_GetPtr( hwnd );
            wndPtr->flags |= WIN_ISMDICLIENT;
@@ -1160,6 +1161,7 @@ LRESULT WINAPI MDIClientWndProc_common( HWND hwnd, UINT message, WPARAM wParam,
 #ifdef __REACTOS__
           HeapFree( GetProcessHeap(), 0, ci );
           SetWindowLongPtrW( hwnd, 0, 0 );
+          NtUserSetWindowFNID(hwnd, FNID_DESTROY);
 #endif
           return 0;
       }
index 8abefe4..2538acf 100644 (file)
@@ -343,15 +343,12 @@ CreateWindowExA(DWORD dwExStyle,
         UINT id = 0;
         HWND top_child;
         PWND pWndParent;
-        PCLS pCls;
 
         pWndParent = ValidateHwnd(hWndParent);
 
         if (!pWndParent) return NULL;
 
-        pCls = DesktopPtrToUser(pWndParent->pcls);
-
-        if (pCls->fnid != FNID_MDICLIENT) // wine uses WIN_ISMDICLIENT
+        if (pWndParent->fnid != FNID_MDICLIENT) // wine uses WIN_ISMDICLIENT
         {
            WARN("WS_EX_MDICHILD, but parent %p is not MDIClient\n", hWndParent);
            return NULL;
@@ -469,15 +466,12 @@ CreateWindowExW(DWORD dwExStyle,
         UINT id = 0;
         HWND top_child;
         PWND pWndParent;
-        PCLS pCls;
 
         pWndParent = ValidateHwnd(hWndParent);
 
         if (!pWndParent) return NULL;
 
-        pCls = DesktopPtrToUser(pWndParent->pcls);
-
-        if (pCls->fnid != FNID_MDICLIENT)
+        if (pWndParent->fnid != FNID_MDICLIENT)
         {
            WARN("WS_EX_MDICHILD, but parent %p is not MDIClient\n", hWndParent);
            return NULL;
index 1a946a1..e8f98f2 100644 (file)
@@ -3878,15 +3878,23 @@ NtUserSetWindowFNID(HWND hWnd,
       RETURN( FALSE);
    }
 
-   if (Wnd->pcls)
-   {  // From user land we only set these.
-      if ((fnID != FNID_DESTROY) || ((fnID < FNID_BUTTON) && (fnID > FNID_IME)) )
+   if (Wnd->head.pti->ppi != PsGetCurrentProcessWin32Process())
+   {
+      EngSetLastError(ERROR_ACCESS_DENIED);
+      RETURN( FALSE);
+   }
+
+   // From user land we only set these.
+   if (fnID != FNID_DESTROY)
+   {
+      if ( ((fnID < FNID_BUTTON) && (fnID > FNID_IME)) ||
+           Wnd->fnid != 0 )
       {
          RETURN( FALSE);
       }
-      else
-         Wnd->pcls->fnid |= fnID;
    }
+   
+   Wnd->fnid |= fnID;
    RETURN( TRUE);
 
 CLEANUP: