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