[EXT2FSD]
[reactos.git] / include / xdk / kdfuncs.h
1 /******************************************************************************
2 * Kernel Debugger Functions *
3 ******************************************************************************/
4
5 #ifndef _DBGNT_
6
7 ULONG
8 DDKCDECLAPI
9 DbgPrint(
10 IN PCSTR Format,
11 IN ...);
12
13 #if (NTDDI_VERSION >= NTDDI_WIN2K)
14 NTSYSAPI
15 ULONG
16 DDKCDECLAPI
17 DbgPrintReturnControlC(
18 IN PCCH Format,
19 IN ...);
20 #endif
21
22 #if (NTDDI_VERSION >= NTDDI_WINXP)
23
24 NTSYSAPI
25 ULONG
26 DDKCDECLAPI
27 DbgPrintEx(
28 IN ULONG ComponentId,
29 IN ULONG Level,
30 IN PCSTR Format,
31 IN ...);
32
33 #ifdef _VA_LIST_DEFINED
34
35 NTSYSAPI
36 ULONG
37 NTAPI
38 vDbgPrintEx(
39 IN ULONG ComponentId,
40 IN ULONG Level,
41 IN PCCH Format,
42 IN va_list ap);
43
44 NTSYSAPI
45 ULONG
46 NTAPI
47 vDbgPrintExWithPrefix(
48 IN PCCH Prefix,
49 IN ULONG ComponentId,
50 IN ULONG Level,
51 IN PCCH Format,
52 IN va_list ap);
53
54 #endif /* _VA_LIST_DEFINED */
55
56 NTSYSAPI
57 NTSTATUS
58 NTAPI
59 DbgQueryDebugFilterState(
60 IN ULONG ComponentId,
61 IN ULONG Level);
62
63 NTSYSAPI
64 NTSTATUS
65 NTAPI
66 DbgSetDebugFilterState(
67 IN ULONG ComponentId,
68 IN ULONG Level,
69 IN BOOLEAN State);
70
71 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
72
73 #if (NTDDI_VERSION >= NTDDI_VISTA)
74
75 typedef VOID
76 (*PDEBUG_PRINT_CALLBACK)(
77 IN PSTRING Output,
78 IN ULONG ComponentId,
79 IN ULONG Level);
80
81 NTSYSAPI
82 NTSTATUS
83 NTAPI
84 DbgSetDebugPrintCallback(
85 IN PDEBUG_PRINT_CALLBACK DebugPrintCallback,
86 IN BOOLEAN Enable);
87
88 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
89
90 #endif /* _DBGNT_ */
91
92 #if DBG
93
94 #define KdPrint(_x_) DbgPrint _x_
95 #define KdPrintEx(_x_) DbgPrintEx _x_
96 #define vKdPrintEx(_x_) vDbgPrintEx _x_
97 #define vKdPrintExWithPrefix(_x_) vDbgPrintExWithPrefix _x_
98 #define KdBreakPoint() DbgBreakPoint()
99 #define KdBreakPointWithStatus(s) DbgBreakPointWithStatus(s)
100
101 #else /* !DBG */
102
103 #define KdPrint(_x_)
104 #define KdPrintEx(_x_)
105 #define vKdPrintEx(_x_)
106 #define vKdPrintExWithPrefix(_x_)
107 #define KdBreakPoint()
108 #define KdBreakPointWithStatus(s)
109
110 #endif /* !DBG */
111
112 #if defined(__GNUC__)
113
114 extern NTKERNELAPI BOOLEAN KdDebuggerNotPresent;
115 extern NTKERNELAPI BOOLEAN KdDebuggerEnabled;
116 #define KD_DEBUGGER_ENABLED KdDebuggerEnabled
117 #define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent
118
119 #elif defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_) || defined(_WDMDDK_) || defined(_NTOSP_)
120
121 extern NTKERNELAPI PBOOLEAN KdDebuggerNotPresent;
122 extern NTKERNELAPI PBOOLEAN KdDebuggerEnabled;
123 #define KD_DEBUGGER_ENABLED *KdDebuggerEnabled
124 #define KD_DEBUGGER_NOT_PRESENT *KdDebuggerNotPresent
125
126 #else
127
128 extern BOOLEAN KdDebuggerNotPresent;
129 extern BOOLEAN KdDebuggerEnabled;
130 #define KD_DEBUGGER_ENABLED KdDebuggerEnabled
131 #define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent
132
133 #endif
134
135 #if (NTDDI_VERSION >= NTDDI_WIN2K)
136
137 NTKERNELAPI
138 NTSTATUS
139 NTAPI
140 KdDisableDebugger(VOID);
141
142 NTKERNELAPI
143 NTSTATUS
144 NTAPI
145 KdEnableDebugger(VOID);
146
147 #if (_MSC_FULL_VER >= 150030729) && !defined(IMPORT_NATIVE_DBG_BREAK)
148 #define DbgBreakPoint __debugbreak
149 #else
150 VOID
151 NTAPI
152 DbgBreakPoint(VOID);
153 #endif
154
155 NTSYSAPI
156 VOID
157 NTAPI
158 DbgBreakPointWithStatus(
159 IN ULONG Status);
160
161 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
162
163 #if (NTDDI_VERSION >= NTDDI_WS03)
164 NTKERNELAPI
165 BOOLEAN
166 NTAPI
167 KdRefreshDebuggerNotPresent(VOID);
168 #endif
169
170 #if (NTDDI_VERSION >= NTDDI_WS03SP1)
171 NTKERNELAPI
172 NTSTATUS
173 NTAPI
174 KdChangeOption(
175 IN KD_OPTION Option,
176 IN ULONG InBufferBytes OPTIONAL,
177 IN PVOID InBuffer,
178 IN ULONG OutBufferBytes OPTIONAL,
179 OUT PVOID OutBuffer,
180 OUT PULONG OutBufferNeeded OPTIONAL);
181 #endif