Process Hacker
ntdbg.h
Go to the documentation of this file.
1 #ifndef _NTDBG_H
2 #define _NTDBG_H
3 
4 // Definitions
5 
6 typedef struct _DBGKM_EXCEPTION
7 {
8  EXCEPTION_RECORD ExceptionRecord;
9  ULONG FirstChance;
11 
12 typedef struct _DBGKM_CREATE_THREAD
13 {
14  ULONG SubSystemKey;
15  PVOID StartAddress;
17 
18 typedef struct _DBGKM_CREATE_PROCESS
19 {
20  ULONG SubSystemKey;
21  HANDLE FileHandle;
22  PVOID BaseOfImage;
27 
28 typedef struct _DBGKM_EXIT_THREAD
29 {
30  NTSTATUS ExitStatus;
32 
33 typedef struct _DBGKM_EXIT_PROCESS
34 {
35  NTSTATUS ExitStatus;
37 
38 typedef struct _DBGKM_LOAD_DLL
39 {
40  HANDLE FileHandle;
41  PVOID BaseOfDll;
44  PVOID NamePointer;
46 
47 typedef struct _DBGKM_UNLOAD_DLL
48 {
49  PVOID BaseAddress;
51 
52 typedef enum _DBG_STATE
53 {
66 
67 typedef struct _DBGUI_CREATE_THREAD
68 {
72 
73 typedef struct _DBGUI_CREATE_PROCESS
74 {
79 
81 {
84  union
85  {
93  } StateInfo;
95 
96 // System calls
97 
98 #define DEBUG_READ_EVENT 0x0001
99 #define DEBUG_PROCESS_ASSIGN 0x0002
100 #define DEBUG_SET_INFORMATION 0x0004
101 #define DEBUG_QUERY_INFORMATION 0x0008
102 #define DEBUG_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \
103  DEBUG_READ_EVENT | DEBUG_PROCESS_ASSIGN | DEBUG_SET_INFORMATION | \
104  DEBUG_QUERY_INFORMATION)
105 
106 #define DEBUG_KILL_ON_CLOSE 0x1
107 
109 {
113 
114 NTSYSCALLAPI
115 NTSTATUS
116 NTAPI
118  _Out_ PHANDLE DebugObjectHandle,
119  _In_ ACCESS_MASK DesiredAccess,
120  _In_ POBJECT_ATTRIBUTES ObjectAttributes,
121  _In_ ULONG Flags
122  );
123 
124 NTSYSCALLAPI
125 NTSTATUS
126 NTAPI
128  _In_ HANDLE ProcessHandle,
129  _In_ HANDLE DebugObjectHandle
130  );
131 
132 NTSYSCALLAPI
133 NTSTATUS
134 NTAPI
136  _In_ HANDLE DebugObjectHandle,
137  _In_ PCLIENT_ID ClientId,
138  _In_ NTSTATUS ContinueStatus
139  );
140 
141 NTSYSCALLAPI
142 NTSTATUS
143 NTAPI
145  _In_ HANDLE ProcessHandle,
146  _In_ HANDLE DebugObjectHandle
147  );
148 
149 NTSYSCALLAPI
150 NTSTATUS
151 NTAPI
153  _In_ HANDLE DebugObjectHandle,
154  _In_ DEBUGOBJECTINFOCLASS DebugObjectInformationClass,
155  _In_ PVOID DebugInformation,
156  _In_ ULONG DebugInformationLength,
157  _Out_opt_ PULONG ReturnLength
158  );
159 
160 NTSYSCALLAPI
161 NTSTATUS
162 NTAPI
164  _In_ HANDLE DebugObjectHandle,
165  _In_ BOOLEAN Alertable,
166  _In_opt_ PLARGE_INTEGER Timeout,
167  _Out_ PVOID WaitStateChange
168  );
169 
170 // Debugging UI
171 
172 NTSYSAPI
173 NTSTATUS
174 NTAPI
176  VOID
177  );
178 
179 NTSYSAPI
180 HANDLE
181 NTAPI
183  VOID
184  );
185 
186 NTSYSAPI
187 VOID
188 NTAPI
190  _In_ HANDLE DebugObject
191  );
192 
193 NTSYSAPI
194 NTSTATUS
195 NTAPI
197  _Out_ PDBGUI_WAIT_STATE_CHANGE StateChange,
198  _In_opt_ PLARGE_INTEGER Timeout
199  );
200 
201 NTSYSAPI
202 NTSTATUS
203 NTAPI
205  _In_ PCLIENT_ID AppClientId,
206  _In_ NTSTATUS ContinueStatus
207  );
208 
209 NTSYSAPI
210 NTSTATUS
211 NTAPI
213  _In_ HANDLE Process
214  );
215 
216 NTSYSAPI
217 NTSTATUS
218 NTAPI
220  _In_ HANDLE Process
221  );
222 
223 NTSYSAPI
224 VOID
225 NTAPI
227  _In_ PVOID Context
228  );
229 
230 NTSYSAPI
231 NTSTATUS
232 NTAPI
234  _In_ HANDLE Process
235  );
236 
237 struct _DEBUG_EVENT;
238 
239 NTSYSAPI
240 NTSTATUS
241 NTAPI
243  _In_ PDBGUI_WAIT_STATE_CHANGE StateChange,
244  _Out_ struct _DEBUG_EVENT *DebugEvent
245  );
246 
247 #endif