- Reference CursorIcon before deleting it

- IntGetPaintMessage: Set MessageQueue->PaintCount to 0, if no dirty Window is found. Stops spamming the debuglog, once is enough.
- UserGetDCEx: Check if a dce's hDC is valid, if not warn and create a new one. With our current code those hDCs should never get deleted, but this is also a hack, on Windows you can delete them.
- Don't dump the stack backtrace twice in GDIOBJ_Xxx functions

svn path=/trunk/; revision=32473
This commit is contained in:
Timo Kreuzer 2008-02-25 01:32:17 +00:00
parent 390717a188
commit 16956db4f1
4 changed files with 22 additions and 16 deletions

View file

@ -523,7 +523,7 @@ IntCleanupCurIcons(struct _EPROCESS *Process, PW32PROCESS Win32Process)
LIST_FOR_EACH_SAFE(CurIcon, tmp, &gCurIconList, CURICON_OBJECT, ListEntry) LIST_FOR_EACH_SAFE(CurIcon, tmp, &gCurIconList, CURICON_OBJECT, ListEntry)
{ {
// UserReferenceObject(CurIcon); UserReferenceObject(CurIcon);
// if(NT_SUCCESS(UserReferenceObjectByPointer(Object, otCursorIcon))) // if(NT_SUCCESS(UserReferenceObjectByPointer(Object, otCursorIcon)))
{ {
LIST_FOR_EACH(ProcessData, &CurIcon->ProcessList, CURICON_PROCESS, ListEntry) LIST_FOR_EACH(ProcessData, &CurIcon->ProcessList, CURICON_PROCESS, ListEntry)
@ -532,6 +532,7 @@ IntCleanupCurIcons(struct _EPROCESS *Process, PW32PROCESS Win32Process)
{ {
RemoveEntryList(&CurIcon->ListEntry); RemoveEntryList(&CurIcon->ListEntry);
IntDestroyCurIconObject(WinSta, CurIcon, TRUE); IntDestroyCurIconObject(WinSta, CurIcon, TRUE);
CurIcon = NULL;
break; break;
} }
} }
@ -539,7 +540,10 @@ IntCleanupCurIcons(struct _EPROCESS *Process, PW32PROCESS Win32Process)
// UserDereferenceObject(Object); // UserDereferenceObject(Object);
} }
if (CurIcon)
{
UserDereferenceObject(CurIcon);
}
} }
ObDereferenceObject(WinSta); ObDereferenceObject(WinSta);

View file

@ -696,6 +696,8 @@ IntGetPaintMessage(HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax,
if (Message->hwnd == NULL) if (Message->hwnd == NULL)
{ {
DPRINT1("PAINTING BUG: Thread marked as containing dirty windows, but no dirty windows found!\n"); DPRINT1("PAINTING BUG: Thread marked as containing dirty windows, but no dirty windows found!\n");
/* Hack to stop spamming the debuglog ! */
MessageQueue->PaintCount = 0;
return FALSE; return FALSE;
} }

View file

@ -506,6 +506,13 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
return(NULL); return(NULL);
} }
if (!GDIOBJ_ValidateHandle(Dce->hDC, GDI_OBJECT_TYPE_DC))
{
DPRINT1("FIXME: Got DCE with invalid hDC!\n");
Dce->hDC = DceCreateDisplayDC();
/* FIXME: Handle error */
}
Dce->hwndCurrent = (Window ? Window->hSelf : NULL); Dce->hwndCurrent = (Window ? Window->hSelf : NULL);
Dce->DCXFlags = Flags | DCX_DCEBUSY; Dce->DCXFlags = Flags | DCX_DCEBUSY;
@ -597,7 +604,7 @@ DceFreeDCE(PDCE pdce, BOOLEAN Force)
} }
if (!Hit) IntGdiDeleteDC(pdce->hDC, TRUE); if (!Hit) IntGdiDeleteDC(pdce->hDC, TRUE);
if (pdce->hClipRgn && ! (pdce->DCXFlags & DCX_KEEPCLIPRGN)) if (pdce->hClipRgn && ! (pdce->DCXFlags & DCX_KEEPCLIPRGN))
{ {
NtGdiDeleteObject(pdce->hClipRgn); NtGdiDeleteObject(pdce->hClipRgn);
@ -762,7 +769,7 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window)
} while (pDCE != FirstDce); } while (pDCE != FirstDce);
} }
HDC HDC
FASTCALL FASTCALL
IntGetDC(PWINDOW_OBJECT Window) IntGetDC(PWINDOW_OBJECT Window)
{ {
@ -811,7 +818,7 @@ UserReleaseDC(PWINDOW_OBJECT Window, HDC hDc, BOOL EndPaint)
KeEnterCriticalRegion(); KeEnterCriticalRegion();
do do
{ {
if (dce->hDC == hDc) if (dce->hDC == hDc)
{ {
Hit = TRUE; Hit = TRUE;
break; break;
@ -821,7 +828,7 @@ UserReleaseDC(PWINDOW_OBJECT Window, HDC hDc, BOOL EndPaint)
} }
while (dce != FirstDce ); while (dce != FirstDce );
KeLeaveCriticalRegion(); KeLeaveCriticalRegion();
if ( Hit && (dce->DCXFlags & DCX_DCEBUSY)) if ( Hit && (dce->DCXFlags & DCX_DCEBUSY))
{ {
nRet = DceReleaseDC(dce, EndPaint); nRet = DceReleaseDC(dce, EndPaint);

View file

@ -330,7 +330,10 @@ LockErrorDebugOutput(HGDIOBJ hObj, PGDI_TABLE_ENTRY Entry, LPSTR Function)
DPRINT1("%s: Attempted to lock object 0x%x, something went wrong, typeinfo = 0x%x\n", DPRINT1("%s: Attempted to lock object 0x%x, something went wrong, typeinfo = 0x%x\n",
Function, hObj, Entry->Type); Function, hObj, Entry->Type);
} }
#ifdef GDI_DEBUG
DPRINT1("-> called from:\n");
KeRosDumpStackFrames(NULL, 20); KeRosDumpStackFrames(NULL, 20);
#endif
} }
ULONG ULONG
@ -952,11 +955,6 @@ GDIOBJ_LockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD ExpectedType)
* locking type mismatches. * locking type mismatches.
*/ */
LockErrorDebugOutput(hObj, Entry, "GDIOBJ_LockObj"); LockErrorDebugOutput(hObj, Entry, "GDIOBJ_LockObj");
#ifdef GDI_DEBUG
DPRINT1("-> called from:\n");
KeRosDumpStackFrames(NULL, 20);
#endif
} }
/* Unlock the handle table entry. */ /* Unlock the handle table entry. */
@ -1081,11 +1079,6 @@ GDIOBJ_ShareLockObj (PGDI_HANDLE_TABLE HandleTable, HGDIOBJ hObj, DWORD Expected
* locking type mismatches. * locking type mismatches.
*/ */
LockErrorDebugOutput(hObj, Entry, "GDIOBJ_ShareLockObj"); LockErrorDebugOutput(hObj, Entry, "GDIOBJ_ShareLockObj");
#ifdef GDI_DEBUG
DPRINT1("-> called from:\n");
KeRosDumpStackFrames(NULL, 20);
#endif
} }
/* Unlock the handle table entry. */ /* Unlock the handle table entry. */