- Update NDK to remove zwfuncs.h and place the native functions in their respective...
[reactos.git] / reactos / include / ndk / dbgktypes.h
1 /*++ NDK Version: 0095
2
3 Copyright (c) Alex Ionescu. All rights reserved.
4
5 Header Name:
6
7 dbgktypes.h
8
9 Abstract:
10
11 Type definitions for the User Mode Debugging Facility.
12
13 Author:
14
15 Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004
16
17 --*/
18
19 #ifndef _DBGKTYPES_H
20 #define _DBGKTYPES_H
21
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 #include <lpctypes.h>
27
28 //
29 // Debug Object Access Masks
30 //
31 #define DEBUG_OBJECT_WAIT_STATE_CHANGE 0x0001
32 #define DEBUG_OBJECT_ADD_REMOVE_PROCESS 0x0002
33 #define DEBUG_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x0F)
34
35 //
36 // Debug Object Information Classes for NtQueryDebugObject
37 //
38 typedef enum _DEBUGOBJECTINFOCLASS
39 {
40 DebugObjectUnusedInformation,
41 DebugObjectKillProcessOnExitInformation
42 } DEBUGOBJECTINFOCLASS, *PDEBUGOBJECTINFOCLASS;
43
44 //
45 // Debug Object Information Structures
46 //
47 typedef struct _DEBUG_OBJECT_KILL_PROCESS_ON_EXIT_INFORMATION
48 {
49 ULONG KillProcessOnExit;
50 } DEBUG_OBJECT_KILL_PROCESS_ON_EXIT_INFORMATION, *PDEBUG_OBJECT_KILL_PROCESS_ON_EXIT_INFORMATION;
51
52 #ifndef NTOS_MODE_USER
53
54 //
55 // Debug Object
56 //
57 typedef struct _DBGK_DEBUG_OBJECT
58 {
59 KEVENT Event;
60 FAST_MUTEX Mutex;
61 LIST_ENTRY StateEventListEntry;
62 union
63 {
64 ULONG Flags;
65 struct
66 {
67 UCHAR DebuggerInactive:1;
68 UCHAR KillProcessOnExit:1;
69 };
70 };
71 } DBGK_DEBUG_OBJECT, *PDBGK_DEBUG_OBJECT;
72
73 #endif
74
75 //
76 // Debug States
77 //
78 typedef enum _DBG_STATE
79 {
80 DbgIdle,
81 DbgReplyPending,
82 DbgCreateThreadStateChange,
83 DbgCreateProcessStateChange,
84 DbgExitThreadStateChange,
85 DbgExitProcessStateChange,
86 DbgExceptionStateChange,
87 DbgBreakpointStateChange,
88 DbgSingleStepStateChange,
89 DbgLoadDllStateChange,
90 DbgUnloadDllStateChange
91 } DBG_STATE, *PDBG_STATE;
92
93 //
94 // Debug Message Structures
95 //
96 typedef struct _DBGKM_EXCEPTION
97 {
98 EXCEPTION_RECORD ExceptionRecord;
99 ULONG FirstChance;
100 } DBGKM_EXCEPTION, *PDBGKM_EXCEPTION;
101
102 typedef struct _DBGKM_CREATE_THREAD
103 {
104 ULONG SubSystemKey;
105 PVOID StartAddress;
106 } DBGKM_CREATE_THREAD, *PDBGKM_CREATE_THREAD;
107
108 typedef struct _DBGKM_CREATE_PROCESS
109 {
110 ULONG SubSystemKey;
111 HANDLE FileHandle;
112 PVOID BaseOfImage;
113 ULONG DebugInfoFileOffset;
114 ULONG DebugInfoSize;
115 DBGKM_CREATE_THREAD InitialThread;
116 } DBGKM_CREATE_PROCESS, *PDBGKM_CREATE_PROCESS;
117
118 typedef struct _DBGKM_EXIT_THREAD
119 {
120 NTSTATUS ExitStatus;
121 } DBGKM_EXIT_THREAD, *PDBGKM_EXIT_THREAD;
122
123 typedef struct _DBGKM_EXIT_PROCESS
124 {
125 NTSTATUS ExitStatus;
126 } DBGKM_EXIT_PROCESS, *PDBGKM_EXIT_PROCESS;
127
128 typedef struct _DBGKM_LOAD_DLL
129 {
130 HANDLE FileHandle;
131 PVOID BaseOfDll;
132 ULONG DebugInfoFileOffset;
133 ULONG DebugInfoSize;
134 } DBGKM_LOAD_DLL, *PDBGKM_LOAD_DLL;
135
136 typedef struct _DBGKM_UNLOAD_DLL
137 {
138 PVOID BaseAddress;
139 } DBGKM_UNLOAD_DLL, *PDBGKM_UNLOAD_DLL;
140
141 //
142 // User-Mode Debug State Change Structure
143 //
144 typedef struct _DBGUI_WAIT_STATE_CHANGE
145 {
146 DBG_STATE NewState;
147 CLIENT_ID AppClientId;
148 union
149 {
150 struct
151 {
152 HANDLE HandleToThread;
153 DBGKM_CREATE_THREAD NewThread;
154 } CreateThread;
155 struct
156 {
157 HANDLE HandleToProcess;
158 HANDLE HandleToThread;
159 DBGKM_CREATE_PROCESS NewProcess;
160 } CreateProcessInfo;
161 DBGKM_EXIT_THREAD ExitThread;
162 DBGKM_EXIT_PROCESS ExitProcess;
163 DBGKM_EXCEPTION Exception;
164 DBGKM_LOAD_DLL LoadDll;
165 DBGKM_UNLOAD_DLL UnloadDll;
166 } StateInfo;
167 } DBGUI_WAIT_STATE_CHANGE, *PDBGUI_WAIT_STATE_CHANGE;
168
169 //
170 // LPC Debug Message
171 //
172 typedef struct _DBGKM_MSG
173 {
174 PORT_MESSAGE h;
175 ULONG Opcode;
176 ULONG Status;
177 union
178 {
179 DBGKM_EXCEPTION Exception;
180 DBGKM_CREATE_THREAD CreateThread;
181 DBGKM_CREATE_PROCESS CreateProcess;
182 DBGKM_EXIT_THREAD ExitThread;
183 DBGKM_EXIT_PROCESS ExitProcess;
184 DBGKM_LOAD_DLL LoadDll;
185 DBGKM_UNLOAD_DLL UnloadDll;
186 };
187 } DBGKM_MSG, *PDBGKM_MSG;
188
189 #endif