mirror of
https://github.com/reactos/reactos.git
synced 2025-06-26 12:49:42 +00:00
[WIN32K]
Add A function to dump all locked handles and call it when an assertion about 0 locks fails. svn path=/trunk/; revision=50969
This commit is contained in:
parent
85f0fb63f3
commit
a528924f3b
2 changed files with 29 additions and 2 deletions
|
@ -20,6 +20,7 @@ enum _DEBUGCHANNELS
|
||||||
void IntDumpHandleTable(PGDI_HANDLE_TABLE HandleTable);
|
void IntDumpHandleTable(PGDI_HANDLE_TABLE HandleTable);
|
||||||
ULONG CaptureStackBackTace(PVOID* pFrames, ULONG nFramesToCapture);
|
ULONG CaptureStackBackTace(PVOID* pFrames, ULONG nFramesToCapture);
|
||||||
BOOL GdiDbgHTIntegrityCheck();
|
BOOL GdiDbgHTIntegrityCheck();
|
||||||
|
void GdiDbgDumpLockedHandles();
|
||||||
|
|
||||||
#define DBGENABLE(ch) gulDebugChannels |= (ch);
|
#define DBGENABLE(ch) gulDebugChannels |= (ch);
|
||||||
#define DBGDISABLE(ch) gulDebugChannels &= ~(ch);
|
#define DBGDISABLE(ch) gulDebugChannels &= ~(ch);
|
||||||
|
@ -96,17 +97,19 @@ DbgPostServiceHook(ULONG ulSyscallId, ULONG_PTR ulResult);
|
||||||
#define ID_Win32PostServiceHook 'WSH1'
|
#define ID_Win32PostServiceHook 'WSH1'
|
||||||
|
|
||||||
FORCEINLINE void
|
FORCEINLINE void
|
||||||
DbgAssertNoGdiLocks(char * pszFile, ULONG nLine)
|
GdiDbgAssertNoLocks(char * pszFile, ULONG nLine)
|
||||||
{
|
{
|
||||||
PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread();
|
PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread();
|
||||||
if (pti && pti->cExclusiveLocks != 0)
|
if (pti && pti->cExclusiveLocks != 0)
|
||||||
{
|
{
|
||||||
DbgPrint("(%s:%ld) There are %ld exclusive locks!\n",
|
DbgPrint("(%s:%ld) There are %ld exclusive locks!\n",
|
||||||
pszFile, nLine, pti->cExclusiveLocks);
|
pszFile, nLine, pti->cExclusiveLocks);
|
||||||
|
GdiDbgDumpLockedHandles();
|
||||||
ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#define ASSERT_NOGDILOCKS() DbgAssertNoGdiLocks(__FILE__,__LINE__)
|
|
||||||
|
#define ASSERT_NOGDILOCKS() GdiDbgAssertNoLocks(__FILE__,__LINE__)
|
||||||
#else
|
#else
|
||||||
#define ASSERT_NOGDILOCKS()
|
#define ASSERT_NOGDILOCKS()
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -292,6 +292,30 @@ GDIOBJ_IncrementShareCount(POBJ Object)
|
||||||
|
|
||||||
#endif /* GDI_DEBUG */
|
#endif /* GDI_DEBUG */
|
||||||
|
|
||||||
|
void
|
||||||
|
GdiDbgDumpLockedHandles()
|
||||||
|
{
|
||||||
|
ULONG i;
|
||||||
|
|
||||||
|
for (i = RESERVE_ENTRIES_COUNT; i < GDI_HANDLE_COUNT; i++)
|
||||||
|
{
|
||||||
|
PGDI_TABLE_ENTRY pEntry = &GdiHandleTable->Entries[i];
|
||||||
|
|
||||||
|
if (pEntry->Type & GDI_ENTRY_BASETYPE_MASK)
|
||||||
|
{
|
||||||
|
BASEOBJECT *pObject = pEntry->KernelData;
|
||||||
|
if (pObject->cExclusiveLock > 0)
|
||||||
|
{
|
||||||
|
DPRINT1("Locked object: %lx, type = %lx. allocated from:\n",
|
||||||
|
i, pEntry->Type);
|
||||||
|
GDIDBG_TRACEALLOCATOR(i);
|
||||||
|
DPRINT1("Locked from:\n");
|
||||||
|
GDIDBG_TRACELOCKER(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NTAPI
|
NTAPI
|
||||||
DbgPreServiceHook(ULONG ulSyscallId, PULONG_PTR pulArguments)
|
DbgPreServiceHook(ULONG ulSyscallId, PULONG_PTR pulArguments)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue