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