Author: jimtabor
Date: Wed Feb 22 17:50:38 2017
New Revision: 73888

URL: http://svn.reactos.org/svn/reactos?rev=73888&view=rev
Log:
[Win32SS]
- Implement Exclude Update Region, for testing. See CORE-12649.

Modified:
    trunk/reactos/win32ss/include/ntuser.h
    trunk/reactos/win32ss/user/ntuser/ntstubs.c
    trunk/reactos/win32ss/user/ntuser/painting.c

Modified: trunk/reactos/win32ss/include/ntuser.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/include/ntuser.h?rev=73888&r1=73887&r2=73888&view=diff
==============================================================================
--- trunk/reactos/win32ss/include/ntuser.h      [iso-8859-1] (original)
+++ trunk/reactos/win32ss/include/ntuser.h      [iso-8859-1] Wed Feb 22 
17:50:38 2017
@@ -2063,7 +2063,7 @@
 NtUserEvent(
     DWORD Unknown0);
 
-DWORD
+INT
 NTAPI
 NtUserExcludeUpdateRgn(
     HDC hDC,
@@ -2470,7 +2470,7 @@
     LPRECT lpRect,
     BOOL fErase);
 
-int
+INT
 NTAPI
 NtUserGetUpdateRgn(
     HWND hWnd,

Modified: trunk/reactos/win32ss/user/ntuser/ntstubs.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/ntstubs.c?rev=73888&r1=73887&r2=73888&view=diff
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/ntstubs.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/ntstubs.c [iso-8859-1] Wed Feb 22 
17:50:38 2017
@@ -98,17 +98,6 @@
 APIENTRY
 NtUserEvent(
    DWORD Unknown0)
-{
-   STUB
-
-   return 0;
-}
-
-DWORD
-APIENTRY
-NtUserExcludeUpdateRgn(
-  HDC hDC,
-  HWND hWnd)
 {
    STUB
 

Modified: trunk/reactos/win32ss/user/ntuser/painting.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/painting.c?rev=73888&r1=73887&r2=73888&view=diff
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/painting.c        [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/painting.c        [iso-8859-1] Wed Feb 22 
17:50:38 2017
@@ -2473,6 +2473,81 @@
    return NtUserDrawCaptionTemp(hWnd, hDC, lpRc, 0, 0, NULL, uFlags);
 }
 
+INT FASTCALL
+co_UserExcludeUpdateRgn(HDC hDC, PWND Window)
+{
+    POINT pt;
+    RECT rc;
+
+    if (Window->hrgnUpdate)
+    {
+        if (Window->hrgnUpdate == HRGN_WINDOW)
+        {
+            return NtGdiIntersectClipRect(hDC, 0, 0, 0, 0);
+        }
+        else
+        {
+            INT ret = ERROR;
+            HRGN hrgn = NtGdiCreateRectRgn(0,0,0,0);
+
+            if ( hrgn && GreGetDCPoint( hDC, GdiGetDCOrg, &pt) )
+            {
+                if ( NtGdiGetRandomRgn( hDC, hrgn, CLIPRGN) == NULLREGION )
+                {
+                    NtGdiOffsetRgn(hrgn, pt.x, pt.y);
+                }
+                else
+                {
+                    HRGN hrgnScreen;
+                    PMONITOR pm = UserGetPrimaryMonitor();
+                    hrgnScreen = NtGdiCreateRectRgn(0,0,0,0);
+                    NtGdiCombineRgn(hrgnScreen, hrgnScreen, pm->hrgnMonitor, 
RGN_OR);
+
+                    NtGdiCombineRgn(hrgn, hrgnScreen, NULL, RGN_COPY);
+
+                    GreDeleteObject(hrgnScreen);
+                }
+
+                NtGdiCombineRgn(hrgn, hrgn, Window->hrgnUpdate, RGN_DIFF);
+
+                NtGdiOffsetRgn(hrgn, -pt.x, -pt.y);
+
+                ret = NtGdiExtSelectClipRgn(hDC, hrgn, RGN_COPY);
+
+                GreDeleteObject(hrgn);
+            }
+            return ret;
+        }
+    }
+    else
+    {
+        return GdiGetClipBox( hDC, &rc);
+    }
+}
+
+INT
+APIENTRY
+NtUserExcludeUpdateRgn(
+    HDC hDC,
+    HWND hWnd)
+{
+    INT ret = ERROR;
+    PWND pWnd;
+
+    TRACE("Enter NtUserExcludeUpdateRgn\n");
+    UserEnterExclusive();
+
+    pWnd = UserGetWindowObject(hWnd);
+
+    if (hDC && pWnd)
+        ret = co_UserExcludeUpdateRgn(hDC, pWnd);
+
+    TRACE("Leave NtUserExcludeUpdateRgn, ret=%i\n", ret);
+
+    UserLeave();
+    return ret;
+}
+
 BOOL
 APIENTRY
 NtUserInvalidateRect(


Reply via email to