mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 02:32:03 +00:00
- simplify a check
- fix a check - fix a region leak - don't abuse GDIOBJ_LockObj to validate a handle, use GDIOBJ_ValidateHandle instead - add some additional debug output svn path=/trunk/; revision=32110
This commit is contained in:
parent
faf0212f7b
commit
edff92650c
2 changed files with 11 additions and 5 deletions
|
@ -485,7 +485,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Dce = Window->Dce;
|
Dce = Window->Dce;
|
||||||
if (NULL != Dce && Dce->hwndCurrent == (Window ? Window->hSelf : NULL))
|
if (Dce->hwndCurrent == Window->hSelf)
|
||||||
{
|
{
|
||||||
UpdateVisRgn = FALSE; /* updated automatically, via DCHook() */
|
UpdateVisRgn = FALSE; /* updated automatically, via DCHook() */
|
||||||
}
|
}
|
||||||
|
@ -511,7 +511,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
|
||||||
|
|
||||||
if (0 == (Flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) && NULL != ClipRegion)
|
if (0 == (Flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) && NULL != ClipRegion)
|
||||||
{
|
{
|
||||||
if (Flags & DCX_KEEPCLIPRGN)
|
if (!(Flags & DCX_KEEPCLIPRGN))
|
||||||
NtGdiDeleteObject(ClipRegion);
|
NtGdiDeleteObject(ClipRegion);
|
||||||
ClipRegion = NULL;
|
ClipRegion = NULL;
|
||||||
}
|
}
|
||||||
|
@ -520,7 +520,6 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
|
||||||
if (NULL != Dce->hClipRgn)
|
if (NULL != Dce->hClipRgn)
|
||||||
{
|
{
|
||||||
DceDeleteClipRgn(Dce);
|
DceDeleteClipRgn(Dce);
|
||||||
Dce->hClipRgn = NULL;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -541,6 +540,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
|
||||||
{
|
{
|
||||||
Dce->hClipRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->WindowRect);
|
Dce->hClipRgn = UnsafeIntCreateRectRgnIndirect(&Window->Wnd->WindowRect);
|
||||||
}
|
}
|
||||||
|
Dce->DCXFlags &= ~DCX_KEEPCLIPRGN;
|
||||||
}
|
}
|
||||||
else if (ClipRegion != NULL)
|
else if (ClipRegion != NULL)
|
||||||
{
|
{
|
||||||
|
@ -715,8 +715,8 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dc = DC_LockDc(pDCE->hDC);
|
if (!GDIOBJ_ValidateHandle(pDCE->hDC, GDI_OBJECT_TYPE_DC) ||
|
||||||
if (dc == NULL)
|
(dc = DC_LockDc(pDCE->hDC)) == NULL)
|
||||||
{
|
{
|
||||||
pDCE = (PDCE) pDCE->List.Flink;
|
pDCE = (PDCE) pDCE->List.Flink;
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -857,6 +857,12 @@ GDIOBJ_LockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ExpectedType)
|
||||||
/* Check for invalid owner. */
|
/* Check for invalid owner. */
|
||||||
if (ProcessId != HandleProcessId && HandleProcessId != NULL)
|
if (ProcessId != HandleProcessId && HandleProcessId != NULL)
|
||||||
{
|
{
|
||||||
|
DPRINT1("Tried to lock object (0x%p) of wrong owner! ProcessId = %p, HandleProcessId = %p\n", hObj, ProcessId, HandleProcessId);
|
||||||
|
#ifdef GDI_DEBUG
|
||||||
|
KeRosDumpStackFrames(NULL, 20);
|
||||||
|
// DPRINT1("Handle allocator:\n");
|
||||||
|
// KeRosDumpStackFrames(GDIHandleAllocator[GDI_HANDLE_GET_INDEX(hObj)], GDI_STACK_LEVELS);
|
||||||
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue