/*
- * ReactOS W32 Subsystem
- * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-/* $Id$
- *
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Menus
return NULL;
}
- ASSERT(USER_BODY_TO_HEADER(Menu)->RefCount >= 0);
+ ASSERT(Menu->head.cLockObj >= 0);
return Menu;
}
PMENU_OBJECT Menu = UserGetMenuObject(hMenu);
if (Menu)
{
- ASSERT(USER_BODY_TO_HEADER(Menu)->RefCount >= 0);
+ ASSERT(Menu->head.cLockObj >= 0);
- USER_BODY_TO_HEADER(Menu)->RefCount++;
+ Menu->head.cLockObj++;
}
return Menu;
}
NULL);
if(NT_SUCCESS(Status))
{
+ BOOL ret;
if (Menu->MenuInfo.Wnd)
{
Window = UserGetWindowObject(Menu->MenuInfo.Wnd);
}
}
// UserDereferenceObject(Menu);
- BOOL ret = UserDeleteObject(Menu->MenuInfo.Self, otMenu);
+ ret = UserDeleteObject(Menu->MenuInfo.Self, otMenu);
ObDereferenceObject(WindowStation);
return ret;
}
IntCreateMenu(PHANDLE Handle, BOOL IsMenuBar)
{
PMENU_OBJECT Menu;
- PW32PROCESS CurrentWin32Process;
-
- Menu = (PMENU_OBJECT)UserCreateObject(
- gHandleTable, Handle,
- otMenu, sizeof(MENU_OBJECT));
+ PPROCESSINFO CurrentWin32Process;
+ Menu = (PMENU_OBJECT)UserCreateObject( gHandleTable,
+ NULL,
+ Handle,
+ otMenu,
+ sizeof(MENU_OBJECT));
if(!Menu)
{
*Handle = 0;
PMENU_OBJECT FASTCALL
IntCloneMenu(PMENU_OBJECT Source)
{
- PW32PROCESS CurrentWin32Process;
+ PPROCESSINFO CurrentWin32Process;
HANDLE hMenu;
PMENU_OBJECT Menu;
if(!Source)
return NULL;
- Menu = (PMENU_OBJECT)UserCreateObject(
- gHandleTable, &hMenu,
- otMenu, sizeof(MENU_OBJECT));
-
+ Menu = (PMENU_OBJECT)UserCreateObject( gHandleTable,
+ NULL,
+ &hMenu,
+ otMenu,
+ sizeof(MENU_OBJECT));
if(!Menu)
return NULL;
return TRUE;
}
-
-BOOL FASTCALL
-IntIsMenu(HMENU hMenu)
-{
- PMENU_OBJECT Menu;
-
- if((Menu = UserGetMenuObject(hMenu)))
- {
- return TRUE;
- }
- return FALSE;
-}
-
-
BOOL FASTCALL
IntSetMenuInfo(PMENU_OBJECT Menu, PROSMENUINFO lpmi)
{
if (sizeof(ROSMENUITEMINFO) == lpmii->cbSize)
{
lpmii->Rect = MenuItem->Rect;
- lpmii->XTab = MenuItem->XTab;
- lpmii->Text = MenuItem->Text.Buffer;
+ lpmii->dxTab = MenuItem->dxTab;
+ lpmii->lpstr = MenuItem->Text.Buffer; // Use DesktopHeap!
}
return TRUE;
if (sizeof(ROSMENUITEMINFO) == lpmii->cbSize)
{
MenuItem->Rect = lpmii->Rect;
- MenuItem->XTab = lpmii->XTab;
- lpmii->Text = MenuItem->Text.Buffer; /* Send back new allocated string or zero */
+ MenuItem->dxTab = lpmii->dxTab;
+ lpmii->lpstr = MenuItem->Text.Buffer; /* Use DesktopHeap! Send back new allocated string or zero */
}
return TRUE;
mii.hbmpUnchecked = CurItem->hbmpUnchecked;
mii.hSubMenu = CurItem->hSubMenu;
mii.Rect = CurItem->Rect;
- mii.XTab = CurItem->XTab;
- mii.Text = CurItem->Text.Buffer;
+ mii.dxTab = CurItem->dxTab;
+ mii.lpstr = CurItem->Text.Buffer; // Use DesktopHeap!
Status = MmCopyToCaller(Buf, &mii, sizeof(ROSMENUITEMINFO));
if (! NT_SUCCESS(Status))
* Internal function. Called when the process is destroyed to free the remaining menu handles.
*/
BOOL FASTCALL
-IntCleanupMenus(struct _EPROCESS *Process, PW32PROCESS Win32Process)
+IntCleanupMenus(struct _EPROCESS *Process, PPROCESSINFO Win32Process)
{
PEPROCESS CurrentProcess;
PLIST_ENTRY LastHead = NULL;
bti->rgstate[0] = STATE_SYSTEM_FOCUSABLE;
- dwStyle = pWindowObject->Wnd->Style;
+ dwStyle = pWindowObject->Wnd->style;
dwExStyle = pWindowObject->Wnd->ExStyle;
bti->rcTitleBar.top = 0;
bti->rcTitleBar.left = 0;
- bti->rcTitleBar.right = pWindowObject->Wnd->WindowRect.right - pWindowObject->Wnd->WindowRect.left;
- bti->rcTitleBar.bottom = pWindowObject->Wnd->WindowRect.bottom - pWindowObject->Wnd->WindowRect.top;
+ bti->rcTitleBar.right = pWindowObject->Wnd->rcWindow.right - pWindowObject->Wnd->rcWindow.left;
+ bti->rcTitleBar.bottom = pWindowObject->Wnd->rcWindow.bottom - pWindowObject->Wnd->rcWindow.top;
/* is it iconiced ? */
if ((dwStyle & WS_ICONIC)!=WS_ICONIC)
}
}
- bti->rcTitleBar.top += pWindowObject->Wnd->WindowRect.top;
- bti->rcTitleBar.left += pWindowObject->Wnd->WindowRect.left;
- bti->rcTitleBar.right += pWindowObject->Wnd->WindowRect.left;
+ bti->rcTitleBar.top += pWindowObject->Wnd->rcWindow.top;
+ bti->rcTitleBar.left += pWindowObject->Wnd->rcWindow.left;
+ bti->rcTitleBar.right += pWindowObject->Wnd->rcWindow.left;
bti->rcTitleBar.bottom = bti->rcTitleBar.top;
if (dwExStyle & WS_EX_TOOLWINDOW)
{
bti->rgstate[4] = STATE_SYSTEM_INVISIBLE;
}
- if (pWindowObject->Wnd->Class->Style & CS_NOCLOSE)
+ if (pWindowObject->Wnd->pcls->style & CS_NOCLOSE)
{
bti->rgstate[5] = STATE_SYSTEM_UNAVAILABLE;
}
if(MenuItem->fType & MF_POPUP)
{
- XMove = ReferenceWnd->Wnd->ClientRect.left;
- YMove = ReferenceWnd->Wnd->ClientRect.top;
+ XMove = ReferenceWnd->Wnd->rcClient.left;
+ YMove = ReferenceWnd->Wnd->rcClient.top;
}
else
{
- XMove = ReferenceWnd->Wnd->WindowRect.left;
- YMove = ReferenceWnd->Wnd->WindowRect.top;
+ XMove = ReferenceWnd->Wnd->rcWindow.left;
+ YMove = ReferenceWnd->Wnd->rcWindow.top;
}
Rect.left += XMove;
RETURN( -1);
}
- X -= Window->Wnd->WindowRect.left;
- Y -= Window->Wnd->WindowRect.top;
+ X -= Window->Wnd->rcWindow.left;
+ Y -= Window->Wnd->rcWindow.top;
mi = Menu->MenuItemList;
for (i = 0; NULL != mi; i++)