[WIN32K]
authorJérôme Gardou <jerome.gardou@reactos.org>
Wed, 17 Sep 2014 11:40:21 +0000 (11:40 +0000)
committerJérôme Gardou <jerome.gardou@reactos.org>
Wed, 17 Sep 2014 11:40:21 +0000 (11:40 +0000)
 - Fix user-mode region attribute handling in IntGdiSetRegionOwner.

svn path=/trunk/; revision=64178

reactos/win32ss/gdi/ntgdi/region.c

index e6f737f..cda069c 100644 (file)
@@ -2323,23 +2323,22 @@ IntGdiSetRegionOwner(HRGN hRgn, DWORD OwnerMask)
     PRGN_ATTR prgnattr;
     PPROCESSINFO ppi;
 
-    prgn = REGION_LockRgn(hRgn);
+    prgn = RGNOBJAPI_Lock(hRgn, &prgnattr);
     if (!prgn)
     {
         return FALSE;
     }
 
-    prgnattr = GDIOBJ_pvGetObjectAttr(&prgn->BaseObject);
-    if (prgnattr)
+    if (prgnattr != &prgn->rgnattr)
     {
         GDIOBJ_vSetObjectAttr(&prgn->BaseObject, NULL);
-        prgn->prgnattr = NULL;
+        prgn->prgnattr = &prgn->rgnattr;
         ppi = PsGetCurrentProcessWin32Process();
         GdiPoolFree(ppi->pPoolRgnAttr, prgnattr);
     }
     RGNOBJAPI_Unlock(prgn);
 
-     return GreSetObjectOwner(hRgn, OwnerMask);
+    return GreSetObjectOwner(hRgn, OwnerMask);
 }
 
 INT