mirror of
https://github.com/reactos/reactos.git
synced 2024-07-31 00:28:56 +00:00
Clean up and fixed NtUserGetMenuItemRect. Needs more testing. I watch mplayerc swip all the menu items with crashing.
svn path=/trunk/; revision=20559
This commit is contained in:
parent
4ac1eae8cf
commit
1b8dc2e713
|
@ -1696,16 +1696,11 @@ NtUserGetMenuItemRect(
|
||||||
LPRECT lprcItem)
|
LPRECT lprcItem)
|
||||||
{
|
{
|
||||||
ROSMENUINFO mi;
|
ROSMENUINFO mi;
|
||||||
ROSMENUITEMINFO mii;
|
|
||||||
HWND referenceHwnd;
|
HWND referenceHwnd;
|
||||||
LPPOINT lpPoints;
|
RECT Rect;
|
||||||
LPRECT lpRect = NULL;
|
|
||||||
POINT FromOffset;
|
|
||||||
LONG XMove, YMove;
|
|
||||||
ULONG i;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PMENU_OBJECT Menu;
|
PMENU_OBJECT Menu;
|
||||||
PWINDOW_OBJECT ReferenceWnd;
|
PMENU_ITEM MenuItem;
|
||||||
DECLARE_RETURN(BOOL);
|
DECLARE_RETURN(BOOL);
|
||||||
|
|
||||||
DPRINT("Enter NtUserGetMenuItemRect\n");
|
DPRINT("Enter NtUserGetMenuItemRect\n");
|
||||||
|
@ -1716,8 +1711,10 @@ NtUserGetMenuItemRect(
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!UserMenuItemInfo(Menu, uItem, MF_BYPOSITION, &mii, FALSE))
|
if (IntGetMenuItemByFlag(Menu, uItem, MF_BYPOSITION, &MenuItem, NULL) > -1)
|
||||||
RETURN( FALSE);
|
Rect = MenuItem->Rect;
|
||||||
|
else
|
||||||
|
RETURN(FALSE);
|
||||||
|
|
||||||
referenceHwnd = hWnd;
|
referenceHwnd = hWnd;
|
||||||
|
|
||||||
|
@ -1727,30 +1724,13 @@ NtUserGetMenuItemRect(
|
||||||
RETURN( FALSE);
|
RETURN( FALSE);
|
||||||
if(mi.Wnd == 0)
|
if(mi.Wnd == 0)
|
||||||
RETURN( FALSE);
|
RETURN( FALSE);
|
||||||
referenceHwnd = mi.Wnd;
|
referenceHwnd = mi.Wnd; /* Okay we found it, so now what do we do? */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lprcItem == NULL)
|
if (lprcItem == NULL)
|
||||||
RETURN( FALSE);
|
RETURN( FALSE);
|
||||||
*lpRect = mii.Rect;
|
|
||||||
lpPoints = (LPPOINT)lpRect;
|
|
||||||
|
|
||||||
ReferenceWnd = UserGetWindowObject(referenceHwnd);
|
Status = MmCopyToCaller(lprcItem, &Rect, sizeof(RECT));
|
||||||
if (!ReferenceWnd || !UserGetClientOrigin(ReferenceWnd, &FromOffset))
|
|
||||||
{
|
|
||||||
RETURN( FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
XMove = FromOffset.x;
|
|
||||||
YMove = FromOffset.y;
|
|
||||||
|
|
||||||
for (i = 0; i < 2; i++)
|
|
||||||
{
|
|
||||||
lpPoints[i].x += XMove;
|
|
||||||
lpPoints[i].y += YMove;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = MmCopyToCaller(lprcItem, lpPoints, sizeof(RECT));
|
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
SetLastNtError(Status);
|
SetLastNtError(Status);
|
||||||
|
|
Loading…
Reference in a new issue