Author: tkreuzer
Date: Fri Dec 19 10:34:52 2014
New Revision: 65746
URL:
http://svn.reactos.org/svn/reactos?rev=65746&view=rev
Log:
[WIN32K]
Rename RGNOBJAPI_Lock to REGION_LockRgn and remove the 2nd argument, rename
RGNOBJAPI_Unlock to REGION_UnlockRgn, remove the old inline lock/unlock functions. Do
proper locking using GDIOBJ_bLockMultipleObjects in NtGdiEqualRgn.
Modified:
trunk/reactos/win32ss/gdi/ntgdi/bitblt.c
trunk/reactos/win32ss/gdi/ntgdi/path.c
trunk/reactos/win32ss/gdi/ntgdi/region.c
trunk/reactos/win32ss/gdi/ntgdi/region.h
trunk/reactos/win32ss/user/ntuser/painting.c
trunk/reactos/win32ss/user/ntuser/simplecall.c
trunk/reactos/win32ss/user/ntuser/vis.c
trunk/reactos/win32ss/user/ntuser/winpos.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/bitblt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/bitblt.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/bitblt.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/bitblt.c [iso-8859-1] Fri Dec 19 10:34:52 2014
@@ -1130,7 +1130,7 @@
}
/* Lock the region */
- prgn = RGNOBJAPI_Lock(hrgn, NULL);
+ prgn = REGION_LockRgn(hrgn);
if (prgn == NULL)
{
ERR("Failed to lock hrgn %p\n", hrgn);
@@ -1143,7 +1143,7 @@
if (pbrFill == NULL)
{
ERR("Failed to lock hbrush %p\n", hbrush);
- RGNOBJAPI_Unlock(prgn);
+ REGION_UnlockRgn(prgn);
DC_UnlockDc(pdc);
return FALSE;
}
@@ -1157,7 +1157,7 @@
/* Cleanup locks */
BRUSH_ShareUnlockBrush(pbrFill);
- RGNOBJAPI_Unlock(prgn);
+ REGION_UnlockRgn(prgn);
DC_UnlockDc(pdc);
return bResult;
@@ -1197,7 +1197,7 @@
ULONG i;
PRECTL rc;
- RgnData = RGNOBJAPI_Lock(hRgn, NULL);
+ RgnData = REGION_LockRgn(hRgn);
if (RgnData == NULL)
{
EngSetLastError(ERROR_INVALID_HANDLE);
@@ -1210,13 +1210,13 @@
if (!NtGdiPatBlt(hDC, rc->left, rc->top, rc->right - rc->left,
rc->bottom - rc->top, DSTINVERT))
{
- RGNOBJAPI_Unlock(RgnData);
+ REGION_UnlockRgn(RgnData);
return FALSE;
}
rc++;
}
- RGNOBJAPI_Unlock(RgnData);
+ REGION_UnlockRgn(RgnData);
return TRUE;
}
Modified: trunk/reactos/win32ss/gdi/ntgdi/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/path.c?r…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/path.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/path.c [iso-8859-1] Fri Dec 19 10:34:52 2014
@@ -2723,7 +2723,7 @@
if (PATH_PathToRegion(pPath, pdcattr->jFillMode, Rgn))
{
PATH_EmptyPath(pPath);
- RGNOBJAPI_Unlock(Rgn);
+ REGION_UnlockRgn(Rgn);
}
else
{
Modified: trunk/reactos/win32ss/gdi/ntgdi/region.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/region.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/region.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/region.c [iso-8859-1] Fri Dec 19 10:34:52 2014
@@ -534,7 +534,7 @@
{
PREGION Data;
- Data = RGNOBJAPI_Lock(hRgn, NULL);
+ Data = REGION_LockRgn(hRgn);
if (Data == NULL)
{
DbgPrint("IntDumpRegion called with invalid region!\n");
@@ -549,7 +549,7 @@
Data->rdh.rcBound.bottom,
Data->rdh.iType);
- RGNOBJAPI_Unlock(Data);
+ REGION_UnlockRgn(Data);
}
#endif /* Not NDEBUG */
@@ -1768,7 +1768,7 @@
trb = REGION_AllocRgnWithHandle(srb->rdh.nCount + 1);
if (trb == NULL)
{
- RGNOBJAPI_Unlock(tra);
+ REGION_UnlockRgn(tra);
GreDeleteObject(htra);
return;
}
@@ -1777,8 +1777,8 @@
REGION_SubtractRegion(tra, sra, srb);
REGION_SubtractRegion(trb, srb, sra);
REGION_UnionRegion(dr, tra, trb);
- RGNOBJAPI_Unlock(tra);
- RGNOBJAPI_Unlock(trb);
+ REGION_UnlockRgn(tra);
+ REGION_UnlockRgn(trb);
GreDeleteObject(htra);
GreDeleteObject(htrb);
@@ -2016,7 +2016,7 @@
}
/* Lock the source region */
- prgnSrc = RGNOBJAPI_Lock(hrgn, NULL);
+ prgnSrc = REGION_LockRgn(hrgn);
if (prgnSrc == NULL)
{
REGION_Delete(prgnFrame);
@@ -2026,7 +2026,7 @@
if (REGION_bMakeFrameRegion(prgnFrame, prgnSrc, cx, cy))
{
hrgnFrame = prgnFrame->BaseObject.hHmgr;
- RGNOBJAPI_Unlock(prgnFrame);
+ REGION_UnlockRgn(prgnFrame);
}
else
{
@@ -2034,7 +2034,7 @@
hrgnFrame = NULL;
}
- RGNOBJAPI_Unlock(prgnSrc);
+ REGION_UnlockRgn(prgnSrc);
return hrgnFrame;
}
@@ -2319,28 +2319,23 @@
PREGION
FASTCALL
-RGNOBJAPI_Lock(
- HRGN hRgn,
- PRGN_ATTR *ppRgn_Attr)
-{
- PREGION pRgn;
-
- pRgn = REGION_LockRgn(hRgn);
- if (pRgn == NULL)
+REGION_LockRgn(
+ _In_ HRGN hrgn)
+{
+ PREGION prgn;
+
+ prgn = GDIOBJ_LockObject(hrgn, GDIObjType_RGN_TYPE);
+ if (prgn == NULL)
return NULL;
- REGION_vSyncRegion(pRgn);
-
- if (ppRgn_Attr)
- *ppRgn_Attr = pRgn->prgnattr;
-
- return pRgn;
+ REGION_vSyncRegion(prgn);
+ return prgn;
}
VOID
FASTCALL
-RGNOBJAPI_Unlock(
- PREGION prgn)
+REGION_UnlockRgn(
+ _In_ PREGION prgn)
{
PRGN_ATTR prgnattr;
@@ -2360,7 +2355,7 @@
prgnattr->AttrFlags |= ATTR_RGN_VALID;
}
- REGION_UnlockRgn(prgn);
+ GDIOBJ_vUnlockObject(&prgn->BaseObject);
}
/*
@@ -2431,12 +2426,13 @@
PRGN_ATTR prgnattr;
PPROCESSINFO ppi;
- prgn = RGNOBJAPI_Lock(hRgn, &prgnattr);
+ prgn = REGION_LockRgn(hRgn);
if (prgn == NULL)
{
return FALSE;
}
+ prgnattr = prgn->prgnattr;
if (prgnattr != &prgn->rgnattr)
{
GDIOBJ_vSetObjectAttr(&prgn->BaseObject, NULL);
@@ -2445,7 +2441,7 @@
GdiPoolFree(ppi->pPoolRgnAttr, prgnattr);
}
- RGNOBJAPI_Unlock(prgn);
+ REGION_UnlockRgn(prgn);
return GreSetObjectOwner(hRgn, OwnerMask);
}
@@ -2532,14 +2528,14 @@
PREGION Rgn;
DWORD ret;
- Rgn = RGNOBJAPI_Lock(hRgn, NULL);
+ Rgn = REGION_LockRgn(hRgn);
if (Rgn == NULL)
{
return ERROR;
}
ret = REGION_GetRgnBox(Rgn, pRect);
- RGNOBJAPI_Unlock(Rgn);
+ REGION_UnlockRgn(Rgn);
return ret;
}
@@ -3434,7 +3430,7 @@
{
/* Success, get the handle and unlock the region */
hrgn = prgn->BaseObject.hHmgr;
- RGNOBJAPI_Unlock(prgn);
+ REGION_UnlockRgn(prgn);
}
else
{
@@ -3455,14 +3451,14 @@
PREGION Rgn;
BOOL Ret;
- Rgn = RGNOBJAPI_Lock(hRgn, NULL);
+ Rgn = REGION_LockRgn(hRgn);
if (Rgn == NULL)
{
return ERROR;
}
Ret = REGION_RectInRegion(Rgn, rc);
- RGNOBJAPI_Unlock(Rgn);
+ REGION_UnlockRgn(Rgn);
return Ret;
}
@@ -3493,7 +3489,7 @@
(hrgnSrc1 == NULL) ||
((iMode != RGN_COPY) && (hrgnSrc2 == NULL)))
{
- DPRINT1("NtGdiCombineRgn: %p, %p, %p, %d\n",
+ DPRINT1("NtGdiCombineRgn invalid parameters: %p, %p, %p, %d\n",
hrgnDst, hrgnSrc1, hrgnSrc2, iMode);
return ERROR;
}
@@ -3504,7 +3500,7 @@
ahrgn[2] = iMode != RGN_COPY ? hrgnSrc2 : NULL;
if (!GDIOBJ_bLockMultipleObjects(3, (HGDIOBJ*)ahrgn, (PVOID*)aprgn,
GDIObjType_RGN_TYPE))
{
- DPRINT1("NtGdiCombineRgn: %p, %p, %p, %d\n",
+ DPRINT1("NtGdiCombineRgn failed to lock regions: %p, %p, %p, %d\n",
hrgnDst, hrgnSrc1, hrgnSrc2, iMode);
return ERROR;
}
@@ -3520,10 +3516,10 @@
iResult = IntGdiCombineRgn(aprgn[0], aprgn[1], aprgn[2], iMode);
/* Unlock and return */
- RGNOBJAPI_Unlock(aprgn[0]);
- RGNOBJAPI_Unlock(aprgn[1]);
+ REGION_UnlockRgn(aprgn[0]);
+ REGION_UnlockRgn(aprgn[1]);
if (aprgn[2] != NULL)
- RGNOBJAPI_Unlock(aprgn[2]);
+ REGION_UnlockRgn(aprgn[2]);
return iResult;
}
@@ -3565,7 +3561,7 @@
hRgn = pRgn->BaseObject.hHmgr;
REGION_SetRectRgn(pRgn, LeftRect, TopRect, RightRect, BottomRect);
- RGNOBJAPI_Unlock(pRgn);
+ REGION_UnlockRgn(pRgn);
DPRINT("Returning %p.\n", hRgn);
@@ -3692,7 +3688,7 @@
REGION_UnionRectWithRgn(obj, &rect);
}
- RGNOBJAPI_Unlock(obj);
+ REGION_UnlockRgn(obj);
return hrgn;
}
@@ -3702,23 +3698,46 @@
HRGN hSrcRgn1,
HRGN hSrcRgn2)
{
+ HRGN ahrgn[2];
+ PREGION aprgn[2];
PREGION rgn1, rgn2;
PRECTL tRect1, tRect2;
ULONG i;
BOOL bRet = FALSE;
- /// FIXME: need to use GDIOBJ_LockMultipleObjects
-
- rgn1 = RGNOBJAPI_Lock(hSrcRgn1, NULL);
- if (rgn1 == NULL)
- return ERROR;
-
- rgn2 = RGNOBJAPI_Lock(hSrcRgn2, NULL);
- if (rgn2 == NULL)
- {
- RGNOBJAPI_Unlock(rgn1);
- return ERROR;
- }
+ /* Check if we got 2 regions */
+ if ((hSrcRgn1 == NULL) || (hSrcRgn2 == NULL))
+ {
+ return FALSE;
+ }
+
+ /* Check if these are the same regions */
+ if (hSrcRgn1 == hSrcRgn2)
+ {
+ /* Make sure this region is valid */
+ if ((GDI_HANDLE_GET_TYPE(hSrcRgn1) == GDILoObjType_LO_REGION_TYPE) &&
+ GreIsHandleValid(hSrcRgn1))
+ {
+ return TRUE;
+ }
+ return FALSE;
+ }
+
+ /* Lock both regions */
+ ahrgn[0] = hSrcRgn1;
+ ahrgn[1] = hSrcRgn2;
+ if (!GDIOBJ_bLockMultipleObjects(2, (HGDIOBJ*)ahrgn, (PVOID*)aprgn,
GDIObjType_RGN_TYPE))
+ {
+ DPRINT1("NtGdiEqualRgn failed to lock regions: %p, %p\n",
+ hSrcRgn1, hSrcRgn2);
+ return FALSE;
+ }
+
+ REGION_vSyncRegion(aprgn[0]);
+ REGION_vSyncRegion(aprgn[1]);
+
+ rgn1 = aprgn[0];
+ rgn2 = aprgn[1];
if (rgn1->rdh.nCount != rgn2->rdh.nCount)
goto exit;
@@ -3753,8 +3772,8 @@
bRet = TRUE;
exit:
- RGNOBJAPI_Unlock(rgn1);
- RGNOBJAPI_Unlock(rgn2);
+ REGION_UnlockRgn(rgn1);
+ REGION_UnlockRgn(rgn2);
return bRet;
}
@@ -3854,12 +3873,12 @@
if (!NT_SUCCESS(Status))
{
EngSetLastError(ERROR_INVALID_PARAMETER);
- RGNOBJAPI_Unlock(Region);
+ REGION_UnlockRgn(Region);
GreDeleteObject(hRgn);
return NULL;
}
- RGNOBJAPI_Unlock(Region);
+ REGION_UnlockRgn(Region);
return hRgn;
}
@@ -3875,14 +3894,14 @@
DWORD ret;
NTSTATUS Status = STATUS_SUCCESS;
- Rgn = RGNOBJAPI_Lock(hRgn, NULL);
+ Rgn = REGION_LockRgn(hRgn);
if (Rgn == NULL)
{
return ERROR;
}
ret = REGION_GetRgnBox(Rgn, &SafeRect);
- RGNOBJAPI_Unlock(Rgn);
+ REGION_UnlockRgn(Rgn);
if (ret == ERROR)
{
return ret;
@@ -3918,7 +3937,7 @@
DPRINT("NtGdiOffsetRgn: hRgn %p Xoffs %d Yoffs %d rgn %p\n", hRgn, XOffset,
YOffset, rgn );
- rgn = RGNOBJAPI_Lock(hRgn, NULL);
+ rgn = REGION_LockRgn(hRgn);
if (rgn == NULL)
{
DPRINT("NtGdiOffsetRgn: hRgn error\n");
@@ -3934,7 +3953,7 @@
ret = REGION_Complexity(rgn);
}
- RGNOBJAPI_Unlock(rgn);
+ REGION_UnlockRgn(rgn);
return ret;
}
@@ -3948,13 +3967,13 @@
PREGION prgn;
BOOL ret;
- prgn = RGNOBJAPI_Lock(hRgn, NULL);
+ prgn = REGION_LockRgn(hRgn);
if (prgn == NULL)
return FALSE;
ret = REGION_PtInRegion(prgn, X, Y);
- RGNOBJAPI_Unlock(prgn);
+ REGION_UnlockRgn(prgn);
return ret;
}
@@ -3999,7 +4018,7 @@
{
PREGION rgn;
- rgn = RGNOBJAPI_Lock(hRgn, NULL);
+ rgn = REGION_LockRgn(hRgn);
if (rgn == NULL)
{
return 0; // Per documentation
@@ -4007,7 +4026,7 @@
REGION_SetRectRgn(rgn, LeftRect, TopRect, RightRect, BottomRect);
- RGNOBJAPI_Unlock(rgn);
+ REGION_UnlockRgn(rgn);
return TRUE;
}
@@ -4033,7 +4052,7 @@
PREGION prgn;
/* Lock the region */
- prgn = RGNOBJAPI_Lock(hrgn, NULL);
+ prgn = REGION_LockRgn(hrgn);
if (prgn == NULL)
{
EngSetLastError(ERROR_INVALID_HANDLE);
@@ -4074,7 +4093,7 @@
}
/* Unlock the region and return the size */
- RGNOBJAPI_Unlock(prgn);
+ REGION_UnlockRgn(prgn);
return cjSize;
}
Modified: trunk/reactos/win32ss/gdi/ntgdi/region.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/region.h…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/region.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/region.h [iso-8859-1] Fri Dec 19 10:34:52 2014
@@ -39,6 +39,16 @@
VOID FASTCALL REGION_Delete(PREGION);
INT APIENTRY IntGdiGetRgnBox(HRGN, RECTL*);
+PREGION
+FASTCALL
+REGION_LockRgn(
+ _In_ HRGN hrgn);
+
+VOID
+FASTCALL
+REGION_UnlockRgn(
+ _In_ PREGION prgn);
+
BOOL
FASTCALL
REGION_bXformRgn(
@@ -73,8 +83,6 @@
INT FASTCALL IntGdiCombineRgn(PREGION, PREGION, PREGION, INT);
INT FASTCALL REGION_Complexity(PREGION);
-PREGION FASTCALL RGNOBJAPI_Lock(HRGN,PRGN_ATTR *);
-VOID FASTCALL RGNOBJAPI_Unlock(PREGION);
PREGION FASTCALL IntSysCreateRectpRgn(INT,INT,INT,INT);
BOOL FASTCALL IntGdiSetRegionOwner(HRGN,DWORD);
@@ -92,19 +100,5 @@
FASTCALL
IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect);
-FORCEINLINE
-PREGION
-REGION_LockRgn(HRGN hrgn)
-{
- return GDIOBJ_LockObject(hrgn, GDIObjType_RGN_TYPE);
-}
-
-FORCEINLINE
-VOID
-REGION_UnlockRgn(PREGION prgn)
-{
- GDIOBJ_vUnlockObject(&prgn->BaseObject);
-}
-
// FIXME: move this
BOOL FASTCALL IntGdiPaintRgn(PDC, PREGION );
Modified: trunk/reactos/win32ss/user/ntuser/painting.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/painti…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/painting.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/painting.c [iso-8859-1] Fri Dec 19 10:34:52 2014
@@ -314,15 +314,15 @@
{
if (Wnd->hrgnUpdate)
{
- PREGION RgnUpdate = RGNOBJAPI_Lock(Wnd->hrgnUpdate, NULL);
+ PREGION RgnUpdate = REGION_LockRgn(Wnd->hrgnUpdate);
if (RgnUpdate)
{
if (!IntValidateParent(Wnd, RgnUpdate, Recurse))
{
- RGNOBJAPI_Unlock(RgnUpdate);
+ REGION_UnlockRgn(RgnUpdate);
return;
}
- RGNOBJAPI_Unlock(RgnUpdate);
+ REGION_UnlockRgn(RgnUpdate);
}
}
@@ -457,7 +457,7 @@
}
else
{
- PREGION RgnClip = RGNOBJAPI_Lock(Wnd->hrgnClip, NULL);
+ PREGION RgnClip = REGION_LockRgn(Wnd->hrgnClip);
if (RgnClip)
{
REGION_bOffsetRgn(Rgn,
@@ -467,7 +467,7 @@
REGION_bOffsetRgn(Rgn,
Wnd->rcWindow.left,
Wnd->rcWindow.top);
- RGNOBJAPI_Unlock(RgnClip);
+ REGION_UnlockRgn(RgnClip);
}
}
@@ -514,11 +514,11 @@
IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_PUBLIC);
}
- RgnUpdate = RGNOBJAPI_Lock(Wnd->hrgnUpdate, NULL);
+ RgnUpdate = REGION_LockRgn(Wnd->hrgnUpdate);
if (RgnUpdate)
{
RgnType = IntGdiCombineRgn(RgnUpdate, RgnUpdate, Rgn, RGN_OR);
- RGNOBJAPI_Unlock(RgnUpdate);
+ REGION_UnlockRgn(RgnUpdate);
if (RgnType == NULLREGION)
{
IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
@@ -547,12 +547,12 @@
if (Wnd->hrgnUpdate != NULL)
{
- PREGION RgnUpdate = RGNOBJAPI_Lock(Wnd->hrgnUpdate, NULL);
+ PREGION RgnUpdate = REGION_LockRgn(Wnd->hrgnUpdate);
if (RgnUpdate)
{
RgnType = IntGdiCombineRgn(RgnUpdate, RgnUpdate, Rgn, RGN_DIFF);
- RGNOBJAPI_Unlock(RgnUpdate);
+ REGION_UnlockRgn(RgnUpdate);
if(RgnType == NULLREGION)
{
@@ -1221,7 +1221,7 @@
return NULLREGION;
}
- UpdateRgn = RGNOBJAPI_Lock(Window->hrgnUpdate, NULL);
+ UpdateRgn = REGION_LockRgn(Window->hrgnUpdate);
if (!UpdateRgn)
return ERROR;
@@ -1230,7 +1230,7 @@
REGION_SetRectRgn(Rgn, Rect.left, Rect.top, Rect.right, Rect.bottom);
RegionType = IntGdiCombineRgn(Rgn, Rgn, UpdateRgn, RGN_AND);
REGION_bOffsetRgn(Rgn, -Window->rcClient.left, -Window->rcClient.top);
- RGNOBJAPI_Unlock(UpdateRgn);
+ REGION_UnlockRgn(UpdateRgn);
if (bErase && RegionType != NULLREGION && RegionType != ERROR)
{
@@ -1278,14 +1278,14 @@
CLEANUP:
if (Rgn && (_ret_ != ERROR))
{
- PREGION TheRgn = RGNOBJAPI_Lock(hRgn, NULL);
+ PREGION TheRgn = REGION_LockRgn(hRgn);
if (!TheRgn)
{
EngSetLastError(ERROR_INVALID_HANDLE);
_ret_ = ERROR;
}
IntGdiCombineRgn(TheRgn, Rgn, NULL, RGN_COPY);
- RGNOBJAPI_Unlock(TheRgn);
+ REGION_UnlockRgn(TheRgn);
}
if (Rgn)
@@ -1336,10 +1336,10 @@
}
else
{
- RgnData = RGNOBJAPI_Lock(Window->hrgnUpdate, NULL);
+ RgnData = REGION_LockRgn(Window->hrgnUpdate);
ASSERT(RgnData != NULL);
RegionType = REGION_GetRgnBox(RgnData, &Rect);
- RGNOBJAPI_Unlock(RgnData);
+ REGION_UnlockRgn(RgnData);
if (RegionType != ERROR && RegionType != NULLREGION)
RECTL_bIntersectRect(&Rect, &Rect, &Window->rcClient);
@@ -1453,14 +1453,14 @@
RETURN(FALSE);
}
- RgnTemp = RGNOBJAPI_Lock(hrgnUpdate, NULL);
+ RgnTemp = REGION_LockRgn(hrgnUpdate);
if (!RgnTemp)
{
EngSetLastError(ERROR_INVALID_HANDLE);
RETURN(FALSE);
}
IntGdiCombineRgn(RgnUpdate, RgnTemp, NULL, RGN_COPY);
- RGNOBJAPI_Unlock(RgnTemp);
+ REGION_UnlockRgn(RgnTemp);
}
UserRefObjectCo(Wnd, &Ref);
@@ -1549,7 +1549,7 @@
if (hrgnUpdate)
{
NT_ASSERT(RgnUpdate == NULL);
- RgnUpdate = RGNOBJAPI_Lock(hrgnUpdate, NULL);
+ RgnUpdate = REGION_LockRgn(hrgnUpdate);
if (!RgnUpdate)
{
DC_UnlockDc(pDC);
@@ -1592,7 +1592,7 @@
if (hrgnUpdate)
{
- RGNOBJAPI_Unlock(RgnUpdate);
+ REGION_UnlockRgn(RgnUpdate);
}
else if (!RgnUpdate)
{
@@ -1786,14 +1786,14 @@
if (hrgnUpdate)
{
- RgnTemp = RGNOBJAPI_Lock(hrgnUpdate, NULL);
+ RgnTemp = REGION_LockRgn(hrgnUpdate);
if (!RgnTemp)
{
EngSetLastError(ERROR_INVALID_HANDLE);
RETURN(ERROR);
}
IntGdiCombineRgn(RgnUpdate, RgnTemp, NULL, RGN_COPY);
- RGNOBJAPI_Unlock(RgnTemp);
+ REGION_UnlockRgn(RgnTemp);
}
/* ScrollWindow uses the window DC, ScrollWindowEx doesn't */
@@ -1941,14 +1941,14 @@
if (hrgnUpdate && (_ret_ != ERROR))
{
/* Give everything back to the caller */
- RgnTemp = RGNOBJAPI_Lock(hrgnUpdate, NULL);
+ RgnTemp = REGION_LockRgn(hrgnUpdate);
/* The handle should still be valid */
ASSERT(RgnTemp);
if (RgnWinupd)
IntGdiCombineRgn(RgnTemp, RgnUpdate, RgnWinupd, RGN_OR);
else
IntGdiCombineRgn(RgnTemp, RgnUpdate, NULL, RGN_COPY);
- RGNOBJAPI_Unlock(RgnTemp);
+ REGION_UnlockRgn(RgnTemp);
}
if (RgnWinupd)
Modified: trunk/reactos/win32ss/user/ntuser/simplecall.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/simple…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/simplecall.c [iso-8859-1] Fri Dec 19 10:34:52 2014
@@ -169,8 +169,8 @@
if (count == 0) count = 8;
psmwp = (PSMWP) UserCreateObject( gHandleTable,
- NULL,
- NULL,
+ NULL,
+ NULL,
(PHANDLE)&hDwp,
TYPE_SETWINDOWPOS,
sizeof(SMWP));
@@ -780,11 +780,11 @@
{
case TWOPARAM_ROUTINE_VALIDATERGN:
{
- PREGION Rgn = RGNOBJAPI_Lock((HRGN)Param, NULL);
+ PREGION Rgn = REGION_LockRgn((HRGN)Param);
if (Rgn)
{
Ret = (DWORD)co_UserRedrawWindow( Window, NULL, Rgn, RDW_VALIDATE);
- RGNOBJAPI_Unlock(Rgn);
+ REGION_UnlockRgn(Rgn);
}
break;
}
Modified: trunk/reactos/win32ss/user/ntuser/vis.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/vis.c?…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/vis.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/vis.c [iso-8859-1] Fri Dec 19 10:34:52 2014
@@ -78,13 +78,13 @@
/* Combine it with the window region if available */
if (CurrentSibling->hrgnClip && !(CurrentSibling->style
& WS_MINIMIZE))
{
- PREGION SiblingClipRgn = RGNOBJAPI_Lock(CurrentSibling->hrgnClip,
NULL);
+ PREGION SiblingClipRgn = REGION_LockRgn(CurrentSibling->hrgnClip);
if (SiblingClipRgn)
{
REGION_bOffsetRgn(ClipRgn, -CurrentSibling->rcWindow.left,
-CurrentSibling->rcWindow.top);
IntGdiCombineRgn(ClipRgn, ClipRgn, SiblingClipRgn, RGN_AND);
REGION_bOffsetRgn(ClipRgn, CurrentSibling->rcWindow.left,
CurrentSibling->rcWindow.top);
- RGNOBJAPI_Unlock(SiblingClipRgn);
+ REGION_UnlockRgn(SiblingClipRgn);
}
}
IntGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
@@ -110,13 +110,13 @@
/* Combine it with the window region if available */
if (CurrentWindow->hrgnClip && !(CurrentWindow->style &
WS_MINIMIZE))
{
- PREGION CurrentRgnClip = RGNOBJAPI_Lock(CurrentWindow->hrgnClip,
NULL);
+ PREGION CurrentRgnClip = REGION_LockRgn(CurrentWindow->hrgnClip);
if (CurrentRgnClip)
{
REGION_bOffsetRgn(ClipRgn, -CurrentWindow->rcWindow.left,
-CurrentWindow->rcWindow.top);
IntGdiCombineRgn(ClipRgn, ClipRgn, CurrentRgnClip, RGN_AND);
REGION_bOffsetRgn(ClipRgn, CurrentWindow->rcWindow.left,
CurrentWindow->rcWindow.top);
- RGNOBJAPI_Unlock(CurrentRgnClip);
+ REGION_UnlockRgn(CurrentRgnClip);
}
}
IntGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
@@ -128,13 +128,13 @@
if (Wnd->hrgnClip && !(Wnd->style & WS_MINIMIZE))
{
- PREGION WndRgnClip = RGNOBJAPI_Lock(Wnd->hrgnClip, NULL);
+ PREGION WndRgnClip = REGION_LockRgn(Wnd->hrgnClip);
if (WndRgnClip)
{
REGION_bOffsetRgn(VisRgn, -Wnd->rcWindow.left, -Wnd->rcWindow.top);
IntGdiCombineRgn(VisRgn, VisRgn, WndRgnClip, RGN_AND);
REGION_bOffsetRgn(VisRgn, Wnd->rcWindow.left, Wnd->rcWindow.top);
- RGNOBJAPI_Unlock(WndRgnClip);
+ REGION_UnlockRgn(WndRgnClip);
}
}
Modified: trunk/reactos/win32ss/user/ntuser/winpos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/winpos…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/winpos.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/winpos.c [iso-8859-1] Fri Dec 19 10:34:52 2014
@@ -345,7 +345,7 @@
Fixes wine win.c:test_SetParent last ShowWindow test after popup dies.
Check for previous active window to bring to top.
*/
- if (Wnd)
+ if (Wnd)
{
WndTo = Wnd->head.pti->MessageQueue->spwndActivePrev;
if (can_activate_window( WndTo )) goto done;
@@ -1902,13 +1902,13 @@
/* No use in copying bits which are in the update region. */
if (Window->hrgnUpdate != NULL)
{
- PREGION RgnUpdate = RGNOBJAPI_Lock(Window->hrgnUpdate, NULL);
+ PREGION RgnUpdate = REGION_LockRgn(Window->hrgnUpdate);
if (RgnUpdate)
{
REGION_bOffsetRgn(CopyRgn, NewWindowRect.left, NewWindowRect.top);
IntGdiCombineRgn(CopyRgn, CopyRgn, RgnUpdate, RGN_DIFF);
REGION_bOffsetRgn(CopyRgn, -NewWindowRect.left, -NewWindowRect.top);
- RGNOBJAPI_Unlock(RgnUpdate);
+ REGION_UnlockRgn(RgnUpdate);
}
}
@@ -1927,7 +1927,7 @@
OldWindowRect.top != NewWindowRect.top)
{
HRGN DcRgn = NtGdiCreateRectRgn(0, 0, 0, 0);
- PREGION DcRgnObj = RGNOBJAPI_Lock(DcRgn, NULL);
+ PREGION DcRgnObj = REGION_LockRgn(DcRgn);
/*
* Small trick here: there is no function to bitblt a region. So
@@ -1940,7 +1940,7 @@
*/
IntGdiCombineRgn(DcRgnObj, CopyRgn, NULL, RGN_COPY);
REGION_bOffsetRgn(DcRgnObj, NewWindowRect.left, NewWindowRect.top);
- RGNOBJAPI_Unlock(DcRgnObj);
+ REGION_UnlockRgn(DcRgnObj);
Dc = UserGetDCEx( Window,
DcRgn,
DCX_WINDOW|DCX_CACHE|DCX_INTERSECTRGN|DCX_CLIPSIBLINGS|DCX_KEEPCLIPRGN);