ReactOS 0.4.15-dev-5875-g7c755d9
kdfuncs.h File Reference

Go to the source code of this file.

Macros

#define KdPrint(_x_)
 
#define KdPrintEx(_x_)
 
#define vKdPrintEx(_x_)
 
#define vKdPrintExWithPrefix(_x_)
 
#define KdBreakPoint()
 
#define KdBreakPointWithStatus(s)
 
#define KD_DEBUGGER_ENABLED   (*KdDebuggerEnabled)
 
#define KD_DEBUGGER_NOT_PRESENT   (*KdDebuggerNotPresent)
 

Typedefs

typedef VOID(* PDEBUG_PRINT_CALLBACK) (_In_ PSTRING Output, _In_ ULONG ComponentId, _In_ ULONG Level)
 

Functions

 $if (_NTDDK_) NTSYSAPI ULONG NTAPI DbgPrompt(_In_z_ PCCH Prompt
 
 _Out_writes_bytes_ (MaximumResponseLength) PCH Response
 
 $endif (_NTDDK_) $if(_WDMDDK_) ULONG __cdecl DbgPrint(_In_z_ _Printf_format_string_ PCSTR Format
 
NTSYSAPI ULONG __cdecl DbgPrintReturnControlC (_In_z_ _Printf_format_string_ PCCH Format,...)
 
NTSYSAPI ULONG __cdecl DbgPrintEx (_In_ ULONG ComponentId, _In_ ULONG Level, _In_z_ _Printf_format_string_ PCSTR Format,...)
 
NTSYSAPI NTSTATUS NTAPI DbgQueryDebugFilterState (_In_ ULONG ComponentId, _In_ ULONG Level)
 
NTSYSAPI NTSTATUS NTAPI DbgSetDebugFilterState (_In_ ULONG ComponentId, _In_ ULONG Level, _In_ BOOLEAN State)
 
NTSYSAPI NTSTATUS NTAPI DbgSetDebugPrintCallback (_In_ PDEBUG_PRINT_CALLBACK DebugPrintCallback, _In_ BOOLEAN Enable)
 
NTKERNELAPI NTSTATUS NTAPI KdDisableDebugger (VOID)
 
NTKERNELAPI NTSTATUS NTAPI KdEnableDebugger (VOID)
 
__analysis_noreturn VOID NTAPI DbgBreakPoint (VOID)
 
__analysis_noreturn NTSYSAPI VOID NTAPI DbgBreakPointWithStatus (_In_ ULONG Status)
 
NTKERNELAPI BOOLEAN NTAPI KdRefreshDebuggerNotPresent (VOID)
 
NTKERNELAPI NTSTATUS NTAPI KdChangeOption (_In_ KD_OPTION Option, _In_opt_ ULONG InBufferBytes, _In_ PVOID InBuffer, _In_opt_ ULONG OutBufferBytes, _Out_ PVOID OutBuffer, _Out_opt_ PULONG OutBufferNeeded)
 

Variables

_In_ ULONG MaximumResponseLength
 
BOOLEANKdDebuggerEnabled
 
BOOLEANKdDebuggerNotPresent
 

Macro Definition Documentation

◆ KD_DEBUGGER_ENABLED

#define KD_DEBUGGER_ENABLED   (*KdDebuggerEnabled)

Definition at line 130 of file kdfuncs.h.

◆ KD_DEBUGGER_NOT_PRESENT

#define KD_DEBUGGER_NOT_PRESENT   (*KdDebuggerNotPresent)

Definition at line 133 of file kdfuncs.h.

◆ KdBreakPoint

#define KdBreakPoint ( )

Definition at line 117 of file kdfuncs.h.

◆ KdBreakPointWithStatus

#define KdBreakPointWithStatus (   s)

Definition at line 118 of file kdfuncs.h.

◆ KdPrint

#define KdPrint (   _x_)

Definition at line 113 of file kdfuncs.h.

◆ KdPrintEx

#define KdPrintEx (   _x_)

Definition at line 114 of file kdfuncs.h.

◆ vKdPrintEx

#define vKdPrintEx (   _x_)

Definition at line 115 of file kdfuncs.h.

◆ vKdPrintExWithPrefix

#define vKdPrintExWithPrefix (   _x_)

Definition at line 116 of file kdfuncs.h.

Typedef Documentation

◆ PDEBUG_PRINT_CALLBACK

typedef VOID(* PDEBUG_PRINT_CALLBACK) (_In_ PSTRING Output, _In_ ULONG ComponentId, _In_ ULONG Level)

Definition at line 85 of file kdfuncs.h.

Function Documentation

◆ $endif()

$endif ( _NTDDK_  )

Definition at line 540 of file iofuncs.h.

2502{
2503 PriorityInfo->Size = sizeof(IO_PRIORITY_INFO);
2504 PriorityInfo->ThreadPriority = 0xffff;
2505 PriorityInfo->IoPriority = IoPriorityNormal;
2506 PriorityInfo->PagePriority = 0;
2507}
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD _Inout_ PIO_PRIORITY_INFO PriorityInfo
Definition: fltkernel.h:2654
struct _IO_PRIORITY_INFO IO_PRIORITY_INFO
@ IoPriorityNormal
Definition: iotypes.h:1233

◆ $if()

$if ( _NTDDK_  )

Definition at line 1 of file ke.h.

215 {
216 ULONG64 P1Home;
217 ULONG64 P2Home;
218 ULONG64 P3Home;
219 ULONG64 P4Home;
220 ULONG64 P5Home;
221 ULONG64 P6Home;
222 ULONG ContextFlags;
223 ULONG MxCsr;
224 USHORT SegCs;
225 USHORT SegDs;
226 USHORT SegEs;
227 USHORT SegFs;
228 USHORT SegGs;
229 USHORT SegSs;
230 ULONG EFlags;
231 ULONG64 Dr0;
232 ULONG64 Dr1;
233 ULONG64 Dr2;
234 ULONG64 Dr3;
235 ULONG64 Dr6;
236 ULONG64 Dr7;
237 ULONG64 Rax;
238 ULONG64 Rcx;
239 ULONG64 Rdx;
240 ULONG64 Rbx;
241 ULONG64 Rsp;
242 ULONG64 Rbp;
243 ULONG64 Rsi;
244 ULONG64 Rdi;
245 ULONG64 R8;
246 ULONG64 R9;
247 ULONG64 R10;
248 ULONG64 R11;
249 ULONG64 R12;
250 ULONG64 R13;
251 ULONG64 R14;
252 ULONG64 R15;
253 ULONG64 Rip;
254 union {
255 XMM_SAVE_AREA32 FltSave;
256 struct {
257 M128A Header[2];
258 M128A Legacy[8];
259 M128A Xmm0;
260 M128A Xmm1;
261 M128A Xmm2;
262 M128A Xmm3;
263 M128A Xmm4;
264 M128A Xmm5;
265 M128A Xmm6;
266 M128A Xmm7;
267 M128A Xmm8;
268 M128A Xmm9;
269 M128A Xmm10;
270 M128A Xmm11;
271 M128A Xmm12;
272 M128A Xmm13;
273 M128A Xmm14;
274 M128A Xmm15;
277 M128A VectorRegister[26];
278 ULONG64 VectorControl;
279 ULONG64 DebugControl;
280 ULONG64 LastBranchToRip;
281 ULONG64 LastBranchFromRip;
282 ULONG64 LastExceptionToRip;
283 ULONG64 LastExceptionFromRip;
284} CONTEXT;
@ R15
Definition: amd64_sup.c:13
@ R13
Definition: amd64_sup.c:13
@ R12
Definition: amd64_sup.c:13
@ R9
Definition: amd64_sup.c:13
@ R14
Definition: amd64_sup.c:13
@ R8
Definition: amd64_sup.c:13
@ R11
Definition: amd64_sup.c:13
@ R10
Definition: amd64_sup.c:13
Definition: Header.h:9
unsigned __int64 ULONG64
Definition: imports.h:198
#define DECLSPEC_ALIGN(x)
Definition: ntbasedef.h:251
#define DUMMYUNIONNAME
Definition: ntbasedef.h:32
#define DUMMYSTRUCTNAME
Definition: ntbasedef.h:58
unsigned short USHORT
Definition: pedump.c:61
XSAVE_FORMAT XMM_SAVE_AREA32
Definition: ke.h:35
CONTEXT
Definition: ke.h:284
uint32_t ULONG
Definition: typedefs.h:59
M128A
Definition: ketypes.h:925

◆ _Out_writes_bytes_()

_Out_writes_bytes_ ( MaximumResponseLength  )

◆ DbgBreakPoint()

__analysis_noreturn VOID NTAPI DbgBreakPoint ( VOID  )

◆ DbgBreakPointWithStatus()

__analysis_noreturn NTSYSAPI VOID NTAPI DbgBreakPointWithStatus ( _In_ ULONG  Status)

◆ DbgPrintEx()

NTSYSAPI ULONG __cdecl DbgPrintEx ( _In_ ULONG  ComponentId,
_In_ ULONG  Level,
_In_z_ _Printf_format_string_ PCSTR  Format,
  ... 
)

◆ DbgPrintReturnControlC()

NTSYSAPI ULONG __cdecl DbgPrintReturnControlC ( _In_z_ _Printf_format_string_ PCCH  Format,
  ... 
)

◆ DbgQueryDebugFilterState()

NTSYSAPI NTSTATUS NTAPI DbgQueryDebugFilterState ( _In_ ULONG  ComponentId,
_In_ ULONG  Level 
)

Referenced by DisplayIPPacket().

◆ DbgSetDebugFilterState()

NTSYSAPI NTSTATUS NTAPI DbgSetDebugFilterState ( _In_ ULONG  ComponentId,
_In_ ULONG  Level,
_In_ BOOLEAN  State 
)

◆ DbgSetDebugPrintCallback()

NTSYSAPI NTSTATUS NTAPI DbgSetDebugPrintCallback ( _In_ PDEBUG_PRINT_CALLBACK  DebugPrintCallback,
_In_ BOOLEAN  Enable 
)

◆ KdChangeOption()

NTKERNELAPI NTSTATUS NTAPI KdChangeOption ( _In_ KD_OPTION  Option,
_In_opt_ ULONG  InBufferBytes,
_In_ PVOID  InBuffer,
_In_opt_ ULONG  OutBufferBytes,
_Out_ PVOID  OutBuffer,
_Out_opt_ PULONG  OutBufferNeeded 
)

◆ KdDisableDebugger()

NTKERNELAPI NTSTATUS NTAPI KdDisableDebugger ( VOID  )

Definition at line 2141 of file kdapi.c.

2142{
2143 /* Use the internal routine */
2145}
#define TRUE
Definition: types.h:120
NTSTATUS NTAPI KdDisableDebuggerWithLock(IN BOOLEAN NeedLock)
Definition: kdapi.c:2035

Referenced by PcipGetFunctionLimits().

◆ KdEnableDebugger()

NTKERNELAPI NTSTATUS NTAPI KdEnableDebugger ( VOID  )

Definition at line 2130 of file kdapi.c.

2131{
2132 /* Use the internal routine */
2134}
NTSTATUS NTAPI KdEnableDebuggerWithLock(IN BOOLEAN NeedLock)
Definition: kdapi.c:1959

Referenced by KdpStub(), and PcipGetFunctionLimits().

◆ KdRefreshDebuggerNotPresent()

NTKERNELAPI BOOLEAN NTAPI KdRefreshDebuggerNotPresent ( VOID  )

Definition at line 2319 of file kdapi.c.

2320{
2321 BOOLEAN Enable, DebuggerNotPresent;
2322
2323 /* Check if the debugger is completely disabled */
2324 if (KdPitchDebugger)
2325 {
2326 /* Don't try to refresh then, fail early */
2327 return TRUE;
2328 }
2329
2330 /* Enter the debugger */
2332
2333 /*
2334 * Attempt to send a string to the debugger
2335 * to refresh the connection state.
2336 */
2337 KdpDprintf("KDTARGET: Refreshing KD connection\n");
2338
2339 /* Save the state while we are holding the lock */
2340 DebuggerNotPresent = KdDebuggerNotPresent;
2341
2342 /* Exit the debugger and return the state */
2344 return DebuggerNotPresent;
2345}
unsigned char BOOLEAN
#define NULL
Definition: types.h:112
BOOLEAN KdPitchDebugger
Definition: kddata.c:81
BOOLEAN NTAPI KdEnterDebugger(IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame)
Definition: kdapi.c:1871
VOID NTAPI KdExitDebugger(IN BOOLEAN Enable)
Definition: kdapi.c:1924
BOOLEAN KdDebuggerNotPresent
Definition: kddata.c:82
#define KdpDprintf(...)
Definition: mmdbg.c:19
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142

Referenced by _FX_DRIVER_GLOBALS::IsDebuggerAttached().

Variable Documentation

◆ KdDebuggerEnabled

◆ KdDebuggerNotPresent

◆ MaximumResponseLength

_In_ ULONG MaximumResponseLength

Definition at line 11 of file kdfuncs.h.

Referenced by DbgPrompt(), and KdpPrompt().