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.

svn path=/trunk/; revision=65746
This commit is contained in:
Timo Kreuzer 2014-12-19 10:34:52 +00:00
parent fc5dd61639
commit b2a9ab7151
8 changed files with 135 additions and 122 deletions

View file

@ -1130,7 +1130,7 @@ NtGdiFillRgn(
}
/* 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 @@ NtGdiFillRgn(
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 @@ NtGdiFillRgn(
/* Cleanup locks */
BRUSH_ShareUnlockBrush(pbrFill);
RGNOBJAPI_Unlock(prgn);
REGION_UnlockRgn(prgn);
DC_UnlockDc(pdc);
return bResult;
@ -1197,7 +1197,7 @@ NtGdiInvertRgn(
ULONG i;
PRECTL rc;
RgnData = RGNOBJAPI_Lock(hRgn, NULL);
RgnData = REGION_LockRgn(hRgn);
if (RgnData == NULL)
{
EngSetLastError(ERROR_INVALID_HANDLE);
@ -1210,13 +1210,13 @@ NtGdiInvertRgn(
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;
}

View file

@ -2723,7 +2723,7 @@ NtGdiPathToRegion(HDC hDC)
if (PATH_PathToRegion(pPath, pdcattr->jFillMode, Rgn))
{
PATH_EmptyPath(pPath);
RGNOBJAPI_Unlock(Rgn);
REGION_UnlockRgn(Rgn);
}
else
{

View file

@ -534,7 +534,7 @@ IntDumpRegion(HRGN hRgn)
{
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 @@ IntDumpRegion(HRGN hRgn)
Data->rdh.rcBound.bottom,
Data->rdh.iType);
RGNOBJAPI_Unlock(Data);
REGION_UnlockRgn(Data);
}
#endif /* Not NDEBUG */
@ -1768,7 +1768,7 @@ REGION_XorRegion(
trb = REGION_AllocRgnWithHandle(srb->rdh.nCount + 1);
if (trb == NULL)
{
RGNOBJAPI_Unlock(tra);
REGION_UnlockRgn(tra);
GreDeleteObject(htra);
return;
}
@ -1777,8 +1777,8 @@ REGION_XorRegion(
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 @@ GreCreateFrameRgn(
}
/* Lock the source region */
prgnSrc = RGNOBJAPI_Lock(hrgn, NULL);
prgnSrc = REGION_LockRgn(hrgn);
if (prgnSrc == NULL)
{
REGION_Delete(prgnFrame);
@ -2026,7 +2026,7 @@ GreCreateFrameRgn(
if (REGION_bMakeFrameRegion(prgnFrame, prgnSrc, cx, cy))
{
hrgnFrame = prgnFrame->BaseObject.hHmgr;
RGNOBJAPI_Unlock(prgnFrame);
REGION_UnlockRgn(prgnFrame);
}
else
{
@ -2034,7 +2034,7 @@ GreCreateFrameRgn(
hrgnFrame = NULL;
}
RGNOBJAPI_Unlock(prgnSrc);
REGION_UnlockRgn(prgnSrc);
return hrgnFrame;
}
@ -2319,28 +2319,23 @@ REGION_vSyncRegion(
PREGION
FASTCALL
RGNOBJAPI_Lock(
HRGN hRgn,
PRGN_ATTR *ppRgn_Attr)
REGION_LockRgn(
_In_ HRGN hrgn)
{
PREGION pRgn;
PREGION prgn;
pRgn = REGION_LockRgn(hRgn);
if (pRgn == NULL)
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 @@ RGNOBJAPI_Unlock(
prgnattr->AttrFlags |= ATTR_RGN_VALID;
}
REGION_UnlockRgn(prgn);
GDIOBJ_vUnlockObject(&prgn->BaseObject);
}
/*
@ -2431,12 +2426,13 @@ IntGdiSetRegionOwner(HRGN hRgn, DWORD OwnerMask)
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 @@ IntGdiSetRegionOwner(HRGN hRgn, DWORD OwnerMask)
GdiPoolFree(ppi->pPoolRgnAttr, prgnattr);
}
RGNOBJAPI_Unlock(prgn);
REGION_UnlockRgn(prgn);
return GreSetObjectOwner(hRgn, OwnerMask);
}
@ -2532,14 +2528,14 @@ IntGdiGetRgnBox(
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 @@ GreCreatePolyPolygonRgn(
{
/* Success, get the handle and unlock the region */
hrgn = prgn->BaseObject.hHmgr;
RGNOBJAPI_Unlock(prgn);
REGION_UnlockRgn(prgn);
}
else
{
@ -3455,14 +3451,14 @@ IntRectInRegion(
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 @@ NtGdiCombineRgn(
(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 @@ NtGdiCombineRgn(
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 @@ NtGdiCombineRgn(
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 @@ NtGdiCreateRectRgn(
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 @@ NtGdiCreateRoundRectRgn(
REGION_UnionRectWithRgn(obj, &rect);
}
RGNOBJAPI_Unlock(obj);
REGION_UnlockRgn(obj);
return hrgn;
}
@ -3702,24 +3698,47 @@ NtGdiEqualRgn(
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)
/* Check if we got 2 regions */
if ((hSrcRgn1 == NULL) || (hSrcRgn2 == NULL))
{
RGNOBJAPI_Unlock(rgn1);
return ERROR;
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 @@ NtGdiEqualRgn(
bRet = TRUE;
exit:
RGNOBJAPI_Unlock(rgn1);
RGNOBJAPI_Unlock(rgn2);
REGION_UnlockRgn(rgn1);
REGION_UnlockRgn(rgn2);
return bRet;
}
@ -3854,12 +3873,12 @@ NtGdiExtCreateRegion(
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 @@ NtGdiGetRgnBox(
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 @@ NtGdiOffsetRgn(
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 @@ NtGdiOffsetRgn(
ret = REGION_Complexity(rgn);
}
RGNOBJAPI_Unlock(rgn);
REGION_UnlockRgn(rgn);
return ret;
}
@ -3948,13 +3967,13 @@ NtGdiPtInRegion(
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 @@ NtGdiSetRectRgn(
{
PREGION rgn;
rgn = RGNOBJAPI_Lock(hRgn, NULL);
rgn = REGION_LockRgn(hRgn);
if (rgn == NULL)
{
return 0; // Per documentation
@ -4007,7 +4026,7 @@ NtGdiSetRectRgn(
REGION_SetRectRgn(rgn, LeftRect, TopRect, RightRect, BottomRect);
RGNOBJAPI_Unlock(rgn);
REGION_UnlockRgn(rgn);
return TRUE;
}
@ -4033,7 +4052,7 @@ NtGdiGetRegionData(
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 @@ NtGdiGetRegionData(
}
/* Unlock the region and return the size */
RGNOBJAPI_Unlock(prgn);
REGION_UnlockRgn(prgn);
return cjSize;
}

View file

@ -39,6 +39,16 @@ VOID NTAPI REGION_vCleanup(PVOID ObjectBody);
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 @@ BOOL FASTCALL IntRectInRegion(HRGN,LPRECTL);
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 @@ PREGION
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 );

View file

@ -314,15 +314,15 @@ co_IntPaintWindows(PWND Wnd, ULONG Flags, BOOL Recurse)
{
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 @@ IntInvalidateWindows(PWND Wnd, PREGION Rgn, ULONG Flags)
}
else
{
PREGION RgnClip = RGNOBJAPI_Lock(Wnd->hrgnClip, NULL);
PREGION RgnClip = REGION_LockRgn(Wnd->hrgnClip);
if (RgnClip)
{
REGION_bOffsetRgn(Rgn,
@ -467,7 +467,7 @@ IntInvalidateWindows(PWND Wnd, PREGION Rgn, ULONG Flags)
REGION_bOffsetRgn(Rgn,
Wnd->rcWindow.left,
Wnd->rcWindow.top);
RGNOBJAPI_Unlock(RgnClip);
REGION_UnlockRgn(RgnClip);
}
}
@ -514,11 +514,11 @@ IntInvalidateWindows(PWND Wnd, PREGION Rgn, ULONG Flags)
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 @@ IntInvalidateWindows(PWND Wnd, PREGION Rgn, ULONG Flags)
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 @@ co_UserGetUpdateRgn(PWND Window, PREGION Rgn, BOOL bErase)
return NULLREGION;
}
UpdateRgn = RGNOBJAPI_Lock(Window->hrgnUpdate, NULL);
UpdateRgn = REGION_LockRgn(Window->hrgnUpdate);
if (!UpdateRgn)
return ERROR;
@ -1230,7 +1230,7 @@ co_UserGetUpdateRgn(PWND Window, PREGION Rgn, BOOL bErase)
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 @@ NtUserGetUpdateRgn(HWND hWnd, HRGN hRgn, BOOL bErase)
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 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
}
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 @@ NtUserRedrawWindow(
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 @@ UserScrollDC(
if (hrgnUpdate)
{
NT_ASSERT(RgnUpdate == NULL);
RgnUpdate = RGNOBJAPI_Lock(hrgnUpdate, NULL);
RgnUpdate = REGION_LockRgn(hrgnUpdate);
if (!RgnUpdate)
{
DC_UnlockDc(pDC);
@ -1592,7 +1592,7 @@ UserScrollDC(
if (hrgnUpdate)
{
RGNOBJAPI_Unlock(RgnUpdate);
REGION_UnlockRgn(RgnUpdate);
}
else if (!RgnUpdate)
{
@ -1786,14 +1786,14 @@ NtUserScrollWindowEx(
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 @@ CLEANUP:
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)

View file

@ -169,8 +169,8 @@ NtUserCallOneParam(
if (count == 0) count = 8;
psmwp = (PSMWP) UserCreateObject( gHandleTable,
NULL,
NULL,
NULL,
NULL,
(PHANDLE)&hDwp,
TYPE_SETWINDOWPOS,
sizeof(SMWP));
@ -780,11 +780,11 @@ NtUserCallHwndParamLock(
{
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;
}

View file

@ -78,13 +78,13 @@ VIS_ComputeVisibleRegion(
/* 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 @@ VIS_ComputeVisibleRegion(
/* 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 @@ VIS_ComputeVisibleRegion(
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);
}
}

View file

@ -345,7 +345,7 @@ co_WinPosActivateOtherWindow(PWND Wnd)
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 @@ co_WinPosSetWindowPos(
/* 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 @@ co_WinPosSetWindowPos(
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 @@ co_WinPosSetWindowPos(
*/
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);