mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
[WIN32K]
- Improve parameter checking in NtGdiExtSelectClipRgn - Update the DC clipping regions before getting the clipbox svn path=/trunk/; revision=63735
This commit is contained in:
parent
dca53f8c00
commit
f3b4339291
1 changed files with 21 additions and 12 deletions
|
@ -44,9 +44,9 @@ IntGdiExtSelectClipRgn(
|
|||
PREGION prgn,
|
||||
int fnMode)
|
||||
{
|
||||
if (!prgn)
|
||||
if (fnMode == RGN_COPY)
|
||||
{
|
||||
if (fnMode == RGN_COPY)
|
||||
if (!prgn)
|
||||
{
|
||||
if (dc->dclevel.prgnClip != NULL)
|
||||
{
|
||||
|
@ -56,13 +56,15 @@ IntGdiExtSelectClipRgn(
|
|||
}
|
||||
return SIMPLEREGION;
|
||||
}
|
||||
else
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_PARAMETER);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
if (!dc->dclevel.prgnClip)
|
||||
dc->dclevel.prgnClip = IntSysCreateRectpRgn(0, 0, 0, 0);
|
||||
|
||||
return IntGdiCombineRgn(dc->dclevel.prgnClip, prgn, NULL, RGN_COPY);
|
||||
}
|
||||
|
||||
ASSERT(prgn != NULL);
|
||||
|
||||
if (!dc->dclevel.prgnClip)
|
||||
{
|
||||
RECTL rect;
|
||||
|
@ -73,9 +75,6 @@ IntGdiExtSelectClipRgn(
|
|||
|
||||
dc->fs |= DC_FLAG_DIRTY_RAO;
|
||||
|
||||
if(fnMode == RGN_COPY)
|
||||
return IntGdiCombineRgn(dc->dclevel.prgnClip, prgn, 0, fnMode);
|
||||
|
||||
return IntGdiCombineRgn(dc->dclevel.prgnClip, dc->dclevel.prgnClip, prgn, fnMode);
|
||||
}
|
||||
|
||||
|
@ -99,8 +98,15 @@ NtGdiExtSelectClipRgn(
|
|||
|
||||
prgn = REGION_LockRgn(hrgn);
|
||||
|
||||
/* IntGdiExtSelectClipRgn takes care of checking for NULL region */
|
||||
retval = IntGdiExtSelectClipRgn(dc, prgn, fnMode);
|
||||
if ((prgn == NULL) && (fnMode != RGN_COPY))
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
retval = ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
retval = IntGdiExtSelectClipRgn(dc, prgn, fnMode);
|
||||
}
|
||||
|
||||
if (prgn)
|
||||
REGION_UnlockRgn(prgn);
|
||||
|
@ -121,6 +127,9 @@ GdiGetClipBox(HDC hDC, PRECTL rc)
|
|||
return ERROR;
|
||||
}
|
||||
|
||||
if (dc->fs & DC_FLAG_DIRTY_RAO)
|
||||
CLIPPING_UpdateGCRegion(dc);
|
||||
|
||||
/* FIXME: Rao and Vis only! */
|
||||
if (dc->prgnAPI) // APIRGN
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue