ReactOS  0.4.14-dev-293-g2b39b42
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 
14 ULONG
15 NTAPI
17  _Out_writes_(cFramesToCapture) PVOID* ppvFrames,
18  _In_ ULONG cFramesToSkip,
19  _In_ ULONG cFramesToCapture);
20 
21 BOOL
22 NTAPI
24  VOID);
25 
26 VOID
27 NTAPI
29  VOID);
30 
31 #if DBG_ENABLE_GDIOBJ_BACKTRACES
32 
33 VOID
34 NTAPI
35 DbgDumpGdiHandleTableWithBT(VOID);
36 
37 #endif
38 
39 #if defined(KDBG)
40 
41 BOOLEAN
42 NTAPI
45  _In_ ULONG Argc,
46  _In_ PCH Argv[]);
47 
48 #endif
49 
50 #if DBG_ENABLE_EVENT_LOGGING
51 
52 typedef 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 
65 typedef struct _LOGENTRY
66 {
67  SLIST_ENTRY sleLink;
68  LOG_EVENT_TYPE nEventType;
69  DWORD dwProcessId;
71  ULONG ulUnique;
72  LPARAM lParam;
73  PVOID apvBackTrace[20];
74  union
75  {
77  } data;
78 } LOGENTRY, *PLOGENTRY;
79 
80 VOID
81 NTAPI
82 DbgDumpEventList(
83  _Inout_ PSLIST_HEADER pslh);
84 
85 VOID
86 NTAPI
87 DbgLogEvent(
89  _In_ LOG_EVENT_TYPE nEventType,
91 
92 VOID
93 NTAPI
94 DbgCleanupEventList(
95  _Inout_ PSLIST_HEADER pslh);
96 
97 VOID
98 NTAPI
99 DbgPrintEvent(
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
117 void
118 NTAPI
119 GdiDbgPreServiceHook(ULONG ulSyscallId, PULONG_PTR pulArguments);
120 
121 ULONG_PTR
122 NTAPI
123 GdiDbgPostServiceHook(ULONG ulSyscallId, ULONG_PTR ulResult);
124 
125 #define ID_Win32PreServiceHook 'WSH0'
126 #define ID_Win32PostServiceHook 'WSH1'
127 
128 #ifndef __cplusplus
129 FORCEINLINE void
130 GdiDbgAssertNoLocks(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 
ULONG NTAPI DbgCaptureStackBackTace(_Out_writes_(cFramesToCapture) PVOID *ppvFrames, _In_ ULONG cFramesToSkip, _In_ ULONG cFramesToCapture)
signed char * PCHAR
Definition: retypes.h:7
#define DbgPrint
Definition: loader.c:25
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
Definition: shell.h:41
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define _Out_writes_(size)
Definition: no_sal2.h:367
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
ULONG cExclusiveLocks
Definition: win32.h:152
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL NTAPI DbgGdiHTIntegrityCheck(VOID)
VOID NTAPI DbgDumpLockedGdiHandles(VOID)
CHAR * PCH
Definition: ntbasedef.h:398
unsigned char BOOLEAN
#define FORCEINLINE
Definition: ntbasedef.h:221
LONG_PTR LPARAM
Definition: windef.h:208
struct _THREADINFO * PTHREADINFO
Definition: ntwin32.h:6
BOOLEAN NTAPI DbgGdiKdbgCliCallback(IN PCHAR pszCommand, IN ULONG argc, IN PCH argv[])
Definition: gdikdbgext.c:324
unsigned long DWORD
Definition: ntddk_ex.h:95
#define _Inout_
Definition: no_sal2.h:244
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
DWORD dwThreadId
Definition: fdebug.c:31
#define _In_
Definition: no_sal2.h:204
static const WCHAR data1[]
Definition: db.c:2967
#define SLIST_ENTRY(type)
Definition: queue.h:102
unsigned int ULONG
Definition: retypes.h:1
uint32_t * PULONG_PTR
Definition: typedefs.h:63
LPARAM lParam
Definition: combotst.c:139