fix compile
Modified: branches/hardons1stbranch/win32k/include/keyboard.h
Modified: branches/hardons1stbranch/win32k/include/menu.h
Modified: branches/hardons1stbranch/win32k/ntuser/accelerator.c
Modified: branches/hardons1stbranch/win32k/ntuser/handle.c
Modified: branches/hardons1stbranch/win32k/ntuser/menu.c
Modified: branches/hardons1stbranch/win32k/ntuser/misc.c
Modified: branches/hardons1stbranch/win32k/ntuser/monitor.c
Modified: branches/hardons1stbranch/win32k/ntuser/window.c

Modified: branches/hardons1stbranch/win32k/include/keyboard.h
--- branches/hardons1stbranch/win32k/include/keyboard.h	2005-07-27 11:48:46 UTC (rev 16797)
+++ branches/hardons1stbranch/win32k/include/keyboard.h	2005-07-27 12:01:05 UTC (rev 16798)
@@ -20,8 +20,10 @@
 
 
 
-/* accelerator.c */
+/************************* ACCELERATOR.C ***********************/
 
+inline PACCELERATOR_TABLE FASTCALL UserGetAccelObject(HACCEL hCursor);
+
 PACCELERATOR_TABLE UserGetAcceleratorTable(HACCEL hAccel);
 PACCELERATOR_TABLE UserAllocAcceleratorTable(HACCEL* h);
 
@@ -56,7 +58,10 @@
 BOOL FASTCALL 
 UserPostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
 
-/* window.c */
+/************************ WINDOW.C *****************************/
+
+inline VOID FASTCALL UserFreeWindowObject(PWINDOW_OBJECT Wnd);
+
 PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd);
 
 PWINDOW_OBJECT FASTCALL UserCreateWindowObject(HWND* h, ULONG bytes);

Modified: branches/hardons1stbranch/win32k/include/menu.h
--- branches/hardons1stbranch/win32k/include/menu.h	2005-07-27 11:48:46 UTC (rev 16797)
+++ branches/hardons1stbranch/win32k/include/menu.h	2005-07-27 12:01:05 UTC (rev 16798)
@@ -38,8 +38,6 @@
   BOOL RtoL;
 } MENU_OBJECT, *PMENU_OBJECT;
 
-PMENU_OBJECT FASTCALL
-IntGetMenuObject(HMENU hMenu);
 
 BOOL FASTCALL
 IntFreeMenuItem(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem,

Modified: branches/hardons1stbranch/win32k/ntuser/accelerator.c
--- branches/hardons1stbranch/win32k/ntuser/accelerator.c	2005-07-27 11:48:46 UTC (rev 16797)
+++ branches/hardons1stbranch/win32k/ntuser/accelerator.c	2005-07-27 12:01:05 UTC (rev 16798)
@@ -82,9 +82,8 @@
 
    DPRINT("Enter NtUserCopyAcceleratorTable\n");
    UserEnterExclusive();
-
                                            
-   AcceleratorTable = UserGetAcceleratorTable(Table);
+   AcceleratorTable = UserGetAccelObject(Table);
    
    if (!AcceleratorTable)
    {
@@ -98,8 +97,6 @@
       Status = MmCopyToCaller(Entries, AcceleratorTable->Table, Ret * sizeof(ACCEL));
       if (!NT_SUCCESS(Status))
       {
-//         ObmDereferenceObject(AcceleratorTable);
-//         ObDereferenceObject(WindowStation);
          SetLastNtError(Status);
          RETURN(0);
       }
@@ -109,9 +106,6 @@
       Ret = AcceleratorTable->Count;
    }
 
-//   ObmDereferenceObject(AcceleratorTable);
-//   ObDereferenceObject(WindowStation);
-
    RETURN(Ret);
 
 CLEANUP:
@@ -170,7 +164,7 @@
    AcceleratorTable = UserCreateAcceleratorTableObject(&Handle);
    if (AcceleratorTable == NULL)
    {
-//      ObDereferenceObject(WindowStation);
+
       SetLastNtError(STATUS_NO_MEMORY);
       DPRINT1("E2\n");
       RETURN( (HACCEL) 0);
@@ -184,7 +178,6 @@
       if (AcceleratorTable->Table == NULL)
       {
 //         ObmCloseHandle(WindowStation->HandleTable, Handle);
-//         ObDereferenceObject(WindowStation);
          SetLastNtError(Status);
          DPRINT1("E3\n");
          RETURN( (HACCEL) 0);
@@ -195,14 +188,12 @@
       {
          ExFreePool(AcceleratorTable->Table);
 //         ObmCloseHandle(WindowStation->HandleTable, Handle);
-//         ObDereferenceObject(WindowStation);
          SetLastNtError(Status);
          DPRINT1("E4\n");
          RETURN((HACCEL) 0);
       }
    }
 
-//   ObDereferenceObject(WindowStation);
 
    /* FIXME: Save HandleTable in a list somewhere so we can clean it up again */
    RETURN( (HACCEL) Handle);
@@ -231,7 +222,7 @@
    UserEnterExclusive();
 
    //FIXME
-   AcceleratorTable = UserGetAcceleratorTable/*Object*/(Table);
+   AcceleratorTable = UserGetAccelObject(Table);
 
    if (!AcceleratorTable)
    {
@@ -444,6 +435,14 @@
    return TRUE;
 }
 
+inline PACCELERATOR_TABLE FASTCALL UserGetAccelObject(HACCEL hCursor)
+{
+   PWINSTATION_OBJECT WinSta;
+   WinSta = PsGetWin32Thread()->Desktop->WindowStation;
+   return (PACCELERATOR_TABLE)UserGetObject(&WinSta->HandleTable, hCursor, USER_CURSOR_ICON );   
+}
+
+
 int
 STDCALL
 NtUserTranslateAccelerator(
@@ -483,11 +482,10 @@
       RETURN(0);
    }
 
-   AcceleratorTable = UserGetAcceleratorTable(Table);
+   AcceleratorTable = UserGetAccelObject(Table);
    if (!AcceleratorTable)
    {
       SetLastWin32Error(ERROR_INVALID_ACCEL_HANDLE);
-//      ObDereferenceObject(WindowStation);
       RETURN(0);
    }
 
@@ -510,8 +508,6 @@
       }
    }
 
-   ObDereferenceObject(WindowStation);
-
    RETURN(0);
 
 CLEANUP:

Modified: branches/hardons1stbranch/win32k/ntuser/handle.c
--- branches/hardons1stbranch/win32k/ntuser/handle.c	2005-07-27 11:48:46 UTC (rev 16797)
+++ branches/hardons1stbranch/win32k/ntuser/handle.c	2005-07-27 12:01:05 UTC (rev 16798)
@@ -155,10 +155,6 @@
         return NULL;
     }
     
-//    if (entry->ptr){
-//       ExFreePool(entry->ptr);
-//    }
-    
     return free_user_entry(ht, entry );
 }
 

Modified: branches/hardons1stbranch/win32k/ntuser/menu.c
--- branches/hardons1stbranch/win32k/ntuser/menu.c	2005-07-27 11:48:46 UTC (rev 16797)
+++ branches/hardons1stbranch/win32k/ntuser/menu.c	2005-07-27 12:01:05 UTC (rev 16798)
@@ -150,7 +150,7 @@
   if(bRecurse && MenuItem->hSubMenu)
   {
     PMENU_OBJECT SubMenuObject;
-    SubMenuObject = IntGetMenuObject(MenuItem->hSubMenu );
+    SubMenuObject = UserGetMenuObject(MenuItem->hSubMenu );
     if(SubMenuObject)
     {
       IntDestroyMenuObject(SubMenuObject, bRecurse, TRUE);
@@ -465,7 +465,7 @@
 {
   PMENU_OBJECT Menu;
 
-  if((Menu = IntGetMenuObject(hMenu)))
+  if((Menu = UserGetMenuObject(hMenu)))
   {
 //    IntReleaseMenuObject(Menu);
     return TRUE;
@@ -550,7 +550,7 @@
       }
       else if (0 != (CurItem->fType & MF_POPUP))
       {
-        MenuObject = IntGetMenuObject(CurItem->hSubMenu);
+        MenuObject = UserGetMenuObject(CurItem->hSubMenu);
         if (NULL != MenuObject)
         {
           ret = UserGetMenuItemByFlag(MenuObject, uSearchBy, fFlag,
@@ -756,7 +756,7 @@
     /* Make sure the submenu is marked as a popup menu */
     if (MenuItem->hSubMenu)
     {
-      SubMenuObject = IntGetMenuObject(MenuItem->hSubMenu);
+      SubMenuObject = UserGetMenuObject(MenuItem->hSubMenu);
       if (SubMenuObject != NULL)
       {
         SubMenuObject->MenuInfo.Flags |= MF_POPUP;
@@ -1159,7 +1159,7 @@
          MenuItem->hSubMenu)
       {
 
-        SubMenuObject = IntGetMenuObject(MenuItem->hSubMenu);
+        SubMenuObject = UserGetMenuObject(MenuItem->hSubMenu);
         if(!SubMenuObject || (SubMenuObject == MenuObject))
           break;
 
@@ -1301,7 +1301,7 @@
   DPRINT("Enter NtUserBuildMenuItemList\n");
   UserEnterExclusive();
   
-  MenuObject = IntGetMenuObject(hMenu);
+  MenuObject = UserGetMenuObject(hMenu);
   if(!MenuObject)
   {
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -1342,7 +1342,7 @@
   DPRINT("Enter NtUserCheckMenuItem\n");
   UserEnterExclusive();
   
-  MenuObject = IntGetMenuObject(hmenu);
+  MenuObject = UserGetMenuObject(hmenu);
   if(!MenuObject)
   {
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -1422,7 +1422,7 @@
   DPRINT("Enter NtUserDeleteMenu\n");
   UserEnterExclusive();
   
-  MenuObject = IntGetMenuObject(hMenu);
+  MenuObject = UserGetMenuObject(hMenu);
   if(!MenuObject)
   {
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -1451,7 +1451,7 @@
   DPRINT("Enter NtUserDestroyMenu\n");
   UserEnterExclusive();
   
-  MenuObject = IntGetMenuObject(hMenu);
+  MenuObject = UserGetMenuObject(hMenu);
   if(!MenuObject)
   {
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -1487,7 +1487,7 @@
   DPRINT("Enter NtUserEnableMenuItem\n");
   UserEnterExclusive();
   
-  MenuObject = IntGetMenuObject(hMenu);
+  MenuObject = UserGetMenuObject(hMenu);
   if(!MenuObject)
   {
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -1521,7 +1521,7 @@
   DPRINT("Enter NtUserInsertMenuItem\n");
   UserEnterExclusive();
   
-  MenuObject = IntGetMenuObject(hMenu);
+  MenuObject = UserGetMenuObject(hMenu);
   if(!MenuObject)
     {
       SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -1577,7 +1577,7 @@
   DPRINT("Enter NtUserGetMenuDefaultItem\n");
   UserEnterExclusive();
   
-  MenuObject = IntGetMenuObject(hMenu);
+  MenuObject = UserGetMenuObject(hMenu);
   if(!MenuObject)
   {
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -1648,7 +1648,7 @@
      DPRINT("Enter NtUserGetMenuItemRect\n");
      UserEnterExclusive();
   
-     Menu = IntGetMenuObject(hMenu);
+     Menu = UserGetMenuObject(hMenu);
      if(!Menu)
      {
        SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -1722,7 +1722,7 @@
     SetLastWin32Error(ERROR_INVALID_HANDLE);
     RETURN(FALSE);
   }
-  MenuObject = IntGetMenuObject(hmenu);
+  MenuObject = UserGetMenuObject(hmenu);
   if(!MenuObject)
   {
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -1779,7 +1779,7 @@
       RETURN(FALSE);
     }
 
-  MenuObject = IntGetMenuObject(Menu);
+  MenuObject = UserGetMenuObject(Menu);
   if (NULL == MenuObject)
     {
       SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -1834,7 +1834,7 @@
   DPRINT("Enter NtUserMenuItemFromPoint\n");
   UserEnterExclusive();
   
-  MenuObject = IntGetMenuObject(Menu);
+  MenuObject = UserGetMenuObject(Menu);
   if (NULL == MenuObject)
     {
       SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -1892,7 +1892,7 @@
   DPRINT("Enter NtUserMenuItemInfo\n");
   UserEnterExclusive();
   
-  MenuObject = IntGetMenuObject(Menu);
+  MenuObject = UserGetMenuObject(Menu);
   if (NULL == MenuObject)
     {
       SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -1996,7 +1996,7 @@
   DPRINT("Enter NtUserRemoveMenu\n");
   UserEnterExclusive();
   
-  MenuObject = IntGetMenuObject(hMenu);
+  MenuObject = UserGetMenuObject(hMenu);
   if(!MenuObject)
   {
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -2026,7 +2026,7 @@
   DPRINT("Enter NtUserSetMenuContextHelpId\n");
   UserEnterExclusive();
   
-  MenuObject = IntGetMenuObject(hmenu);
+  MenuObject = UserGetMenuObject(hmenu);
   if(!MenuObject)
   {
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -2057,7 +2057,7 @@
   DPRINT("Enter NtUserSetMenuDefaultItem\n");
   UserEnterExclusive();
   
-  MenuObject = IntGetMenuObject(hMenu);
+  MenuObject = UserGetMenuObject(hMenu);
   if(!MenuObject)
   {
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -2086,7 +2086,7 @@
   DPRINT("Enter NtUserSetMenuFlagRtoL\n");
   UserEnterExclusive();
   
-  MenuObject = IntGetMenuObject(hMenu);
+  MenuObject = UserGetMenuObject(hMenu);
   if(!MenuObject)
   {
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
@@ -2159,7 +2159,7 @@
   DPRINT("Enter NtUserTrackPopupMenuEx\n");
   UserEnterExclusive();
   
-  MenuObject = IntGetMenuObject(hmenu);
+  MenuObject = UserGetMenuObject(hmenu);
   if(!MenuObject)
   {
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);

Modified: branches/hardons1stbranch/win32k/ntuser/misc.c
--- branches/hardons1stbranch/win32k/ntuser/misc.c	2005-07-27 11:48:46 UTC (rev 16797)
+++ branches/hardons1stbranch/win32k/ntuser/misc.c	2005-07-27 12:01:05 UTC (rev 16798)
@@ -427,7 +427,7 @@
     case TWOPARAM_ROUTINE_SETMENUBARHEIGHT:
     {
       DWORD Ret;
-      PMENU_OBJECT MenuObject = IntGetMenuObject((HMENU)Param1);
+      PMENU_OBJECT MenuObject = UserGetMenuObject((HMENU)Param1);
       if(!MenuObject)
         RETURN( 0);
 
@@ -445,7 +445,7 @@
     {
       BOOL Ret;
       SETMENUITEMRECT smir;
-      PMENU_OBJECT MenuObject = IntGetMenuObject((HMENU)Param1);
+      PMENU_OBJECT MenuObject = UserGetMenuObject((HMENU)Param1);
       if(!MenuObject)
         RETURN( 0);
 
@@ -722,7 +722,7 @@
               DPRINT("HWNDLOCK_ROUTINE_DRAWMENUBAR\n");
               Ret = FALSE;
               if (!((Window->Style & (WS_CHILD | WS_POPUP)) != WS_CHILD)) break;
-              MenuObject = IntGetMenuObject((HMENU) Window->IDMenu);
+              MenuObject = UserGetMenuObject((HMENU) Window->IDMenu);
               if(MenuObject == NULL) break;
               MenuObject->MenuInfo.WndOwner = hWnd;
               MenuObject->MenuInfo.Height = 0;

Modified: branches/hardons1stbranch/win32k/ntuser/monitor.c
--- branches/hardons1stbranch/win32k/ntuser/monitor.c	2005-07-27 11:48:46 UTC (rev 16797)
+++ branches/hardons1stbranch/win32k/ntuser/monitor.c	2005-07-27 12:01:05 UTC (rev 16798)
@@ -81,11 +81,13 @@
 PMONITOR_OBJECT FASTCALL UserCreateMonitorObject(HANDLE* h)
 {
    PVOID mem;
+   PWINSTATION_OBJECT WinSta;
    
    mem = ExAllocatePool(PagedPool, sizeof(MONITOR_OBJECT));
    if (!mem) return NULL;
-
-   *h = UserAllocHandle(mem, USER_MONITOR);
+   WinSta = UserGetCurrentWinSta();
+   
+   *h = UserAllocHandle(&WinSta->HandleTable, mem, USER_MONITOR);
    if (!*h){
       ExFreePool(mem);
       return NULL;
@@ -143,7 +145,10 @@
 
 PMONITOR_OBJECT UserGetMonitorObject(HANDLE hCursor)
 {
-   return (PMONITOR_OBJECT)UserGetObject(hCursor, USER_MONITOR );
+   PWINSTATION_OBJECT WinSta;
+   WinSta = UserGetCurrentWinSta();
+
+   return (PMONITOR_OBJECT)UserGetObject(&WinSta->HandleTable, hCursor, USER_MONITOR );
 }
 
 

Modified: branches/hardons1stbranch/win32k/ntuser/window.c
--- branches/hardons1stbranch/win32k/ntuser/window.c	2005-07-27 11:48:46 UTC (rev 16797)
+++ branches/hardons1stbranch/win32k/ntuser/window.c	2005-07-27 12:01:05 UTC (rev 16798)
@@ -105,7 +105,9 @@
 
 PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd)
 {
-   return (PWINDOW_OBJECT)UserGetObject(hWnd, USER_WINDOW );
+   PWINSTATION_OBJECT WinSta;
+   WinSta = UserGetCurrentWinSta();
+   return (PWINDOW_OBJECT)UserGetObject(&WinSta->HandleTable, hWnd, USER_WINDOW );
 }
 
 
@@ -398,14 +400,14 @@
 #endif
 
   if (!(Window->Style & WS_CHILD) && Window->IDMenu
-      && (Menu = IntGetMenuObject((HMENU)Window->IDMenu)))
+      && (Menu = UserGetMenuObject((HMENU)Window->IDMenu)))
     {
 	IntDestroyMenuObject(Menu, TRUE, TRUE);
 	Window->IDMenu = 0;
     }
 
   if(Window->SystemMenu
-     && (Menu = IntGetMenuObject(Window->SystemMenu)))
+     && (Menu = UserGetMenuObject(Window->SystemMenu)))
   {
     IntDestroyMenuObject(Menu, TRUE, TRUE);
     Window->SystemMenu = (HMENU)0;
@@ -419,9 +421,6 @@
 
   IntUnlinkWindow(Window);
 
-  //'FIXME IntReferenceWindowObject(Window);
-  
-
   IntDestroyScrollBars(Window);
 
   /* remove the window from the class object */
@@ -445,16 +444,19 @@
   
   MsqRemoveWindowMessagesFromQueue(Window);
 
-  //ObmCloseHandle(ThreadData->Desktop->WindowStation->HandleTable, Window->Self);
-  UserFreeHandle(Window->Self);
+  UserFreeWindowObject(Window);
   
-//  memset(Window, 0x
-//memset( void *dest, int c, size_t count );
-   RtlZeroMemory(Window, sizeof(WINDOW_OBJECT));
-
   return 0;
 }
 
+inline VOID FASTCALL UserFreeWindowObject(PWINDOW_OBJECT Wnd)
+{
+   PWINSTATION_OBJECT WinSta = UserGetCurrentWinSta();
+   UserFreeHandle(&WinSta->HandleTable, Wnd->Self);  
+   RtlZeroMemory(Wnd, sizeof(WINDOW_OBJECT) + Wnd->ExtraDataSize);
+   ExFreePool(Wnd);
+}
+
 VOID FASTCALL
 IntGetWindowBorderMeasures(PWINDOW_OBJECT WindowObject, UINT *cx, UINT *cy)
 {
@@ -515,7 +517,7 @@
 
   if (0 != WindowObject->IDMenu)
     {
-      OldMenuObject = IntGetMenuObject((HMENU) WindowObject->IDMenu);
+      OldMenuObject = UserGetMenuObject((HMENU) WindowObject->IDMenu);
       ASSERT(NULL == OldMenuObject || OldMenuObject->MenuInfo.Wnd == WindowObject->Self);
     }
   else
@@ -525,7 +527,7 @@
 
   if (NULL != Menu)
     {
-      NewMenuObject = IntGetMenuObject(Menu);
+      NewMenuObject = UserGetMenuObject(Menu);
       if (NULL == NewMenuObject)
         {
 //          if (NULL != OldMenuObject)
@@ -670,7 +672,7 @@
 
     if(WindowObject->SystemMenu)
     {
-      MenuObject = IntGetMenuObject(WindowObject->SystemMenu);
+      MenuObject = UserGetMenuObject(WindowObject->SystemMenu);
       if(MenuObject)
       {
         IntDestroyMenuObject(MenuObject, FALSE, TRUE);
@@ -681,7 +683,7 @@
     if(W32Thread->Desktop->WindowStation->SystemMenuTemplate)
     {
       /* clone system menu */
-      MenuObject = IntGetMenuObject(W32Thread->Desktop->WindowStation->SystemMenuTemplate);
+      MenuObject = UserGetMenuObject(W32Thread->Desktop->WindowStation->SystemMenuTemplate);
       if(!MenuObject)
         return NULL;
 
@@ -702,7 +704,7 @@
       {
         return NULL;
       }
-      SysMenuObject = IntGetMenuObject(SysMenu);
+      SysMenuObject = UserGetMenuObject(SysMenu);
       if (NULL == SysMenuObject)
       {
         NtUserDestroyMenu(SysMenu);
@@ -716,7 +718,7 @@
         NtUserDestroyMenu(SysMenu);
         return NULL;
       }
-      MenuObject = IntGetMenuObject(NewMenu);
+      MenuObject = UserGetMenuObject(NewMenu);
       if(!MenuObject)
       {
         NtUserDestroyMenu(SysMenu);
@@ -752,7 +754,7 @@
   else
   {
     if(WindowObject->SystemMenu)
-      return IntGetMenuObject((HMENU)WindowObject->SystemMenu);
+      return UserGetMenuObject((HMENU)WindowObject->SystemMenu);
     else
       return NULL;
   }
@@ -1015,7 +1017,7 @@
   PMENU_OBJECT OldMenuObject;
   if(WindowObject->SystemMenu)
   {
-    OldMenuObject = IntGetMenuObject(WindowObject->SystemMenu);
+    OldMenuObject = UserGetMenuObject(WindowObject->SystemMenu);
     if(OldMenuObject)
     {
       OldMenuObject->MenuInfo.Flags &= ~ MF_SYSMENU;
@@ -1383,11 +1385,11 @@
 PWINDOW_OBJECT FASTCALL UserCreateWindowObject(HWND* h, ULONG bytes)
 {
    PVOID mem;
-   
+   PWINSTATION_OBJECT WinSta = UserGetCurrentWinSta();
    mem = ExAllocatePool(PagedPool, bytes);
    if (!mem) return NULL;
    RtlZeroMemory(mem, bytes);
-   *h = UserAllocHandle(mem, USER_WINDOW);
+   *h = UserAllocHandle(&WinSta->HandleTable, mem, USER_WINDOW);
    if (!*h){
       ExFreePool(mem);
       return NULL;
@@ -3098,7 +3100,7 @@
       /*
        * Assign new menu handle.
        */
-      MenuObject = IntGetMenuObject(hMenu);
+      MenuObject = UserGetMenuObject(hMenu);
       if (!MenuObject)
       {
          SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);