VisBefore = VIS_ComputeVisibleRegion(Window, FALSE, FALSE, TRUE);
VisRgn = NULL;
- if (VisBefore != NULL && (VisRgn = (PROSRGNDATA)REGION_LockRgn(VisBefore)) &&
+ if (VisBefore != NULL && (VisRgn = (PROSRGNDATA)RGNOBJAPI_Lock(VisBefore, NULL)) &&
REGION_GetRgnBox(VisRgn, &TempRect) == NULLREGION)
{
- REGION_UnlockRgn(VisRgn);
+ RGNOBJAPI_Unlock(VisRgn);
GreDeleteObject(VisBefore);
VisBefore = NULL;
}
else if(VisRgn)
{
- REGION_UnlockRgn(VisRgn);
+ RGNOBJAPI_Unlock(VisRgn);
NtGdiOffsetRgn(VisBefore, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
}
}
VisAfter = VIS_ComputeVisibleRegion(Window, FALSE, FALSE, TRUE);
VisRgn = NULL;
- if (VisAfter != NULL && (VisRgn = (PROSRGNDATA)REGION_LockRgn(VisAfter)) &&
+ if (VisAfter != NULL && (VisRgn = (PROSRGNDATA)RGNOBJAPI_Lock(VisAfter, NULL)) &&
REGION_GetRgnBox(VisRgn, &TempRect) == NULLREGION)
{
- REGION_UnlockRgn(VisRgn);
+ RGNOBJAPI_Unlock(VisRgn);
GreDeleteObject(VisAfter);
VisAfter = NULL;
}
else if(VisRgn)
{
- REGION_UnlockRgn(VisRgn);
+ RGNOBJAPI_Unlock(VisRgn);
NtGdiOffsetRgn(VisAfter, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
}
RECTL_vOffsetRect(&ORect, - OldWindowRect.left, - OldWindowRect.top);
RECTL_vOffsetRect(&NRect, - NewWindowRect.left, - NewWindowRect.top);
RECTL_bIntersectRect(&CopyRect, &ORect, &NRect);
- pCopyRgn = REGION_LockRgn(CopyRgn);
+ pCopyRgn = RGNOBJAPI_Lock(CopyRgn, NULL);
REGION_CropAndOffsetRegion(pCopyRgn, pCopyRgn, &CopyRect, NULL);
- REGION_UnlockRgn(pCopyRgn);
+ RGNOBJAPI_Unlock(pCopyRgn);
}
/* No use in copying bits which are in the update region. */
* there's nothing to copy. Also, it's no use copying bits onto
* themselves.
*/
- if ((VisRgn = (PROSRGNDATA)REGION_LockRgn(CopyRgn)) &&
+ if ((VisRgn = (PROSRGNDATA)RGNOBJAPI_Lock(CopyRgn, NULL)) &&
REGION_GetRgnBox(VisRgn, &CopyRect) == NULLREGION)
{
/* Nothing to copy, clean up */
- REGION_UnlockRgn(VisRgn);
+ RGNOBJAPI_Unlock(VisRgn);
GreDeleteObject(CopyRgn);
CopyRgn = NULL;
}
{
if(VisRgn)
{
- REGION_UnlockRgn(VisRgn);
+ RGNOBJAPI_Unlock(VisRgn);
}
/*
}
else if(VisRgn)
{
- REGION_UnlockRgn(VisRgn);
+ RGNOBJAPI_Unlock(VisRgn);
}
}
else
{
ROSRGNDATA *Data;
- Data = REGION_LockRgn(hRgn);
+ Data = RGNOBJAPI_Lock(hRgn, NULL);
if (Data == NULL)
{
DbgPrint("IntDumpRegion called with invalid region!\n");
Data->rdh.rcBound.bottom,
Data->rdh.iType);
- REGION_UnlockRgn(Data);
+ RGNOBJAPI_Unlock(Data);
}
#endif /* not NDEBUG */
trb = REGION_AllocRgnWithHandle(srb->rdh.nCount + 1);
if (!trb)
{
- REGION_UnlockRgn(tra);
+ RGNOBJAPI_Unlock(tra);
GreDeleteObject(htra);
return;
}
REGION_SubtractRegion(tra, sra, srb);
REGION_SubtractRegion(trb, srb, sra);
REGION_UnionRegion(dr, tra, trb);
- REGION_UnlockRgn(tra);
- REGION_UnlockRgn(trb);
+ RGNOBJAPI_Unlock(tra);
+ RGNOBJAPI_Unlock(trb);
GreDeleteObject(htra);
GreDeleteObject(htrb);
PRECTL rc;
ULONG i;
- if (!(srcObj = REGION_LockRgn(hSrc)))
+ if (!(srcObj = RGNOBJAPI_Lock(hSrc, NULL)))
{
return FALSE;
}
if (!REGION_NOT_EMPTY(srcObj))
{
- REGION_UnlockRgn(srcObj);
+ RGNOBJAPI_Unlock(srcObj);
return FALSE;
}
- if (!(destObj = REGION_LockRgn(hDest)))
+ if (!(destObj = RGNOBJAPI_Lock(hDest, NULL)))
{
- REGION_UnlockRgn(srcObj);
+ RGNOBJAPI_Unlock(srcObj);
return FALSE;
}
EMPTY_REGION(destObj);
if (!REGION_CopyRegion(destObj, srcObj))
{
- REGION_UnlockRgn(destObj);
- REGION_UnlockRgn(srcObj);
+ RGNOBJAPI_Unlock(destObj);
+ RGNOBJAPI_Unlock(srcObj);
return FALSE;
}
if (!REGION_CreateSimpleFrameRgn(destObj, x, y))
{
EMPTY_REGION(destObj);
- REGION_UnlockRgn(destObj);
- REGION_UnlockRgn(srcObj);
+ RGNOBJAPI_Unlock(destObj);
+ RGNOBJAPI_Unlock(srcObj);
return FALSE;
}
}
REGION_SubtractRegion(destObj, srcObj, destObj);
}
- REGION_UnlockRgn(destObj);
- REGION_UnlockRgn(srcObj);
+ RGNOBJAPI_Unlock(destObj);
+ RGNOBJAPI_Unlock(srcObj);
return TRUE;
}
goto done;
}
- if ( !(srcObj = REGION_LockRgn(hSrc)) )
+ if ( !(srcObj = RGNOBJAPI_Lock(hSrc, NULL)) )
goto done;
- if ( !(destObj = REGION_LockRgn(hDest)) )
+ if ( !(destObj = RGNOBJAPI_Lock(hDest, NULL)) )
{
- REGION_UnlockRgn(srcObj);
+ RGNOBJAPI_Unlock(srcObj);
goto done;
}
EMPTY_REGION(destObj);
}
ret = TRUE;
- REGION_UnlockRgn(srcObj);
- REGION_UnlockRgn(destObj);
+ RGNOBJAPI_Unlock(srcObj);
+ RGNOBJAPI_Unlock(destObj);
done:
return ret;
pReg->Buffer = ExAllocatePoolWithTag(PagedPool, nReg * sizeof(RECT), TAG_REGION);
if (!pReg->Buffer)
{
- REGION_UnlockRgn(pReg);
+ RGNOBJAPI_Unlock(pReg);
GDIOBJ_FreeObjByHandle(hReg, GDI_OBJECT_TYPE_REGION);
return NULL;
}
}
else if (src2Rgn == NULL)
{
- DPRINT1("IntGdiCombineRgn requires hSrc2 != NULL for combine mode %d!\n", CombineMode);
- SetLastWin32Error(ERROR_INVALID_HANDLE);
+ DPRINT1("IntGdiCombineRgn requires hSrc2 != NULL for combine mode %d!\n", CombineMode);
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
}
}
}
+ else
+ {
+ DPRINT("IntGdiCombineRgn: hSrc1 unavailable\n");
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
+ }
}
else
{
DPRINT("IntGdiCombineRgn: hDest unavailable\n");
SetLastWin32Error(ERROR_INVALID_HANDLE);
- result = ERROR;
}
return result;
}
return ERROR;
}
- destRgn = REGION_LockRgn(hDest);
+ destRgn = RGNOBJAPI_Lock(hDest, NULL);
if (!destRgn)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
return ERROR;
}
- src1Rgn = REGION_LockRgn(hSrc1);
+ src1Rgn = RGNOBJAPI_Lock(hSrc1, NULL);
if (!src1Rgn)
{
- REGION_UnlockRgn(destRgn);
+ RGNOBJAPI_Unlock(destRgn);
SetLastWin32Error(ERROR_INVALID_HANDLE);
return ERROR;
}
if (hSrc2)
- src2Rgn = REGION_LockRgn(hSrc2);
+ src2Rgn = RGNOBJAPI_Lock(hSrc2, NULL);
result = IntGdiCombineRgn( destRgn, src1Rgn, src2Rgn, CombineMode);
if (src2Rgn)
- REGION_UnlockRgn(src2Rgn);
- REGION_UnlockRgn(src1Rgn);
- REGION_UnlockRgn(destRgn);
+ RGNOBJAPI_Unlock(src2Rgn);
+ RGNOBJAPI_Unlock(src1Rgn);
+ RGNOBJAPI_Unlock(destRgn);
return result;
}
if (!(pRgn = REGION_AllocRgnWithHandle(1))) return NULL;
REGION_SetRectRgn(pRgn, LeftRect, TopRect, RightRect, BottomRect);
- REGION_UnlockRgn(pRgn);
+ RGNOBJAPI_Unlock(pRgn);
// Return pointer with Share locks.
pRgn = GDIOBJ_ShareLockObj(pRgn->BaseObject.hHmgr, GDI_OBJECT_TYPE_REGION);
hRgn = pRgn->BaseObject.hHmgr;
REGION_SetRectRgn(pRgn, LeftRect, TopRect, RightRect, BottomRect);
- REGION_UnlockRgn(pRgn);
+ RGNOBJAPI_Unlock(pRgn);
return hRgn;
}
REGION_UnionRectWithRgn(obj, &rect);
}
- REGION_UnlockRgn(obj);
+ RGNOBJAPI_Unlock(obj);
return hrgn;
}
ULONG i;
BOOL bRet = FALSE;
- if ( !(rgn1 = REGION_LockRgn(hSrcRgn1)) )
+ if ( !(rgn1 = RGNOBJAPI_Lock(hSrcRgn1, NULL)) )
return ERROR;
- if ( !(rgn2 = REGION_LockRgn(hSrcRgn2)) )
+ if ( !(rgn2 = RGNOBJAPI_Lock(hSrcRgn2, NULL)) )
{
- REGION_UnlockRgn(rgn1);
+ RGNOBJAPI_Unlock(rgn1);
return ERROR;
}
bRet = TRUE;
exit:
- REGION_UnlockRgn(rgn1);
- REGION_UnlockRgn(rgn2);
+ RGNOBJAPI_Unlock(rgn1);
+ RGNOBJAPI_Unlock(rgn2);
return bRet;
}
if (!NT_SUCCESS(Status))
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
- REGION_UnlockRgn(Region);
+ RGNOBJAPI_Unlock(Region);
GreDeleteObject(hRgn);
return NULL;
}
- REGION_UnlockRgn(Region);
+ RGNOBJAPI_Unlock(Region);
return hRgn;
}
PROSRGNDATA rgn;
PRECTL r;
- if (NULL == (rgn = REGION_LockRgn(hRgn)))
+ if (NULL == (rgn = RGNOBJAPI_Lock(hRgn, NULL)))
{
return FALSE;
}
if (NULL == (oldhBrush = NtGdiSelectBrush(hDC, hBrush)))
{
- REGION_UnlockRgn(rgn);
+ RGNOBJAPI_Unlock(rgn);
return FALSE;
}
NtGdiPatBlt(hDC, r->left, r->top, r->right - r->left, r->bottom - r->top, PATCOPY);
}
- REGION_UnlockRgn(rgn);
+ RGNOBJAPI_Unlock(rgn);
NtGdiSelectBrush(hDC, oldhBrush);
return TRUE;
PROSRGNDATA Rgn;
DWORD ret;
- if (!(Rgn = REGION_LockRgn(hRgn)))
+ if (!(Rgn = RGNOBJAPI_Lock(hRgn, NULL)))
{
return ERROR;
}
ret = REGION_GetRgnBox(Rgn, pRect);
- REGION_UnlockRgn(Rgn);
+ RGNOBJAPI_Unlock(Rgn);
return ret;
}
DWORD ret;
NTSTATUS Status = STATUS_SUCCESS;
- if (!(Rgn = REGION_LockRgn(hRgn)))
+ if (!(Rgn = RGNOBJAPI_Lock(hRgn, NULL)))
{
return ERROR;
}
ret = REGION_GetRgnBox(Rgn, &SafeRect);
- REGION_UnlockRgn(Rgn);
+ RGNOBJAPI_Unlock(Rgn);
if (ERROR == ret)
{
return ret;
ULONG i;
PRECTL rc;
- if (!(RgnData = REGION_LockRgn(hRgn)))
+ if (!(RgnData = RGNOBJAPI_Lock(hRgn, NULL)))
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
if (!NtGdiPatBlt(hDC, rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top, DSTINVERT))
{
- REGION_UnlockRgn(RgnData);
+ RGNOBJAPI_Unlock(RgnData);
return FALSE;
}
rc++;
}
- REGION_UnlockRgn(RgnData);
+ RGNOBJAPI_Unlock(RgnData);
return TRUE;
}
INT YOffset
)
{
- PROSRGNDATA rgn = REGION_LockRgn(hRgn);
+ PROSRGNDATA rgn = RGNOBJAPI_Lock(hRgn, NULL);
INT ret;
DPRINT("NtGdiOffsetRgn: hRgn %d Xoffs %d Yoffs %d rgn %x\n", hRgn, XOffset, YOffset, rgn );
}
}
ret = REGION_Complexity(rgn);
- REGION_UnlockRgn(rgn);
+ RGNOBJAPI_Unlock(rgn);
return ret;
}
NtGdiCombineRgn(tmpVisRgn, tmpVisRgn, dc->rosdc.hGCClipRgn, RGN_AND);
- visrgn = REGION_LockRgn(tmpVisRgn);
+ visrgn = RGNOBJAPI_Lock(tmpVisRgn, NULL);
if (visrgn == NULL)
{
GreDeleteObject(tmpVisRgn);
&BrushOrigin,
0xFFFF);//FIXME:don't know what to put here
- REGION_UnlockRgn(visrgn);
+ RGNOBJAPI_Unlock(visrgn);
GreDeleteObject(tmpVisRgn);
// Fill the region
ULONG i;
PRECTL r;
- if (!(rgn = REGION_LockRgn(hRgn) ) )
+ if (!(rgn = RGNOBJAPI_Lock(hRgn, NULL) ) )
return FALSE;
if (rgn->rdh.nCount > 0 && INRECT(rgn->rdh.rcBound, X, Y))
{
if (INRECT(*r, X, Y))
{
- REGION_UnlockRgn(rgn);
+ RGNOBJAPI_Unlock(rgn);
return TRUE;
}
r++;
}
}
- REGION_UnlockRgn(rgn);
+ RGNOBJAPI_Unlock(rgn);
return FALSE;
}
BOOL Ret;
NTSTATUS Status = STATUS_SUCCESS;
- if (!(Rgn = REGION_LockRgn(hRgn)))
+ if (!(Rgn = RGNOBJAPI_Lock(hRgn, NULL)))
{
return ERROR;
}
if (!NT_SUCCESS(Status))
{
- REGION_UnlockRgn(Rgn);
+ RGNOBJAPI_Unlock(Rgn);
SetLastNtError(Status);
DPRINT1("NtGdiRectInRegion: bogus rc\n");
return ERROR;
}
Ret = REGION_RectInRegion(Rgn, &rc);
- REGION_UnlockRgn(Rgn);
+ RGNOBJAPI_Unlock(Rgn);
return Ret;
}
{
PROSRGNDATA rgn;
- if ( !(rgn = REGION_LockRgn(hRgn)) )
+ if ( !(rgn = RGNOBJAPI_Lock(hRgn, NULL)) )
{
return 0; //per documentation
}
REGION_SetRectRgn(rgn, LeftRect, TopRect, RightRect, BottomRect);
- REGION_UnlockRgn(rgn);
+ RGNOBJAPI_Unlock(rgn);
return TRUE;
}
PROSRGNDATA Rgn;
NTSTATUS Status = STATUS_SUCCESS;
- if (!(Rgn = REGION_LockRgn(hDest)))
+ if (!(Rgn = RGNOBJAPI_Lock(hDest, NULL)))
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
return NULL;
if (! NT_SUCCESS(Status))
{
- REGION_UnlockRgn(Rgn);
+ RGNOBJAPI_Unlock(Rgn);
SetLastNtError(Status);
return NULL;
}
REGION_UnionRectWithRgn(Rgn, &SafeRect);
- REGION_UnlockRgn(Rgn);
+ RGNOBJAPI_Unlock(Rgn);
return hDest;
}
)
{
DWORD size;
- PROSRGNDATA obj = REGION_LockRgn(hrgn);
+ PROSRGNDATA obj = RGNOBJAPI_Lock(hrgn, NULL);
NTSTATUS Status = STATUS_SUCCESS;
if (!obj)
size = obj->rdh.nCount * sizeof(RECT);
if (count < (size + sizeof(RGNDATAHEADER)) || rgndata == NULL)
{
- REGION_UnlockRgn(obj);
+ RGNOBJAPI_Unlock(obj);
if (rgndata) /* buffer is too small, signal it by return 0 */
return 0;
else /* user requested buffer size with rgndata NULL */
if (!NT_SUCCESS(Status))
{
SetLastNtError(Status);
- REGION_UnlockRgn(obj);
+ RGNOBJAPI_Unlock(obj);
return 0;
}
- REGION_UnlockRgn(obj);
+ RGNOBJAPI_Unlock(obj);
return size + sizeof(RGNDATAHEADER);
}
(Pts[2].x == Pts[3].x) &&
(Pts[3].y == Pts[0].y))))
{
- REGION_UnlockRgn(region);
+ RGNOBJAPI_Unlock(region);
NtGdiSetRectRgn(hrgn, min(Pts[0].x, Pts[2].x), min(Pts[0].y, Pts[2].y),
max(Pts[0].x, Pts[2].x), max(Pts[0].y, Pts[2].y));
return hrgn;
curPtBlock = tmpPtBlock;
}
ExFreePoolWithTag(pETEs, TAG_REGION);
- REGION_UnlockRgn(region);
+ RGNOBJAPI_Unlock(region);
return hrgn;
}