BOOL FASTCALL
IntDestroyMenuObject(PMENU Menu, BOOL bRecurse)
{
- if(Menu)
+ if (Menu)
{
PWND Window;
- ULONG Error;
-
- /* Remove all menu items */
- IntDestroyMenu( Menu, bRecurse);
if (PsGetCurrentProcessSessionId() == Menu->head.rpdesk->rpwinstaParent->dwSessionId)
{
}
}
}
- if (UserObjectInDestroy(Menu->head.h))
- {
- WARN("Menu already dead!\n");
- return FALSE;
- }
+
+ if (!UserMarkObjectDestroy(Menu)) return TRUE;
+
+ /* Remove all menu items */
+ IntDestroyMenu( Menu, bRecurse);
+
ret = UserDeleteObject(Menu->head.h, TYPE_MENU);
- if (!ret)
- { // Make sure it is really dead or just marked for deletion.
- Error = EngGetLastError();
- ret = UserObjectInDestroy(Menu->head.h);
- if (ret && EngGetLastError() == ERROR_INVALID_HANDLE)
- {
- EngSetLastError(Error);
- ret = FALSE;
- }
- } // See test_subpopup_locked_by_menu tests....
+ TRACE("IntDestroyMenuObject %d\n",ret);
return ret;
}
}
if (mt.TopMenu->fFlags & MNF_POPUP)
{
PWND pwndTM = ValidateHwndNoErr(mt.TopMenu->hWnd);
- IntNotifyWinEvent(EVENT_SYSTEM_MENUPOPUPEND, pwndTM, OBJID_CLIENT, CHILDID_SELF, 0);
+ if (pwndTM)
+ {
+ IntNotifyWinEvent(EVENT_SYSTEM_MENUPOPUPEND, pwndTM, OBJID_CLIENT, CHILDID_SELF, 0);
- co_UserDestroyWindow(pwndTM);
+ co_UserDestroyWindow(pwndTM);
+ }
mt.TopMenu->hWnd = NULL;
if (!(wFlags & TPM_NONOTIFY))
}
+DWORD
+APIENTRY
+NtUserPaintMenuBar(
+ HWND hWnd,
+ HDC hDC,
+ ULONG left,
+ ULONG right,
+ ULONG top,
+ BOOL bActive)
+{
+ PWND Window;
+ RECT Rect;
+
+ UserEnterExclusive();
+
+ if(!(Window = UserGetWindowObject(hWnd)))
+ {
+ EngSetLastError(ERROR_INVALID_WINDOW_HANDLE);
+ UserLeave();
+ return 0;
+ }
+
+ Rect.left = left;
+ Rect.right = right;
+ Rect.top = top;
+ Rect.bottom = 0;
+
+ MENU_DrawMenuBar(hDC, &Rect, Window, FALSE);
+
+ UserLeave();
+
+ /* I am not sure about what this function returns */
+ return 0;
+}
+
/*
* @implemented
*/