[Win32k|User32]

- Use User32 GetWindowRgnBox, still passing both wine msg SetWindowRgn and win winregion tests, see bug 5959.

svn path=/trunk/; revision=50934
This commit is contained in:
James Tabor 2011-02-28 09:10:43 +00:00
parent 823118e08a
commit c6182beb15
4 changed files with 10 additions and 63 deletions

View file

@ -278,7 +278,7 @@ GetWindowRgn(
pWnd = ValidateHwnd(hWnd);
if (!pWnd) // || !pwnd->hrgnClip || pwnd->state2 & WNDS2_MAXIMIZEDMONITORREGION)
if (!pWnd) // || !pWnd->hrgnClip || pWnd->state2 & WNDS2_MAXIMIZEDMONITORREGION)
return ERROR;
/*
Ret = CombineRgn(hRgn, pWnd->hrgnClip, NULL, RGN_COPY);
@ -314,21 +314,19 @@ GetWindowRgnBox(
pWnd = ValidateHwnd(hWnd);
if (!pWnd) // || !pwnd->hrgnClip || pwnd->state2 & WNDS2_MAXIMIZEDMONITORREGION)
if (!pWnd || !pWnd->hrgnClip || pWnd->state2 & WNDS2_MAXIMIZEDMONITORREGION)
return ERROR;
/*
Ret = GetRgnBox(pWnd->hrgnClip, lprc);
if (!Ret)
return ERROR;
if (pWnd->fnid != FNID_DESKTOP)
Ret = OffsetRect(lprc, -pWnd->rcWindow.left, -pWnd->rcWindow.top);
OffsetRect(lprc, -pWnd->rcWindow.left, -pWnd->rcWindow.top);
if (pWnd->ExStyle & WS_EX_LAYOUTRTL)
MirrorWindowRect(pWnd, lprc);
*/
Ret = (int)NtUserCallTwoParam((DWORD_PTR)hWnd, (DWORD_PTR)lprc, TWOPARAM_ROUTINE_GETWINDOWRGNBOX);
return Ret;
}

View file

@ -3130,7 +3130,6 @@ typedef struct tagKMDDELPARAM
#define ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING 0xfffe000d
#define ONEPARAM_ROUTINE_GETDESKTOPMAPPING 0xfffe000e
#define ONEPARAM_ROUTINE_GETCURSORPOSITION 0xfffe0048 // use ONEPARAM_ or TWOPARAM routine ?
#define TWOPARAM_ROUTINE_GETWINDOWRGNBOX 0xfffd0048 // user mode
#define TWOPARAM_ROUTINE_GETWINDOWRGN 0xfffd0049 // user mode
#define TWOPARAM_ROUTINE_SETMENUBARHEIGHT 0xfffd0050
#define TWOPARAM_ROUTINE_SETGUITHRDHANDLE 0xfffd0052

View file

@ -367,7 +367,6 @@ NtUserCallTwoParam(
DWORD_PTR Param2,
DWORD Routine)
{
NTSTATUS Status;
PWND Window;
DECLARE_RETURN(DWORD_PTR);
@ -376,22 +375,6 @@ NtUserCallTwoParam(
switch(Routine)
{
case TWOPARAM_ROUTINE_GETWINDOWRGNBOX:
{
DWORD_PTR Ret;
RECTL rcRect;
Window = UserGetWindowObject((HWND)Param1);
if (!Window) RETURN(ERROR);
Ret = (DWORD_PTR)IntGetWindowRgnBox(Window, &rcRect);
Status = MmCopyToCaller((PVOID)Param2, &rcRect, sizeof(RECT));
if(!NT_SUCCESS(Status))
{
SetLastNtError(Status);
RETURN( ERROR);
}
RETURN( Ret);
}
case TWOPARAM_ROUTINE_GETWINDOWRGN:
{
Window = UserGetWindowObject((HWND)Param1);

View file

@ -4056,45 +4056,6 @@ IntGetWindowRgn(PWND Window, HRGN hRgn)
return Ret;
}
// This should be in user32!
INT FASTCALL
IntGetWindowRgnBox(PWND Window, RECTL *Rect)
{
INT Ret;
HRGN VisRgn;
ROSRGNDATA *pRgn;
if(!Window)
{
return ERROR;
}
if(!Rect)
{
return ERROR;
}
/* Create a new window region using the window rectangle */
VisRgn = IntSysCreateRectRgnIndirect(&Window->rcWindow);
NtGdiOffsetRgn(VisRgn, -Window->rcWindow.left, -Window->rcWindow.top);
/* if there's a region assigned to the window, combine them both */
if(Window->hrgnClip && !(Window->style & WS_MINIMIZE))
NtGdiCombineRgn(VisRgn, VisRgn, Window->hrgnClip, RGN_AND);
if((pRgn = RGNOBJAPI_Lock(VisRgn, NULL)))
{
Ret = REGION_Complexity(pRgn);
*Rect = pRgn->rdh.rcBound;
RGNOBJAPI_Unlock(pRgn);
}
else
Ret = ERROR;
REGION_FreeRgnByHandle(VisRgn);
return Ret;
}
/*
* @implemented
*/
@ -4143,6 +4104,12 @@ NtUserSetWindowRgn(
GreDeleteObject(Window->hrgnClip);
}
if (Window->fnid != FNID_DESKTOP)
NtGdiOffsetRgn(hrgnCopy, Window->rcWindow.left, Window->rcWindow.top);
/* Set public ownership */
IntGdiSetRegionOwner(hrgnCopy, GDI_OBJ_HMGR_PUBLIC);
Window->hrgnClip = hrgnCopy;
Ret = co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0, bRedraw ? flags : (flags|SWP_NOREDRAW) );