mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 15:51:49 +00:00
don't pass NULL handles to NtGdiCombineRgn
svn path=/trunk/; revision=13640
This commit is contained in:
parent
5239de8ad5
commit
99f3640c17
2 changed files with 23 additions and 11 deletions
|
@ -309,19 +309,20 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
|
|||
-Window->WindowRect.top);
|
||||
|
||||
hRgnNonClient = NtGdiCreateRectRgn(0, 0, 0, 0);
|
||||
GDIOBJ_SetOwnership(hRgnNonClient, NULL);
|
||||
if (NtGdiCombineRgn(hRgnNonClient, Window->UpdateRegion,
|
||||
hRgnWindow, RGN_DIFF) == NULLREGION)
|
||||
{
|
||||
GDIOBJ_SetOwnership(hRgnNonClient, PsGetCurrentProcess());
|
||||
NtGdiDeleteObject(hRgnNonClient);
|
||||
hRgnNonClient = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
GDIOBJ_SetOwnership(hRgnNonClient, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove the nonclient region from the standard update region.
|
||||
*/
|
||||
|
||||
if (NtGdiCombineRgn(Window->UpdateRegion, Window->UpdateRegion,
|
||||
hRgnWindow, RGN_AND) == NULLREGION)
|
||||
{
|
||||
|
@ -336,12 +337,12 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
|
|||
}
|
||||
else
|
||||
{
|
||||
NtGdiCombineRgn(Window->NCUpdateRegion, Window->NCUpdateRegion,
|
||||
hRgnNonClient, RGN_OR);
|
||||
if (NULL != hRgnNonClient)
|
||||
if(NULL != hRgnNonClient)
|
||||
{
|
||||
GDIOBJ_SetOwnership(hRgnNonClient, PsGetCurrentProcess());
|
||||
NtGdiDeleteObject(hRgnNonClient);
|
||||
NtGdiCombineRgn(Window->NCUpdateRegion, Window->NCUpdateRegion,
|
||||
hRgnNonClient, RGN_OR);
|
||||
GDIOBJ_SetOwnership(hRgnNonClient, PsGetCurrentProcess());
|
||||
NtGdiDeleteObject(hRgnNonClient);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -213,7 +213,7 @@ DceDeleteClipRgn(DCE* Dce)
|
|||
{
|
||||
Dce->DCXFlags &= ~DCX_KEEPCLIPRGN;
|
||||
}
|
||||
else if (Dce->hClipRgn > (HRGN) 1)
|
||||
else if (Dce->hClipRgn != NULL)
|
||||
{
|
||||
GDIOBJ_SetOwnership(Dce->hClipRgn, PsGetCurrentProcess());
|
||||
NtGdiDeleteObject(Dce->hClipRgn);
|
||||
|
@ -332,10 +332,21 @@ DceUpdateVisRgn(DCE *Dce, PWINDOW_OBJECT Window, ULONG Flags)
|
|||
noparent:
|
||||
if (Flags & DCX_INTERSECTRGN)
|
||||
{
|
||||
NtGdiCombineRgn(hRgnVisible, hRgnVisible, Dce->hClipRgn, RGN_AND);
|
||||
if(Dce->hClipRgn != NULL)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue