1 /******************************************************************************
2 * Kernel Debugger Functions *
3 ******************************************************************************/
13 #if (NTDDI_VERSION >= NTDDI_WIN2K)
17 DbgPrintReturnControlC(
22 #if (NTDDI_VERSION >= NTDDI_WINXP)
33 #ifdef _VA_LIST_DEFINED
47 vDbgPrintExWithPrefix(
54 #endif /* _VA_LIST_DEFINED */
59 DbgQueryDebugFilterState(
66 DbgSetDebugFilterState(
71 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
73 #if (NTDDI_VERSION >= NTDDI_VISTA)
76 (*PDEBUG_PRINT_CALLBACK
)(
84 DbgSetDebugPrintCallback(
85 IN PDEBUG_PRINT_CALLBACK DebugPrintCallback
,
88 #endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
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)
104 #define KdPrintEx(_x_)
105 #define vKdPrintEx(_x_)
106 #define vKdPrintExWithPrefix(_x_)
107 #define KdBreakPoint()
108 #define KdBreakPointWithStatus(s)
112 #if defined(__GNUC__)
114 extern NTKERNELAPI BOOLEAN KdDebuggerNotPresent
;
115 extern NTKERNELAPI BOOLEAN KdDebuggerEnabled
;
116 #define KD_DEBUGGER_ENABLED KdDebuggerEnabled
117 #define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent
119 #elif defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_) || defined(_WDMDDK_) || defined(_NTOSP_)
121 extern NTKERNELAPI PBOOLEAN KdDebuggerNotPresent
;
122 extern NTKERNELAPI PBOOLEAN KdDebuggerEnabled
;
123 #define KD_DEBUGGER_ENABLED *KdDebuggerEnabled
124 #define KD_DEBUGGER_NOT_PRESENT *KdDebuggerNotPresent
128 extern BOOLEAN KdDebuggerNotPresent
;
129 extern BOOLEAN KdDebuggerEnabled
;
130 #define KD_DEBUGGER_ENABLED KdDebuggerEnabled
131 #define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent
135 #if (NTDDI_VERSION >= NTDDI_WIN2K)
140 KdDisableDebugger(VOID
);
145 KdEnableDebugger(VOID
);
147 #if (_MSC_FULL_VER >= 150030729) && !defined(IMPORT_NATIVE_DBG_BREAK)
148 #define DbgBreakPoint __debugbreak
158 DbgBreakPointWithStatus(
161 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
163 #if (NTDDI_VERSION >= NTDDI_WS03)
167 KdRefreshDebuggerNotPresent(VOID
);
170 #if (NTDDI_VERSION >= NTDDI_WS03SP1)
176 IN ULONG InBufferBytes OPTIONAL
,
178 IN ULONG OutBufferBytes OPTIONAL
,
180 OUT PULONG OutBufferNeeded OPTIONAL
);