Author: jimtabor
Date: Mon Feb 28 09:10:43 2011
New Revision: 50934
URL:
http://svn.reactos.org/svn/reactos?rev=50934&view=rev
Log:
[Win32k|User32]
- Use User32 GetWindowRgnBox, still passing both wine msg SetWindowRgn and win winregion
tests, see bug 5959.
Modified:
trunk/reactos/dll/win32/user32/windows/paint.c
trunk/reactos/include/reactos/win32k/ntuser.h
trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/dll/win32/user32/windows/paint.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/p…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/paint.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/paint.c [iso-8859-1] Mon Feb 28 09:10:43 2011
@@ -278,7 +278,7 @@
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 @@
pWnd = ValidateHwnd(hWnd);
- if (!pWnd) // || !pwnd->hrgnClip || pwnd->state2 &
WNDS2_MAXIMIZEDMONITORREGION)
- return ERROR;
-/*
+ 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;
}
Modified: trunk/reactos/include/reactos/win32k/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Mon Feb 28 09:10:43 2011
@@ -3130,7 +3130,6 @@
#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
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] Mon Feb 28
09:10:43 2011
@@ -367,7 +367,6 @@
DWORD_PTR Param2,
DWORD Routine)
{
- NTSTATUS Status;
PWND Window;
DECLARE_RETURN(DWORD_PTR);
@@ -376,22 +375,6 @@
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);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Mon Feb 28 09:10:43
2011
@@ -4056,45 +4056,6 @@
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
*/
@@ -4142,6 +4103,12 @@
/* Delete no longer needed region handle */
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;