mirror of
https://github.com/reactos/reactos.git
synced 2024-07-30 16:18:43 +00:00
Correct the offset in NtUserGetMenuItemRect. It was unfinished.
svn path=/trunk/; revision=30824
This commit is contained in:
parent
d747ce2059
commit
940927a689
|
@ -1947,7 +1947,8 @@ NtUserGetMenuItemRect(
|
||||||
LPRECT lprcItem)
|
LPRECT lprcItem)
|
||||||
{
|
{
|
||||||
ROSMENUINFO mi;
|
ROSMENUINFO mi;
|
||||||
HWND referenceHwnd;
|
PWINDOW_OBJECT ReferenceWnd;
|
||||||
|
LONG XMove, YMove;
|
||||||
RECT Rect;
|
RECT Rect;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PMENU_OBJECT Menu;
|
PMENU_OBJECT Menu;
|
||||||
|
@ -1967,19 +1968,33 @@ NtUserGetMenuItemRect(
|
||||||
else
|
else
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
|
|
||||||
referenceHwnd = hWnd;
|
|
||||||
|
|
||||||
if(!hWnd)
|
if(!hWnd)
|
||||||
{
|
{
|
||||||
if(!UserMenuInfo(Menu, &mi, FALSE))
|
if(!UserMenuInfo(Menu, &mi, FALSE))
|
||||||
RETURN( FALSE);
|
RETURN( FALSE);
|
||||||
if(mi.Wnd == 0)
|
if(mi.Wnd == 0)
|
||||||
RETURN( FALSE);
|
RETURN( FALSE);
|
||||||
referenceHwnd = mi.Wnd; /* Okay we found it, so now what do we do? */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lprcItem == NULL)
|
if (lprcItem == NULL) RETURN( FALSE);
|
||||||
RETURN( FALSE);
|
|
||||||
|
if (!(ReferenceWnd = UserGetWindowObject(mi.Wnd))) RETURN( FALSE);
|
||||||
|
|
||||||
|
if(MenuItem->fType & MF_POPUP)
|
||||||
|
{
|
||||||
|
XMove = ReferenceWnd->Wnd->ClientRect.left;
|
||||||
|
YMove = ReferenceWnd->Wnd->ClientRect.top;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XMove = ReferenceWnd->Wnd->WindowRect.left;
|
||||||
|
YMove = ReferenceWnd->Wnd->WindowRect.top;
|
||||||
|
}
|
||||||
|
|
||||||
|
Rect.left += XMove;
|
||||||
|
Rect.Top += YMove;
|
||||||
|
Rect.right += XMove;
|
||||||
|
Rect.bottom += YMove;
|
||||||
|
|
||||||
Status = MmCopyToCaller(lprcItem, &Rect, sizeof(RECT));
|
Status = MmCopyToCaller(lprcItem, &Rect, sizeof(RECT));
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
|
Loading…
Reference in a new issue