2010-03-29 02:38:12 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* Kernel Debugger Functions *
|
|
|
|
******************************************************************************/
|
|
|
|
$if (_NTDDK_)
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
DbgPrompt(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_z_ PCCH Prompt,
|
|
|
|
_Out_writes_bytes_(MaximumResponseLength) PCH Response,
|
|
|
|
_In_ ULONG MaximumResponseLength);
|
2012-01-13 17:45:26 +00:00
|
|
|
$endif (_NTDDK_)
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
$if (_WDMDDK_)
|
|
|
|
#ifndef _DBGNT_
|
|
|
|
|
|
|
|
ULONG
|
|
|
|
__cdecl
|
|
|
|
DbgPrint(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_z_ _Printf_format_string_ PCSTR Format,
|
|
|
|
...);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
__cdecl
|
|
|
|
DbgPrintReturnControlC(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_z_ _Printf_format_string_ PCCH Format,
|
|
|
|
...);
|
2010-03-29 02:38:12 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
__cdecl
|
|
|
|
DbgPrintEx(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ ULONG ComponentId,
|
|
|
|
_In_ ULONG Level,
|
|
|
|
_In_z_ _Printf_format_string_ PCSTR Format,
|
|
|
|
...);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
#ifdef _VA_LIST_DEFINED
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
vDbgPrintEx(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ ULONG ComponentId,
|
|
|
|
_In_ ULONG Level,
|
|
|
|
_In_z_ PCCH Format,
|
|
|
|
_In_ va_list ap);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
vDbgPrintExWithPrefix(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_z_ PCCH Prefix,
|
|
|
|
_In_ ULONG ComponentId,
|
|
|
|
_In_ ULONG Level,
|
|
|
|
_In_z_ PCCH Format,
|
|
|
|
_In_ va_list ap);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
#endif /* _VA_LIST_DEFINED */
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
DbgQueryDebugFilterState(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ ULONG ComponentId,
|
|
|
|
_In_ ULONG Level);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
DbgSetDebugFilterState(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ ULONG ComponentId,
|
|
|
|
_In_ ULONG Level,
|
|
|
|
_In_ BOOLEAN State);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
|
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_VISTA)
|
|
|
|
|
|
|
|
typedef VOID
|
|
|
|
(*PDEBUG_PRINT_CALLBACK)(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PSTRING Output,
|
|
|
|
_In_ ULONG ComponentId,
|
|
|
|
_In_ ULONG Level);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
DbgSetDebugPrintCallback(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PDEBUG_PRINT_CALLBACK DebugPrintCallback,
|
|
|
|
_In_ BOOLEAN Enable);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
|
|
|
|
|
|
|
|
#endif /* _DBGNT_ */
|
|
|
|
|
|
|
|
#if DBG
|
|
|
|
|
|
|
|
#define KdPrint(_x_) DbgPrint _x_
|
|
|
|
#define KdPrintEx(_x_) DbgPrintEx _x_
|
|
|
|
#define vKdPrintEx(_x_) vDbgPrintEx _x_
|
|
|
|
#define vKdPrintExWithPrefix(_x_) vDbgPrintExWithPrefix _x_
|
|
|
|
#define KdBreakPoint() DbgBreakPoint()
|
|
|
|
#define KdBreakPointWithStatus(s) DbgBreakPointWithStatus(s)
|
|
|
|
|
|
|
|
#else /* !DBG */
|
|
|
|
|
|
|
|
#define KdPrint(_x_)
|
|
|
|
#define KdPrintEx(_x_)
|
|
|
|
#define vKdPrintEx(_x_)
|
|
|
|
#define vKdPrintExWithPrefix(_x_)
|
|
|
|
#define KdBreakPoint()
|
|
|
|
#define KdBreakPointWithStatus(s)
|
|
|
|
|
|
|
|
#endif /* !DBG */
|
|
|
|
|
2014-05-11 23:11:16 +00:00
|
|
|
#ifdef _NTSYSTEM_
|
2010-03-29 02:38:12 +00:00
|
|
|
extern BOOLEAN KdDebuggerEnabled;
|
|
|
|
#define KD_DEBUGGER_ENABLED KdDebuggerEnabled
|
2014-05-11 23:11:16 +00:00
|
|
|
extern BOOLEAN KdDebuggerNotPresent;
|
2010-03-29 02:38:12 +00:00
|
|
|
#define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent
|
2014-05-11 23:11:16 +00:00
|
|
|
#else
|
|
|
|
__CREATE_NTOS_DATA_IMPORT_ALIAS(KdDebuggerEnabled)
|
2014-09-14 15:49:35 +00:00
|
|
|
extern BOOLEAN *KdDebuggerEnabled;
|
2014-05-11 23:11:16 +00:00
|
|
|
#define KD_DEBUGGER_ENABLED (*KdDebuggerEnabled)
|
|
|
|
__CREATE_NTOS_DATA_IMPORT_ALIAS(KdDebuggerNotPresent)
|
2014-09-14 15:49:35 +00:00
|
|
|
extern BOOLEAN *KdDebuggerNotPresent;
|
2014-05-11 23:11:16 +00:00
|
|
|
#define KD_DEBUGGER_NOT_PRESENT (*KdDebuggerNotPresent)
|
2010-03-29 02:38:12 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
KdDisableDebugger(VOID);
|
|
|
|
|
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
KdEnableDebugger(VOID);
|
|
|
|
|
|
|
|
#if (_MSC_FULL_VER >= 150030729) && !defined(IMPORT_NATIVE_DBG_BREAK)
|
|
|
|
#define DbgBreakPoint __debugbreak
|
|
|
|
#else
|
2012-01-22 14:43:53 +00:00
|
|
|
__analysis_noreturn
|
2010-03-29 02:38:12 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
DbgBreakPoint(VOID);
|
|
|
|
#endif
|
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
__analysis_noreturn
|
2010-03-29 02:38:12 +00:00
|
|
|
NTSYSAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
DbgBreakPointWithStatus(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Status);
|
2010-03-29 02:38:12 +00:00
|
|
|
|
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
|
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WS03)
|
|
|
|
NTKERNELAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
KdRefreshDebuggerNotPresent(VOID);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WS03SP1)
|
|
|
|
NTKERNELAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
KdChangeOption(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ KD_OPTION Option,
|
|
|
|
_In_opt_ ULONG InBufferBytes,
|
|
|
|
_In_ PVOID InBuffer,
|
|
|
|
_In_opt_ ULONG OutBufferBytes,
|
|
|
|
_Out_ PVOID OutBuffer,
|
|
|
|
_Out_opt_ PULONG OutBufferNeeded);
|
2010-03-29 02:38:12 +00:00
|
|
|
#endif
|
2012-01-13 17:45:26 +00:00
|
|
|
$endif (_WDMDDK_)
|