1 /******************************************************************************
2 * Kernel Debugger Functions *
3 ******************************************************************************/
10 _Out_writes_bytes_(MaximumResponseLength
) PCH Response
,
11 _In_ ULONG MaximumResponseLength
);
20 _In_z_ _Printf_format_string_ PCSTR Format
,
23 #if (NTDDI_VERSION >= NTDDI_WIN2K)
27 DbgPrintReturnControlC(
28 _In_z_ _Printf_format_string_ PCCH Format
,
32 #if (NTDDI_VERSION >= NTDDI_WINXP)
38 _In_ ULONG ComponentId
,
40 _In_z_ _Printf_format_string_ PCSTR Format
,
43 #ifdef _VA_LIST_DEFINED
49 _In_ ULONG ComponentId
,
57 vDbgPrintExWithPrefix(
59 _In_ ULONG ComponentId
,
64 #endif /* _VA_LIST_DEFINED */
69 DbgQueryDebugFilterState(
70 _In_ ULONG ComponentId
,
76 DbgSetDebugFilterState(
77 _In_ ULONG ComponentId
,
81 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
83 #if (NTDDI_VERSION >= NTDDI_VISTA)
86 (*PDEBUG_PRINT_CALLBACK
)(
88 _In_ ULONG ComponentId
,
94 DbgSetDebugPrintCallback(
95 _In_ PDEBUG_PRINT_CALLBACK DebugPrintCallback
,
98 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
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)
114 #define KdPrintEx(_x_)
115 #define vKdPrintEx(_x_)
116 #define vKdPrintExWithPrefix(_x_)
117 #define KdBreakPoint()
118 #define KdBreakPointWithStatus(s)
122 #if defined(__GNUC__)
124 extern NTKERNELAPI BOOLEAN KdDebuggerNotPresent
;
125 extern NTKERNELAPI BOOLEAN KdDebuggerEnabled
;
126 #define KD_DEBUGGER_ENABLED KdDebuggerEnabled
127 #define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent
129 #elif defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_) || defined(_WDMDDK_) || defined(_NTOSP_)
131 extern NTKERNELAPI PBOOLEAN KdDebuggerNotPresent
;
132 extern NTKERNELAPI PBOOLEAN KdDebuggerEnabled
;
133 #define KD_DEBUGGER_ENABLED *KdDebuggerEnabled
134 #define KD_DEBUGGER_NOT_PRESENT *KdDebuggerNotPresent
138 extern BOOLEAN KdDebuggerNotPresent
;
139 extern BOOLEAN KdDebuggerEnabled
;
140 #define KD_DEBUGGER_ENABLED KdDebuggerEnabled
141 #define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent
145 #if (NTDDI_VERSION >= NTDDI_WIN2K)
150 KdDisableDebugger(VOID
);
155 KdEnableDebugger(VOID
);
157 #if (_MSC_FULL_VER >= 150030729) && !defined(IMPORT_NATIVE_DBG_BREAK)
158 #define DbgBreakPoint __debugbreak
170 DbgBreakPointWithStatus(
173 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
175 #if (NTDDI_VERSION >= NTDDI_WS03)
179 KdRefreshDebuggerNotPresent(VOID
);
182 #if (NTDDI_VERSION >= NTDDI_WS03SP1)
187 _In_ KD_OPTION Option
,
188 _In_opt_ ULONG InBufferBytes
,
190 _In_opt_ ULONG OutBufferBytes
,
191 _Out_ PVOID OutBuffer
,
192 _Out_opt_ PULONG OutBufferNeeded
);