Author: jimtabor
Date: Tue Oct 5 20:13:32 2010
New Revision: 49005
URL:
http://svn.reactos.org/svn/reactos?rev=49005&view=rev
Log:
[Win32k|User32]
- Implement NtUserGetMenuIndex, see Bug 5528.
Modified:
trunk/reactos/dll/win32/user32/misc/stubs.c
trunk/reactos/subsystems/win32/win32k/ntuser/menu.c
Modified: trunk/reactos/dll/win32/user32/misc/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/stub…
==============================================================================
--- trunk/reactos/dll/win32/user32/misc/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/misc/stubs.c [iso-8859-1] Tue Oct 5 20:13:32 2010
@@ -538,12 +538,11 @@
}
/*
- * @unimplemented
+ * @implemented
*/
DWORD WINAPI GetMenuIndex(HMENU hMenu, HMENU hSubMenu)
{
- UNIMPLEMENTED;
- return 0;
+ return NtUserGetMenuIndex(hMenu, hSubMenu);
}
/*
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/menu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/menu.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/menu.c [iso-8859-1] Tue Oct 5 20:13:32
2010
@@ -2034,20 +2034,40 @@
END_CLEANUP;
}
-
/*
- * @unimplemented
+ * @implemented
*/
UINT APIENTRY
NtUserGetMenuIndex(
HMENU hMenu,
- UINT wID)
-{
- UNIMPLEMENTED
-
- return 0;
-}
-
+ HMENU hSubMenu)
+{
+ PMENU_OBJECT Menu, SubMenu;
+ PMENU_ITEM MenuItem;
+ DECLARE_RETURN(UINT);
+
+ DPRINT("Enter NtUserGetMenuIndex\n");
+ UserEnterShared();
+
+ if ( !(Menu = UserGetMenuObject(hMenu)) ||
+ !(SubMenu = UserGetMenuObject(hSubMenu)) )
+ RETURN(0xFFFFFFFF);
+
+ MenuItem = Menu->MenuItemList;
+ while(MenuItem)
+ {
+ if (MenuItem->hSubMenu == hSubMenu)
+ RETURN(MenuItem->wID);
+ MenuItem = MenuItem->Next;
+ }
+
+ RETURN(0xFFFFFFFF);
+
+CLEANUP:
+ DPRINT("Leave NtUserGetMenuIndex, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
+}
/*
* @implemented
@@ -2217,10 +2237,6 @@
return( Res);
}
-
-
-
-
/*
* @implemented