- Define DECLSPEC_ADDRSAFE and FORCEINLINE for gcc in winnt.h
[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 Debug Subsystem.
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
26 //
27 // Debug Object Access Masks
28 //
29 #define DEBUG_OBJECT_WAIT_STATE_CHANGE 0x0001
30 #define DEBUG_OBJECT_ADD_REMOVE_PROCESS 0x0002
31 #define DEBUG_OBJECT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x0F)
32
33 //
34 // Debug Object Information Classes for NtQueryDebugObject
35 //
36 typedef enum _DEBUGOBJECTINFOCLASS
37 {
38 DebugObjectUnusedInformation,
39 DebugObjectKillProcessOnExitInformation
40 } DEBUGOBJECTINFOCLASS, *PDEBUGOBJECTINFOCLASS;
41
42 //
43 // Debug Object Information Structures
44 //
45 typedef struct _DEBUG_OBJECT_KILL_PROCESS_ON_EXIT_INFORMATION
46 {
47 ULONG KillProcessOnExit;
48 } DEBUG_OBJECT_KILL_PROCESS_ON_EXIT_INFORMATION, *PDEBUG_OBJECT_KILL_PROCESS_ON_EXIT_INFORMATION;
49
50 #ifndef NTOS_MODE_USER
51
52 //
53 // Debug Object
54 //
55 typedef struct _DBGK_DEBUG_OBJECT
56 {
57 KEVENT Event;
58 FAST_MUTEX Mutex;
59 LIST_ENTRY StateEventListEntry;
60 union
61 {
62 ULONG Flags;
63 struct
64 {
65 UCHAR DebuggerInactive:1;
66 UCHAR KillProcessOnExit:1;
67 };
68 };
69 } DBGK_DEBUG_OBJECT, *PDBGK_DEBUG_OBJECT;
70
71 #endif
72
73 //
74 // Debug States
75 //
76 typedef enum _DBG_STATE
77 {
78 DbgIdle,
79 DbgReplyPending,
80 DbgCreateThreadStateChange,
81 DbgCreateProcessStateChange,
82 DbgExitThreadStateChange,
83 DbgExitProcessStateChange,
84 DbgExceptionStateChange,
85 DbgBreakpointStateChange,
86 DbgSingleStepStateChange,
87 DbgLoadDllStateChange,
88 DbgUnloadDllStateChange
89 } DBG_STATE, *PDBG_STATE;
90
91 //
92 // Debug Message Structures
93 //
94 typedef struct _DBGKM_EXCEPTION
95 {
96 EXCEPTION_RECORD ExceptionRecord;
97 ULONG FirstChance;
98 } DBGKM_EXCEPTION, *PDBGKM_EXCEPTION;
99
100 typedef struct _DBGKM_CREATE_THREAD
101 {
102 ULONG SubSystemKey;
103 PVOID StartAddress;
104 } DBGKM_CREATE_THREAD, *PDBGKM_CREATE_THREAD;
105
106 typedef struct _DBGKM_CREATE_PROCESS
107 {
108 ULONG SubSystemKey;
109 HANDLE FileHandle;
110 PVOID BaseOfImage;
111 ULONG DebugInfoFileOffset;
112 ULONG DebugInfoSize;
113 DBGKM_CREATE_THREAD InitialThread;
114 } DBGKM_CREATE_PROCESS, *PDBGKM_CREATE_PROCESS;
115
116 typedef struct _DBGKM_EXIT_THREAD
117 {
118 NTSTATUS ExitStatus;
119 } DBGKM_EXIT_THREAD, *PDBGKM_EXIT_THREAD;
120
121 typedef struct _DBGKM_EXIT_PROCESS
122 {
123 NTSTATUS ExitStatus;
124 } DBGKM_EXIT_PROCESS, *PDBGKM_EXIT_PROCESS;
125
126 typedef struct _DBGKM_LOAD_DLL
127 {
128 HANDLE FileHandle;
129 PVOID BaseOfDll;
130 ULONG DebugInfoFileOffset;
131 ULONG DebugInfoSize;
132 } DBGKM_LOAD_DLL, *PDBGKM_LOAD_DLL;
133
134 typedef struct _DBGKM_UNLOAD_DLL
135 {
136 PVOID BaseAddress;
137 } DBGKM_UNLOAD_DLL, *PDBGKM_UNLOAD_DLL;
138
139 //
140 // User-Mode Debug State Change Structure
141 //
142 typedef struct _DBGUI_WAIT_STATE_CHANGE
143 {
144 DBG_STATE NewState;
145 CLIENT_ID AppClientId;
146 union
147 {
148 struct
149 {
150 HANDLE HandleToThread;
151 DBGKM_CREATE_THREAD NewThread;
152 } CreateThread;
153 struct
154 {
155 HANDLE HandleToProcess;
156 HANDLE HandleToThread;
157 DBGKM_CREATE_PROCESS NewProcess;
158 } CreateProcessInfo;
159 DBGKM_EXIT_THREAD ExitThread;
160 DBGKM_EXIT_PROCESS ExitProcess;
161 DBGKM_EXCEPTION Exception;
162 DBGKM_LOAD_DLL LoadDll;
163 DBGKM_UNLOAD_DLL UnloadDll;
164 } StateInfo;
165 } DBGUI_WAIT_STATE_CHANGE, *PDBGUI_WAIT_STATE_CHANGE;
166
167 //
168 // LPC Debug Message
169 //
170 typedef struct _DBGKM_MSG
171 {
172 PORT_MESSAGE h;
173 ULONG Opcode;
174 ULONG Status;
175 union
176 {
177 DBGKM_EXCEPTION Exception;
178 DBGKM_CREATE_THREAD CreateThread;
179 DBGKM_CREATE_PROCESS CreateProcess;
180 DBGKM_EXIT_THREAD ExitThread;
181 DBGKM_EXIT_PROCESS ExitProcess;
182 DBGKM_LOAD_DLL LoadDll;
183 DBGKM_UNLOAD_DLL UnloadDll;
184 };
185 } DBGKM_MSG, *PDBGKM_MSG;
186
187 #endif