X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fwin32ss%2Fuser%2Fntuser%2Fpainting.c;h=b6db6716005a448f6e2df07678eb66679249f1ef;hp=6e2f4326d456f1bcd9f6517bf3d6f6b127c08100;hb=81652fd827a4997c2461e7d13a1baacecfb3ad35;hpb=482d43b8759ae026950c0d7b03f1b74c4dbda7ea diff --git a/reactos/win32ss/user/ntuser/painting.c b/reactos/win32ss/user/ntuser/painting.c index 6e2f4326d45..b6db6716005 100644 --- a/reactos/win32ss/user/ntuser/painting.c +++ b/reactos/win32ss/user/ntuser/painting.c @@ -2473,6 +2473,81 @@ NtUserDrawCaption(HWND hWnd, 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(