mirror of
https://github.com/reactos/reactos.git
synced 2025-07-24 16:53:45 +00:00
* Create a branch for USB experiments.
svn path=/branches/usb-experiments/; revision=72629
This commit is contained in:
parent
28d8ba0d3e
commit
0ee830d7a4
23049 changed files with 0 additions and 1313991 deletions
146
win32ss/gdi/ntgdi/gdidebug.h
Normal file
146
win32ss/gdi/ntgdi/gdidebug.h
Normal file
|
@ -0,0 +1,146 @@
|
|||
#pragma once
|
||||
|
||||
#define GDI_DBG_MAX_BTS 10
|
||||
|
||||
#if DBG && defined(KDBG)
|
||||
#define ASSERT_NOGDILOCKS() GdiDbgAssertNoLocks(__FILE__,__LINE__)
|
||||
#define KeRosDumpStackFrames(Frames, Count) \
|
||||
KdSystemDebugControl('DsoR', (PVOID)Frames, Count, NULL, 0, NULL, KernelMode)
|
||||
#else
|
||||
#define ASSERT_NOGDILOCKS()
|
||||
#define KeRosDumpStackFrames(Frames, Count)
|
||||
#endif
|
||||
|
||||
ULONG
|
||||
NTAPI
|
||||
DbgCaptureStackBackTace(
|
||||
_Out_writes_(cFramesToCapture) PVOID* ppvFrames,
|
||||
_In_ ULONG cFramesToSkip,
|
||||
_In_ ULONG cFramesToCapture);
|
||||
|
||||
BOOL
|
||||
NTAPI
|
||||
DbgGdiHTIntegrityCheck(
|
||||
VOID);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
DbgDumpLockedGdiHandles(
|
||||
VOID);
|
||||
|
||||
#if DBG_ENABLE_GDIOBJ_BACKTRACES
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
DbgDumpGdiHandleTableWithBT(VOID);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(KDBG)
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
DbgGdiKdbgCliCallback(
|
||||
_In_ PCHAR Command,
|
||||
_In_ ULONG Argc,
|
||||
_In_ PCH Argv[]);
|
||||
|
||||
#endif
|
||||
|
||||
#if DBG_ENABLE_EVENT_LOGGING
|
||||
|
||||
typedef enum _LOG_EVENT_TYPE
|
||||
{
|
||||
EVENT_ALLOCATE,
|
||||
EVENT_CREATE_HANDLE,
|
||||
EVENT_REFERENCE,
|
||||
EVENT_DEREFERENCE,
|
||||
EVENT_LOCK,
|
||||
EVENT_UNLOCK,
|
||||
EVENT_DELETE,
|
||||
EVENT_FREE,
|
||||
EVENT_SET_OWNER,
|
||||
} LOG_EVENT_TYPE;
|
||||
|
||||
typedef struct _LOGENTRY
|
||||
{
|
||||
SLIST_ENTRY sleLink;
|
||||
LOG_EVENT_TYPE nEventType;
|
||||
DWORD dwProcessId;
|
||||
DWORD dwThreadId;
|
||||
ULONG ulUnique;
|
||||
LPARAM lParam;
|
||||
PVOID apvBackTrace[20];
|
||||
union
|
||||
{
|
||||
ULONG_PTR data1;
|
||||
} data;
|
||||
} LOGENTRY, *PLOGENTRY;
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
DbgDumpEventList(
|
||||
_Inout_ PSLIST_HEADER pslh);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
DbgLogEvent(
|
||||
_Inout_ PSLIST_HEADER pslh,
|
||||
_In_ LOG_EVENT_TYPE nEventType,
|
||||
_In_ LPARAM lParam);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
DbgCleanupEventList(
|
||||
_Inout_ PSLIST_HEADER pslh);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
DbgPrintEvent(
|
||||
_Inout_ PLOGENTRY pLogEntry);
|
||||
|
||||
#define DBG_LOGEVENT(pslh, type, val) DbgLogEvent(pslh, type, (ULONG_PTR)val)
|
||||
#define DBG_INITLOG(pslh) InitializeSListHead(pslh)
|
||||
#define DBG_DUMP_EVENT_LIST(pslh) DbgDumpEventList(pslh)
|
||||
#define DBG_CLEANUP_EVENT_LIST(pslh) DbgCleanupEventList(pslh)
|
||||
|
||||
#else
|
||||
|
||||
#define DBG_LOGEVENT(pslh, type, val) ((void)(val))
|
||||
#define DBG_INITLOG(pslh)
|
||||
#define DBG_DUMP_EVENT_LIST(pslh)
|
||||
#define DBG_CLEANUP_EVENT_LIST(pslh)
|
||||
|
||||
#endif
|
||||
|
||||
#if DBG
|
||||
void
|
||||
NTAPI
|
||||
GdiDbgPreServiceHook(ULONG ulSyscallId, PULONG_PTR pulArguments);
|
||||
|
||||
ULONG_PTR
|
||||
NTAPI
|
||||
GdiDbgPostServiceHook(ULONG ulSyscallId, ULONG_PTR ulResult);
|
||||
|
||||
#define ID_Win32PreServiceHook 'WSH0'
|
||||
#define ID_Win32PostServiceHook 'WSH1'
|
||||
|
||||
#ifndef __cplusplus
|
||||
FORCEINLINE void
|
||||
GdiDbgAssertNoLocks(char * pszFile, ULONG nLine)
|
||||
{
|
||||
PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread();
|
||||
if (pti && pti->cExclusiveLocks != 0)
|
||||
{
|
||||
ULONG i;
|
||||
DbgPrint("(%s:%lu) There are %lu exclusive locks!\n",
|
||||
pszFile, nLine, pti->cExclusiveLocks);
|
||||
for (i = 0; i < (GDIObjTypeTotal + 1); i++)
|
||||
DbgPrint(" Type %u: %u.\n", i, pti->acExclusiveLockCount[i]);
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
}
|
||||
#endif // __cplusplus
|
||||
#endif
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue