Author: jimtabor
Date: Sat Sep 8 06:09:19 2012
New Revision: 57251
URL:
http://svn.reactos.org/svn/reactos?rev=57251&view=rev
Log:
[Win32SS]
- HAX: Fix menu test crash!
- Contract be damned. This number 2 on my list to move server side!
Modified:
trunk/reactos/win32ss/user/ntuser/menu.c
trunk/reactos/win32ss/user/user32/user32.spec
trunk/reactos/win32ss/user/user32/windows/menu.c
Modified: trunk/reactos/win32ss/user/ntuser/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/menu.c…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/menu.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/menu.c [iso-8859-1] Sat Sep 8 06:09:19 2012
@@ -1814,14 +1814,29 @@
}
if (MenuObject->MenuInfo.FocusedItem != NO_SELECTED_ITEM)
kmbi.fBarFocused = TRUE;
+
+ if (MenuObject->MenuItemList)
+ {
SubMenuObject = UserGetMenuObject(MenuObject->MenuItemList->hSubMenu);
if(SubMenuObject) kmbi.hwndMenu = SubMenuObject->MenuInfo.Wnd;
+ }
TRACE("OBJID_MENU, idItem = %d\n",idItem);
break;
}
case OBJID_CLIENT:
{
PMENU_OBJECT SubMenuObject, XSubMenuObject;
+ HMENU hMenuChk;
+ // Windows does this! Wine checks for Atom and uses GetWindowLongPtrW.
+ hMenuChk = (HMENU)co_IntSendMessage(hwnd, MN_GETHMENU, 0, 0);
+
+ if (!(MenuObject = UserGetMenuObject(hMenuChk)))
+ {
+ ERR("Window does not have a Popup Menu!\n");
+ EngSetLastError(ERROR_INVALID_MENU_HANDLE);
+ RETURN(FALSE);
+ }
+
SubMenuObject = UserGetMenuObject(MenuObject->MenuItemList->hSubMenu);
if(SubMenuObject) kmbi.hMenu = SubMenuObject->MenuInfo.Self;
else
Modified: trunk/reactos/win32ss/user/user32/user32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/user32…
==============================================================================
--- trunk/reactos/win32ss/user/user32/user32.spec [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/user32.spec [iso-8859-1] Sat Sep 8 06:09:19 2012
@@ -302,7 +302,7 @@
@ stdcall GetLayeredWindowAttributes(long ptr ptr ptr) NtUserGetLayeredWindowAttributes
@ stdcall GetListBoxInfo(long) NtUserGetListBoxInfo
@ stdcall GetMenu(long)
-@ stdcall GetMenuBarInfo(long long long ptr) NtUserGetMenuBarInfo
+@ stdcall GetMenuBarInfo(long long long ptr) ; tempo haxzo NtUserGetMenuBarInfo
@ stdcall GetMenuCheckMarkDimensions()
@ stdcall GetMenuContextHelpId(long)
@ stdcall GetMenuDefaultItem(long long long)
Modified: trunk/reactos/win32ss/user/user32/windows/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/menu.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/menu.c [iso-8859-1] Sat Sep 8 06:09:19
2012
@@ -4219,6 +4219,26 @@
/*
* @implemented
*/
+BOOL WINAPI GetMenuBarInfo( HWND hwnd, LONG idObject, LONG idItem, PMENUBARINFO pmbi )
+{
+ BOOL Ret;
+ Ret = NtUserGetMenuBarInfo( hwnd, idObject, idItem, pmbi);
+ // Reason to move to server side!!!!!
+ if (!Ret) return Ret;
+ // EL HAXZO!!!
+ pmbi->fBarFocused = top_popup_hmenu == pmbi->hMenu;
+ if (!idItem)
+ {
+ pmbi->fFocused = pmbi->fBarFocused;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * @implemented
+ */
LONG WINAPI
GetMenuCheckMarkDimensions(VOID)
{