*/
/* INCLUDES ******************************************************************/
-#include <w32k.h>
+#include <win32k.h>
#define NDEBUG
#include <debug.h>
PMENU_OBJECT FASTCALL
-IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu);
+IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu);
( ((r).bottom >= y)) && \
( ((r).top <= y)) )
-NTSTATUS FASTCALL
+INIT_FUNCTION
+NTSTATUS
+NTAPI
InitMenuImpl(VOID)
{
return(STATUS_SUCCESS);
{
if(Menu)
{
- PWINDOW_OBJECT Window;
+ PWND Window;
PWINSTATION_OBJECT WindowStation;
NTSTATUS Status;
Window = UserGetWindowObject(Menu->MenuInfo.Wnd);
if (Window)
{
- Window->Wnd->IDMenu = 0;
+ Window->IDMenu = 0;
}
}
// UserDereferenceObject(Menu);
IntBuildMenuItemList(PMENU_OBJECT MenuObject, PVOID Buffer, ULONG nMax)
{
DWORD res = 0;
- UINT sz;
ROSMENUITEMINFO mii;
PVOID Buf;
PMENU_ITEM CurItem = MenuObject->MenuItemList;
StrOut = (PWCHAR)((char *) Buffer + MenuObject->MenuInfo.MenuItemCount
* sizeof(ROSMENUITEMINFO));
nMax -= MenuObject->MenuInfo.MenuItemCount * sizeof(ROSMENUITEMINFO);
- sz = sizeof(ROSMENUITEMINFO);
Buf = Buffer;
mii.cbSize = sizeof(ROSMENUITEMINFO);
mii.fMask = 0;
}
BOOL FASTCALL
-IntHiliteMenuItem(PWINDOW_OBJECT WindowObject, PMENU_OBJECT MenuObject,
+IntHiliteMenuItem(PWND WindowObject, PMENU_OBJECT MenuObject,
UINT uItemHilite, UINT uHilite)
{
PMENU_ITEM MenuItem;
}
VOID FASTCALL
-co_IntInitTracking(PWINDOW_OBJECT Window, PMENU_OBJECT Menu, BOOL Popup,
+co_IntInitTracking(PWND Window, PMENU_OBJECT Menu, BOOL Popup,
UINT Flags)
{
/* FIXME - hide caret */
if(!(Flags & TPM_NONOTIFY))
- co_IntSendMessage(Window->hSelf, WM_SETCURSOR, (WPARAM)Window->hSelf, HTCAPTION);
+ co_IntSendMessage(Window->head.h, WM_SETCURSOR, (WPARAM)Window->head.h, HTCAPTION);
/* FIXME - send WM_SETCURSOR message */
if(!(Flags & TPM_NONOTIFY))
- co_IntSendMessage(Window->hSelf, WM_INITMENU, (WPARAM)Menu->MenuInfo.Self, 0);
+ co_IntSendMessage(Window->head.h, WM_INITMENU, (WPARAM)Menu->MenuInfo.Self, 0);
}
VOID FASTCALL
-co_IntExitTracking(PWINDOW_OBJECT Window, PMENU_OBJECT Menu, BOOL Popup,
+co_IntExitTracking(PWND Window, PMENU_OBJECT Menu, BOOL Popup,
UINT Flags)
{
if(!(Flags & TPM_NONOTIFY))
- co_IntSendMessage(Window->hSelf, WM_EXITMENULOOP, 0 /* FIXME */, 0);
+ co_IntSendMessage(Window->head.h, WM_EXITMENULOOP, 0 /* FIXME */, 0);
/* FIXME - Show caret again */
}
INT FASTCALL
-IntTrackMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window, INT x, INT y,
+IntTrackMenu(PMENU_OBJECT Menu, PWND Window, INT x, INT y,
RECTL lprect)
{
return 0;
}
BOOL FASTCALL
-co_IntTrackPopupMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window,
+co_IntTrackPopupMenu(PMENU_OBJECT Menu, PWND Window,
UINT Flags, POINT *Pos, UINT MenuPos, RECTL *ExcludeRect)
{
co_IntInitTracking(Window, Menu, TRUE, Flags);
return TRUE;
}
-VOID APIENTRY
-co_InflateRect(RECTL *rect, int dx, int dy)
-{
- rect->left -= dx;
- rect->top -= dy;
- rect->right += dx;
- rect->bottom += dy;
-}
-
BOOLEAN APIENTRY
-intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
+intGetTitleBarInfo(PWND pWindowObject, PTITLEBARINFO bti)
{
DWORD dwStyle = 0;
bti->rgstate[0] = STATE_SYSTEM_FOCUSABLE;
- dwStyle = pWindowObject->Wnd->style;
- dwExStyle = pWindowObject->Wnd->ExStyle;
+ dwStyle = pWindowObject->style;
+ dwExStyle = pWindowObject->ExStyle;
bti->rcTitleBar.top = 0;
bti->rcTitleBar.left = 0;
- bti->rcTitleBar.right = pWindowObject->Wnd->rcWindow.right - pWindowObject->Wnd->rcWindow.left;
- bti->rcTitleBar.bottom = pWindowObject->Wnd->rcWindow.bottom - pWindowObject->Wnd->rcWindow.top;
+ bti->rcTitleBar.right = pWindowObject->rcWindow.right - pWindowObject->rcWindow.left;
+ bti->rcTitleBar.bottom = pWindowObject->rcWindow.bottom - pWindowObject->rcWindow.top;
/* is it iconiced ? */
if ((dwStyle & WS_ICONIC)!=WS_ICONIC)
if (HAS_THICKFRAME( dwStyle, dwExStyle ))
{
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXFRAME) and UserGetSystemMetrics(SM_CYFRAME) */
- co_InflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXFRAME), -UserGetSystemMetrics(SM_CYFRAME) );
+ RECTL_vInflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXFRAME), -UserGetSystemMetrics(SM_CYFRAME) );
}
else if (HAS_DLGFRAME( dwStyle, dwExStyle ))
{
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXDLGFRAME) and UserGetSystemMetrics(SM_CYDLGFRAME) */
- co_InflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXDLGFRAME), -UserGetSystemMetrics(SM_CYDLGFRAME));
+ RECTL_vInflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXDLGFRAME), -UserGetSystemMetrics(SM_CYDLGFRAME));
}
else if (HAS_THINFRAME( dwStyle, dwExStyle))
{
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXBORDER) and UserGetSystemMetrics(SM_CYBORDER) */
- co_InflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER) );
+ RECTL_vInflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER) );
}
/* We have additional border information if the window
if (dwExStyle & WS_EX_CLIENTEDGE)
{
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXEDGE) and UserGetSystemMetrics(SM_CYEDGE) */
- co_InflateRect (&bti->rcTitleBar, -UserGetSystemMetrics(SM_CXEDGE), -UserGetSystemMetrics(SM_CYEDGE));
+ RECTL_vInflateRect (&bti->rcTitleBar, -UserGetSystemMetrics(SM_CXEDGE), -UserGetSystemMetrics(SM_CYEDGE));
}
if (dwExStyle & WS_EX_STATICEDGE)
{
/* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXBORDER) and UserGetSystemMetrics(SM_CYBORDER) */
- co_InflateRect (&bti->rcTitleBar, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER));
+ RECTL_vInflateRect (&bti->rcTitleBar, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER));
}
}
}
- bti->rcTitleBar.top += pWindowObject->Wnd->rcWindow.top;
- bti->rcTitleBar.left += pWindowObject->Wnd->rcWindow.left;
- bti->rcTitleBar.right += pWindowObject->Wnd->rcWindow.left;
+ bti->rcTitleBar.top += pWindowObject->rcWindow.top;
+ bti->rcTitleBar.left += pWindowObject->rcWindow.left;
+ bti->rcTitleBar.right += pWindowObject->rcWindow.left;
bti->rcTitleBar.bottom = bti->rcTitleBar.top;
if (dwExStyle & WS_EX_TOOLWINDOW)
{
bti->rgstate[4] = STATE_SYSTEM_INVISIBLE;
}
- if (pWindowObject->Wnd->pcls->style & CS_NOCLOSE)
+ if (pWindowObject->pcls->style & CS_NOCLOSE)
{
bti->rgstate[5] = STATE_SYSTEM_UNAVAILABLE;
}
return retValue;
}
-/* FUNCTIONS *****************************************************************/
-
-
-/*
- * @implemented
- */
-DWORD
-APIENTRY
-NtUserBuildMenuItemList(
- HMENU hMenu,
- VOID* Buffer,
- ULONG nBufSize,
- DWORD Reserved)
+DWORD FASTCALL
+UserInsertMenuItem(
+ PMENU_OBJECT Menu,
+ UINT uItem,
+ BOOL fByPosition,
+ LPCMENUITEMINFOW UnsafeItemInfo)
{
- DWORD res = -1;
- PMENU_OBJECT Menu;
- DECLARE_RETURN(DWORD);
-
- DPRINT("Enter NtUserBuildMenuItemList\n");
- UserEnterExclusive();
+ NTSTATUS Status;
+ ROSMENUITEMINFO ItemInfo;
- if(!(Menu = UserGetMenuObject(hMenu)))
+ /* Try to copy the whole MENUITEMINFOW structure */
+ Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, sizeof(MENUITEMINFOW));
+ if (NT_SUCCESS(Status))
{
- RETURN( (DWORD)-1);
+ if (sizeof(MENUITEMINFOW) != ItemInfo.cbSize
+ && FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
+ {
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+ return IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo);
}
- if(Buffer)
- {
- res = IntBuildMenuItemList(Menu, Buffer, nBufSize);
- }
- else
+ /* Try to copy without last field (not present in older versions) */
+ Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, FIELD_OFFSET(MENUITEMINFOW, hbmpItem));
+ if (NT_SUCCESS(Status))
{
- res = Menu->MenuInfo.MenuItemCount;
+ if (FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
+ {
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+ ItemInfo.hbmpItem = (HBITMAP)0;
+ return IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo);
}
- RETURN( res);
-
-CLEANUP:
- DPRINT("Leave NtUserBuildMenuItemList, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
+ SetLastNtError(Status);
+ return FALSE;
}
+/* FUNCTIONS *****************************************************************/
+
/*
* @implemented
*/
END_CLEANUP;
}
-
HMENU FASTCALL UserCreateMenu(BOOL PopupMenu)
{
PWINSTATION_OBJECT WinStaObject;
return (HMENU)Handle;
}
-
/*
* @implemented
*/
HWND hwnd,
PTITLEBARINFO bti)
{
- PWINDOW_OBJECT WindowObject;
+ PWND WindowObject;
TITLEBARINFO bartitleinfo;
DECLARE_RETURN(BOOLEAN);
BOOLEAN retValue = TRUE;
END_CLEANUP;
}
-
-
/*
* @implemented
*/
END_CLEANUP;
}
-
/*
* @implemented
*/
END_CLEANUP;
}
-
-/*
- * @implemented
- */
-DWORD APIENTRY
-UserInsertMenuItem(
- HMENU hMenu,
- UINT uItem,
- BOOL fByPosition,
- LPCMENUITEMINFOW UnsafeItemInfo)
-{
- PMENU_OBJECT Menu;
- NTSTATUS Status;
- ROSMENUITEMINFO ItemInfo;
- DECLARE_RETURN(DWORD);
-
- DPRINT("Enter UserInsertMenuItem\n");
- UserEnterExclusive();
-
- if(!(Menu = UserGetMenuObject(hMenu)))
- {
- RETURN( FALSE);
- }
-
- /* Try to copy the whole MENUITEMINFOW structure */
- Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, sizeof(MENUITEMINFOW));
- if (NT_SUCCESS(Status))
- {
- if (sizeof(MENUITEMINFOW) != ItemInfo.cbSize
- && FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
- {
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
- RETURN( FALSE);
- }
- RETURN( IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo));
- }
-
- /* Try to copy without last field (not present in older versions) */
- Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, FIELD_OFFSET(MENUITEMINFOW, hbmpItem));
- if (NT_SUCCESS(Status))
- {
- if (FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
- {
- SetLastWin32Error(ERROR_INVALID_PARAMETER);
- RETURN( FALSE);
- }
- ItemInfo.hbmpItem = (HBITMAP)0;
- RETURN( IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo));
- }
-
- SetLastNtError(Status);
- RETURN( FALSE);
-
-CLEANUP:
- DPRINT("Leave UserInsertMenuItem, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
-}
-
-
/*
* @unimplemented
*/
return 0;
}
-
-/*
- * @implemented
- */
-UINT APIENTRY
-NtUserGetMenuDefaultItem(
- HMENU hMenu,
- UINT fByPos,
- UINT gmdiFlags)
-{
- PMENU_OBJECT Menu;
- DWORD gismc = 0;
- DECLARE_RETURN(UINT);
-
- DPRINT("Enter NtUserGetMenuDefaultItem\n");
- UserEnterExclusive();
-
- if(!(Menu = UserGetMenuObject(hMenu)))
- {
- RETURN(-1);
- }
-
- RETURN( IntGetMenuDefaultItem(Menu, fByPos, gmdiFlags, &gismc));
-
-CLEANUP:
- DPRINT("Leave NtUserGetMenuDefaultItem, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
-}
-
-
/*
* @implemented
*/
BOOL Res = TRUE;
PMENU_OBJECT MenuObject;
PMENU_ITEM mi;
- PWINDOW_OBJECT WindowObject;
+ PWND WindowObject;
HMENU hMenu;
POINT Offset;
RECTL Rect;
RETURN(FALSE);
}
- hMenu = (HMENU)(DWORD_PTR)WindowObject->Wnd->IDMenu;
+ hMenu = (HMENU)(DWORD_PTR)WindowObject->IDMenu;
if (!(MenuObject = UserGetMenuObject(hMenu)))
{
}
else
{
- PWINDOW_OBJECT SubWinObj;
+ PWND SubWinObj;
if (!(SubWinObj = UserGetWindowObject(SubMenuObject->MenuInfo.Wnd)))
{
Res = FALSE;
}
else
{
- PWINDOW_OBJECT SysWinObj;
+ PWND SysWinObj;
if (!(SysWinObj = UserGetWindowObject(SysMenuObject->MenuInfo.Wnd)))
{
Res = FALSE;
END_CLEANUP;
}
-
/*
- * @unimplemented
+ * @implemented
*/
UINT APIENTRY
NtUserGetMenuIndex(
HMENU hMenu,
- UINT wID)
+ HMENU hSubMenu)
{
- UNIMPLEMENTED
+ PMENU_OBJECT Menu, SubMenu;
+ PMENU_ITEM MenuItem;
+ DECLARE_RETURN(UINT);
- return 0;
-}
+ 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
PRECTL lprcItem)
{
ROSMENUINFO mi;
- PWINDOW_OBJECT ReferenceWnd;
+ PWND ReferenceWnd;
LONG XMove, YMove;
RECTL Rect;
NTSTATUS Status;
if(MenuItem->fType & MF_POPUP)
{
- XMove = ReferenceWnd->Wnd->rcClient.left;
- YMove = ReferenceWnd->Wnd->rcClient.top;
+ XMove = ReferenceWnd->rcClient.left;
+ YMove = ReferenceWnd->rcClient.top;
}
else
{
- XMove = ReferenceWnd->Wnd->rcWindow.left;
- YMove = ReferenceWnd->Wnd->rcWindow.top;
+ XMove = ReferenceWnd->rcWindow.left;
+ YMove = ReferenceWnd->rcWindow.top;
}
Rect.left += XMove;
END_CLEANUP;
}
-
/*
* @implemented
*/
UINT uHilite)
{
PMENU_OBJECT Menu;
- PWINDOW_OBJECT Window;
+ PWND Window;
DECLARE_RETURN(BOOLEAN);
DPRINT("Enter NtUserHiliteMenuItem\n");
RETURN(FALSE);
}
- if(Window->Wnd->IDMenu == (UINT)(UINT_PTR)hMenu)
+ if(Window->IDMenu == (UINT)(UINT_PTR)hMenu)
{
RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite));
}
END_CLEANUP;
}
-
static
BOOL FASTCALL
UserMenuInfo(
return( Res);
}
-
-
-
-
-/*
- * @implemented
- */
-BOOL
-APIENTRY
-NtUserMenuInfo(
- HMENU hMenu,
- PROSMENUINFO UnsafeMenuInfo,
- BOOL SetOrGet)
-{
- PMENU_OBJECT Menu;
- DECLARE_RETURN(BOOL);
-
- DPRINT("Enter NtUserMenuInfo\n");
- UserEnterShared();
-
- if (!(Menu = UserGetMenuObject(hMenu)))
- {
- RETURN(FALSE);
- }
-
- RETURN(UserMenuInfo(Menu, UnsafeMenuInfo, SetOrGet));
-
-CLEANUP:
- DPRINT("Leave NtUserMenuInfo, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
-}
-
-
-
/*
* @implemented
*/
DWORD Y)
{
PMENU_OBJECT Menu;
- PWINDOW_OBJECT Window = NULL;
+ PWND Window = NULL;
PMENU_ITEM mi;
int i;
DECLARE_RETURN(int);
RETURN( -1);
}
- X -= Window->Wnd->rcWindow.left;
- Y -= Window->Wnd->rcWindow.top;
+ X -= Window->rcWindow.left;
+ Y -= Window->rcWindow.top;
mi = Menu->MenuItemList;
for (i = 0; NULL != mi; i++)
END_CLEANUP;
}
-
-
static
BOOL FASTCALL
UserMenuItemInfo(
return( Ret);
}
-
-
-/*
- * @implemented
- */
-BOOL
-APIENTRY
-NtUserMenuItemInfo(
- HMENU hMenu,
- UINT Item,
- BOOL ByPosition,
- PROSMENUITEMINFO UnsafeItemInfo,
- BOOL SetOrGet)
-{
- PMENU_OBJECT Menu;
- DECLARE_RETURN(BOOL);
-
- DPRINT("Enter NtUserMenuItemInfo\n");
- UserEnterExclusive();
-
- if (!(Menu = UserGetMenuObject(hMenu)))
- {
- RETURN(FALSE);
- }
-
- RETURN( UserMenuItemInfo(Menu, Item, ByPosition, UnsafeItemInfo, SetOrGet));
-
-CLEANUP:
- DPRINT("Leave NtUserMenuItemInfo, ret=%i\n",_ret_);
- UserLeave();
- END_CLEANUP;
-
-}
-
-
/*
* @implemented
*/
}
-
/*
* @implemented
*/
END_CLEANUP;
}
-
-
/*
* @implemented
*/
END_CLEANUP;
}
-
/*
* @implemented
*/
END_CLEANUP;
}
-
/*
- * @unimplemented
+ * @implemented
*/
-DWORD APIENTRY
+BOOL APIENTRY
NtUserThunkedMenuInfo(
HMENU hMenu,
LPCMENUINFO lpcmi)
{
- UNIMPLEMENTED
- /* This function seems just to call SetMenuInfo() */
- return 0;
-}
+ PMENU_OBJECT Menu;
+ DECLARE_RETURN(BOOL);
+ DPRINT("Enter NtUserThunkedMenuInfo\n");
+ UserEnterExclusive();
+
+ if (!(Menu = UserGetMenuObject(hMenu)))
+ {
+ RETURN(FALSE);
+ }
+
+ RETURN(UserMenuInfo(Menu, (PROSMENUINFO)lpcmi, TRUE));
+
+CLEANUP:
+ DPRINT("Leave NtUserThunkedMenuInfo, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
+}
/*
- * @unimplemented
+ * @implemented
*/
-DWORD APIENTRY
+BOOL APIENTRY
NtUserThunkedMenuItemInfo(
HMENU hMenu,
UINT uItem,
LPMENUITEMINFOW lpmii,
PUNICODE_STRING lpszCaption)
{
+ PMENU_OBJECT Menu;
+ NTSTATUS Status;
+ UNICODE_STRING lstrCaption;
+ DECLARE_RETURN(BOOL);
+
+ DPRINT("Enter NtUserThunkedMenuItemInfo\n");
+ UserEnterExclusive();
/* lpszCaption may be NULL, check for it and call RtlInitUnicodeString()
- if bInsert == TRUE call NtUserInsertMenuItem() else NtUserSetMenuItemInfo() */
+ if bInsert == TRUE call UserInsertMenuItem() else UserSetMenuItemInfo() */
- if (bInsert) return UserInsertMenuItem(hMenu, uItem, fByPosition, lpmii);
+ if (!(Menu = UserGetMenuObject(hMenu)))
+ {
+ RETURN(FALSE);
+ }
- UNIMPLEMENTED
- return 0;
-}
+ lstrCaption.Buffer = NULL;
+
+ /* Check if we got a Caption */
+ if (lpszCaption)
+ {
+ /* Copy the string to kernel mode */
+ Status = ProbeAndCaptureUnicodeString( &lstrCaption,
+ UserMode,
+ lpszCaption);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("Failed to capture MenuItem Caption (status 0x%08x)\n",Status);
+ SetLastNtError(Status);
+ RETURN(FALSE);
+ }
+ }
+
+ if (bInsert) RETURN( UserInsertMenuItem(Menu, uItem, fByPosition, lpmii));
+ RETURN( UserMenuItemInfo(Menu, uItem, fByPosition, (PROSMENUITEMINFO)lpmii, TRUE));
+
+CLEANUP:
+ DPRINT("Leave NtUserThunkedMenuItemInfo, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
+}
/*
* @implemented
}
+////// ReactOS NtUserBad
+/*
+ * @implemented
+ */
+DWORD
+APIENTRY
+NtUserBuildMenuItemList(
+ HMENU hMenu,
+ VOID* Buffer,
+ ULONG nBufSize,
+ DWORD Reserved)
+{
+ DWORD res = -1;
+ PMENU_OBJECT Menu;
+ DECLARE_RETURN(DWORD);
+
+ DPRINT("Enter NtUserBuildMenuItemList\n");
+ UserEnterExclusive();
+
+ if(!(Menu = UserGetMenuObject(hMenu)))
+ {
+ RETURN( (DWORD)-1);
+ }
+
+ if(Buffer)
+ {
+ res = IntBuildMenuItemList(Menu, Buffer, nBufSize);
+ }
+ else
+ {
+ res = Menu->MenuInfo.MenuItemCount;
+ }
+
+ RETURN( res);
+
+CLEANUP:
+ DPRINT("Leave NtUserBuildMenuItemList, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
+}
+
+/*
+ * @implemented
+ */
+UINT APIENTRY
+NtUserGetMenuDefaultItem(
+ HMENU hMenu,
+ UINT fByPos,
+ UINT gmdiFlags)
+{
+ PMENU_OBJECT Menu;
+ DWORD gismc = 0;
+ DECLARE_RETURN(UINT);
+
+ DPRINT("Enter NtUserGetMenuDefaultItem\n");
+ UserEnterExclusive();
+
+ if(!(Menu = UserGetMenuObject(hMenu)))
+ {
+ RETURN(-1);
+ }
+
+ RETURN( IntGetMenuDefaultItem(Menu, fByPos, gmdiFlags, &gismc));
+
+CLEANUP:
+ DPRINT("Leave NtUserGetMenuDefaultItem, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+APIENTRY
+NtUserMenuInfo(
+ HMENU hMenu,
+ PROSMENUINFO UnsafeMenuInfo,
+ BOOL SetOrGet)
+{
+ PMENU_OBJECT Menu;
+ DECLARE_RETURN(BOOL);
+
+ DPRINT("Enter NtUserMenuInfo\n");
+ UserEnterShared();
+
+ if (!(Menu = UserGetMenuObject(hMenu)))
+ {
+ RETURN(FALSE);
+ }
+
+ RETURN(UserMenuInfo(Menu, UnsafeMenuInfo, SetOrGet));
+
+CLEANUP:
+ DPRINT("Leave NtUserMenuInfo, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+APIENTRY
+NtUserMenuItemInfo(
+ HMENU hMenu,
+ UINT Item,
+ BOOL ByPosition,
+ PROSMENUITEMINFO UnsafeItemInfo,
+ BOOL SetOrGet)
+{
+ PMENU_OBJECT Menu;
+ DECLARE_RETURN(BOOL);
+
+ DPRINT("Enter NtUserMenuItemInfo\n");
+ UserEnterExclusive();
+
+ if (!(Menu = UserGetMenuObject(hMenu)))
+ {
+ RETURN(FALSE);
+ }
+
+ RETURN( UserMenuItemInfo(Menu, Item, ByPosition, UnsafeItemInfo, SetOrGet));
+
+CLEANUP:
+ DPRINT("Leave NtUserMenuItemInfo, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
+
+}
+
/* EOF */