ReactOS 0.4.16-dev-320-g3bd9ddc
gdidebug.h
Go to the documentation of this file.
1#pragma once
2
3#define GDI_DBG_MAX_BTS 10
4
5#if DBG && defined(KDBG)
6#define ASSERT_NOGDILOCKS() GdiDbgAssertNoLocks(__FILE__,__LINE__)
7#define KeRosDumpStackFrames(Frames, Count) \
8 KdSystemDebugControl('DsoR', (PVOID)Frames, Count, NULL, 0, NULL, KernelMode)
9#else
10#define ASSERT_NOGDILOCKS()
11#define KeRosDumpStackFrames(Frames, Count)
12#endif
13
17 _Out_writes_(cFramesToCapture) PVOID* ppvFrames,
18 _In_ ULONG cFramesToSkip,
19 _In_ ULONG cFramesToCapture);
20
21BOOL
24 VOID);
25
26VOID
29 VOID);
30
31#if DBG_ENABLE_GDIOBJ_BACKTRACES
32
33VOID
35DbgDumpGdiHandleTableWithBT(VOID);
36
37#endif
38
39#if defined(KDBG)
40
45 _In_ ULONG Argc,
46 _In_ PCH Argv[]);
47
48#endif
49
50#if DBG_ENABLE_EVENT_LOGGING
51
52typedef enum _LOG_EVENT_TYPE
53{
54 EVENT_ALLOCATE,
55 EVENT_CREATE_HANDLE,
56 EVENT_REFERENCE,
57 EVENT_DEREFERENCE,
58 EVENT_LOCK,
59 EVENT_UNLOCK,
60 EVENT_DELETE,
61 EVENT_FREE,
62 EVENT_SET_OWNER,
63} LOG_EVENT_TYPE;
64
65typedef struct _LOGENTRY
66{
67 SLIST_ENTRY sleLink;
68 LOG_EVENT_TYPE nEventType;
69 DWORD dwProcessId;
71 ULONG ulUnique;
73 PVOID apvBackTrace[20];
74 union
75 {
77 } data;
78} LOGENTRY, *PLOGENTRY;
79
80VOID
82DbgDumpEventList(
84
85VOID
87DbgLogEvent(
89 _In_ LOG_EVENT_TYPE nEventType,
91
92VOID
94DbgCleanupEventList(
96
97VOID
99DbgPrintEvent(
100 _Inout_ PLOGENTRY pLogEntry);
101
102#define DBG_LOGEVENT(pslh, type, val) DbgLogEvent(pslh, type, (ULONG_PTR)val)
103#define DBG_INITLOG(pslh) InitializeSListHead(pslh)
104#define DBG_DUMP_EVENT_LIST(pslh) DbgDumpEventList(pslh)
105#define DBG_CLEANUP_EVENT_LIST(pslh) DbgCleanupEventList(pslh)
106
107#else
108
109#define DBG_LOGEVENT(pslh, type, val) ((void)(val))
110#define DBG_INITLOG(pslh)
111#define DBG_DUMP_EVENT_LIST(pslh)
112#define DBG_CLEANUP_EVENT_LIST(pslh)
113
114#endif
115
116#if DBG
117void
118NTAPI
119GdiDbgPreServiceHook(ULONG ulSyscallId, PULONG_PTR pulArguments);
120
122NTAPI
123GdiDbgPostServiceHook(ULONG ulSyscallId, ULONG_PTR ulResult);
124
125#define ID_Win32PreServiceHook 'WSH0'
126#define ID_Win32PostServiceHook 'WSH1'
127
128#ifndef __cplusplus
129FORCEINLINE void
130GdiDbgAssertNoLocks(char * pszFile, ULONG nLine)
131{
133 if (pti && pti->cExclusiveLocks != 0)
134 {
135 ULONG i;
136 DbgPrint("(%s:%lu) There are %lu exclusive locks!\n",
137 pszFile, nLine, pti->cExclusiveLocks);
138 for (i = 0; i < (GDIObjTypeTotal + 1); i++)
139 DbgPrint(" Type %u: %u.\n", i, pti->acExclusiveLockCount[i]);
140 ASSERT(FALSE);
141 }
142}
143#endif // __cplusplus
144#endif
145
146
unsigned char BOOLEAN
LPARAM lParam
Definition: combotst.c:139
#define FALSE
Definition: types.h:117
DWORD dwThreadId
Definition: fdebug.c:31
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL NTAPI DbgGdiHTIntegrityCheck(VOID)
ULONG NTAPI DbgCaptureStackBackTace(_Out_writes_(cFramesToCapture) PVOID *ppvFrames, _In_ ULONG cFramesToSkip, _In_ ULONG cFramesToCapture)
VOID NTAPI DbgDumpLockedGdiHandles(VOID)
BOOLEAN NTAPI DbgGdiKdbgCliCallback(IN PCHAR pszCommand, IN ULONG argc, IN PCH argv[])
Definition: gdikdbgext.c:324
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define DbgPrint
Definition: hal.h:12
#define ASSERT(a)
Definition: mode.c:44
#define _Inout_
Definition: no_sal2.h:162
#define _Out_writes_(s)
Definition: no_sal2.h:176
#define _In_
Definition: no_sal2.h:158
CHAR * PCH
Definition: ntbasedef.h:399
@ GDIObjTypeTotal
Definition: ntgdityp.h:152
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
struct _THREADINFO * PTHREADINFO
Definition: ntwin32.h:6
Definition: shell.h:41
ULONG cExclusiveLocks
Definition: win32.h:158
Definition: tftpd.h:126
#define SLIST_ENTRY(type)
Definition: queue.h:102
uint32_t * PULONG_PTR
Definition: typedefs.h:65
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
#define FORCEINLINE
Definition: wdftypes.h:67
LONG_PTR LPARAM
Definition: windef.h:208