[XDK]
[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(VOID);
85
86 NTKERNELAPI
87 NTSTATUS
88 NTAPI
89 KdEnableDebugger(VOID);
90
91 #if (_MSC_FULL_VER >= 150030729) && !defined(IMPORT_NATIVE_DBG_BREAK)
92 #define DbgBreakPoint __debugbreak
93 #else
94 VOID
95 NTAPI
96 DbgBreakPoint(VOID);
97 #endif
98
99 NTSYSAPI
100 VOID
101 NTAPI
102 DbgBreakPointWithStatus(
103 IN ULONG Status);
104
105 NTSYSAPI
106 ULONG
107 DDKCDECLAPI
108 DbgPrintReturnControlC(
109 IN PCCH Format,
110 IN ...);
111
112 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
113
114 #if (NTDDI_VERSION >= NTDDI_WINXP)
115
116 NTSYSAPI
117 ULONG
118 DDKCDECLAPI
119 DbgPrintEx(
120 IN ULONG ComponentId,
121 IN ULONG Level,
122 IN PCSTR Format,
123 IN ...);
124
125 NTSYSAPI
126 NTSTATUS
127 NTAPI
128 DbgQueryDebugFilterState(
129 IN ULONG ComponentId,
130 IN ULONG Level);
131
132 NTSYSAPI
133 NTSTATUS
134 NTAPI
135 DbgSetDebugFilterState(
136 IN ULONG ComponentId,
137 IN ULONG Level,
138 IN BOOLEAN State);
139
140 #endif
141
142 #if (NTDDI_VERSION >= NTDDI_WS03)
143 NTKERNELAPI
144 BOOLEAN
145 NTAPI
146 KdRefreshDebuggerNotPresent(VOID);
147 #endif
148
149 #if (NTDDI_VERSION >= NTDDI_WS03SP1)
150 NTKERNELAPI
151 NTSTATUS
152 NTAPI
153 KdChangeOption(
154 IN KD_OPTION Option,
155 IN ULONG InBufferBytes OPTIONAL,
156 IN PVOID InBuffer,
157 IN ULONG OutBufferBytes OPTIONAL,
158 OUT PVOID OutBuffer,
159 OUT PULONG OutBufferNeeded OPTIONAL);
160 #endif