don't pass NULL handles to NtGdiCombineRgn

svn path=/trunk/; revision=13640
This commit is contained in:
Thomas Bluemel 2005-02-19 11:13:41 +00:00
parent 5239de8ad5
commit 99f3640c17
2 changed files with 23 additions and 11 deletions

View file

@ -309,19 +309,20 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
-Window->WindowRect.top); -Window->WindowRect.top);
hRgnNonClient = NtGdiCreateRectRgn(0, 0, 0, 0); hRgnNonClient = NtGdiCreateRectRgn(0, 0, 0, 0);
GDIOBJ_SetOwnership(hRgnNonClient, NULL);
if (NtGdiCombineRgn(hRgnNonClient, Window->UpdateRegion, if (NtGdiCombineRgn(hRgnNonClient, Window->UpdateRegion,
hRgnWindow, RGN_DIFF) == NULLREGION) hRgnWindow, RGN_DIFF) == NULLREGION)
{ {
GDIOBJ_SetOwnership(hRgnNonClient, PsGetCurrentProcess());
NtGdiDeleteObject(hRgnNonClient); NtGdiDeleteObject(hRgnNonClient);
hRgnNonClient = NULL; hRgnNonClient = NULL;
} }
else
{
GDIOBJ_SetOwnership(hRgnNonClient, NULL);
}
/* /*
* Remove the nonclient region from the standard update region. * Remove the nonclient region from the standard update region.
*/ */
if (NtGdiCombineRgn(Window->UpdateRegion, Window->UpdateRegion, if (NtGdiCombineRgn(Window->UpdateRegion, Window->UpdateRegion,
hRgnWindow, RGN_AND) == NULLREGION) hRgnWindow, RGN_AND) == NULLREGION)
{ {
@ -335,11 +336,11 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
Window->NCUpdateRegion = hRgnNonClient; Window->NCUpdateRegion = hRgnNonClient;
} }
else else
{
if(NULL != hRgnNonClient)
{ {
NtGdiCombineRgn(Window->NCUpdateRegion, Window->NCUpdateRegion, NtGdiCombineRgn(Window->NCUpdateRegion, Window->NCUpdateRegion,
hRgnNonClient, RGN_OR); hRgnNonClient, RGN_OR);
if (NULL != hRgnNonClient)
{
GDIOBJ_SetOwnership(hRgnNonClient, PsGetCurrentProcess()); GDIOBJ_SetOwnership(hRgnNonClient, PsGetCurrentProcess());
NtGdiDeleteObject(hRgnNonClient); NtGdiDeleteObject(hRgnNonClient);
} }

View file

@ -213,7 +213,7 @@ DceDeleteClipRgn(DCE* Dce)
{ {
Dce->DCXFlags &= ~DCX_KEEPCLIPRGN; Dce->DCXFlags &= ~DCX_KEEPCLIPRGN;
} }
else if (Dce->hClipRgn > (HRGN) 1) else if (Dce->hClipRgn != NULL)
{ {
GDIOBJ_SetOwnership(Dce->hClipRgn, PsGetCurrentProcess()); GDIOBJ_SetOwnership(Dce->hClipRgn, PsGetCurrentProcess());
NtGdiDeleteObject(Dce->hClipRgn); NtGdiDeleteObject(Dce->hClipRgn);
@ -331,11 +331,22 @@ DceUpdateVisRgn(DCE *Dce, PWINDOW_OBJECT Window, ULONG Flags)
noparent: noparent:
if (Flags & DCX_INTERSECTRGN) if (Flags & DCX_INTERSECTRGN)
{
if(Dce->hClipRgn != NULL)
{ {
NtGdiCombineRgn(hRgnVisible, hRgnVisible, Dce->hClipRgn, RGN_AND); NtGdiCombineRgn(hRgnVisible, hRgnVisible, Dce->hClipRgn, RGN_AND);
} }
else
{
if(hRgnVisible != NULL)
{
NtGdiDeleteObject(hRgnVisible);
}
hRgnVisible = NtGdiCreateRectRgn(0, 0, 0, 0);
}
}
if (Flags & DCX_EXCLUDERGN) if (Flags & DCX_EXCLUDERGN && Dce->hClipRgn != NULL)
{ {
NtGdiCombineRgn(hRgnVisible, hRgnVisible, Dce->hClipRgn, RGN_DIFF); NtGdiCombineRgn(hRgnVisible, hRgnVisible, Dce->hClipRgn, RGN_DIFF);
} }