ReactOS 0.4.15-dev-7842-g558ab78
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 546 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.

219 {
220 ULONG64 P1Home;
221 ULONG64 P2Home;
222 ULONG64 P3Home;
223 ULONG64 P4Home;
224 ULONG64 P5Home;
225 ULONG64 P6Home;
226 ULONG ContextFlags;
227 ULONG MxCsr;
228 USHORT SegCs;
229 USHORT SegDs;
230 USHORT SegEs;
231 USHORT SegFs;
232 USHORT SegGs;
233 USHORT SegSs;
234 ULONG EFlags;
235 ULONG64 Dr0;
236 ULONG64 Dr1;
237 ULONG64 Dr2;
238 ULONG64 Dr3;
239 ULONG64 Dr6;
240 ULONG64 Dr7;
241 ULONG64 Rax;
242 ULONG64 Rcx;
243 ULONG64 Rdx;
244 ULONG64 Rbx;
245 ULONG64 Rsp;
246 ULONG64 Rbp;
247 ULONG64 Rsi;
248 ULONG64 Rdi;
249 ULONG64 R8;
250 ULONG64 R9;
251 ULONG64 R10;
252 ULONG64 R11;
253 ULONG64 R12;
254 ULONG64 R13;
255 ULONG64 R14;
256 ULONG64 R15;
257 ULONG64 Rip;
258 union {
259 XMM_SAVE_AREA32 FltSave;
260 struct {
261 M128A Header[2];
262 M128A Legacy[8];
263 M128A Xmm0;
264 M128A Xmm1;
265 M128A Xmm2;
266 M128A Xmm3;
267 M128A Xmm4;
268 M128A Xmm5;
269 M128A Xmm6;
270 M128A Xmm7;
271 M128A Xmm8;
272 M128A Xmm9;
273 M128A Xmm10;
274 M128A Xmm11;
275 M128A Xmm12;
276 M128A Xmm13;
277 M128A Xmm14;
278 M128A Xmm15;
281 M128A VectorRegister[26];
282 ULONG64 VectorControl;
283 ULONG64 DebugControl;
284 ULONG64 LastBranchToRip;
285 ULONG64 LastBranchFromRip;
286 ULONG64 LastExceptionToRip;
287 ULONG64 LastExceptionFromRip;
288} 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:288
uint32_t ULONG
Definition: typedefs.h:59
M128A
Definition: ketypes.h:937

◆ _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 2146 of file kdapi.c.

2147{
2148 /* Use the internal routine */
2150}
#define TRUE
Definition: types.h:120
NTSTATUS NTAPI KdDisableDebuggerWithLock(IN BOOLEAN NeedLock)
Definition: kdapi.c:2040

Referenced by PcipGetFunctionLimits().

◆ KdEnableDebugger()

NTKERNELAPI NTSTATUS NTAPI KdEnableDebugger ( VOID  )

Definition at line 2135 of file kdapi.c.

2136{
2137 /* Use the internal routine */
2139}
NTSTATUS NTAPI KdEnableDebuggerWithLock(IN BOOLEAN NeedLock)
Definition: kdapi.c:1964

Referenced by KdpStub(), and PcipGetFunctionLimits().

◆ KdRefreshDebuggerNotPresent()

NTKERNELAPI BOOLEAN NTAPI KdRefreshDebuggerNotPresent ( VOID  )

Definition at line 2324 of file kdapi.c.

2325{
2326 BOOLEAN Enable, DebuggerNotPresent;
2327
2328 /* Check if the debugger is completely disabled */
2329 if (KdPitchDebugger)
2330 {
2331 /* Don't try to refresh then, fail early */
2332 return TRUE;
2333 }
2334
2335 /* Enter the debugger */
2337
2338 /*
2339 * Attempt to send a string to the debugger
2340 * to refresh the connection state.
2341 */
2342 KdpDprintf("KDTARGET: Refreshing KD connection\n");
2343
2344 /* Save the state while we are holding the lock */
2345 DebuggerNotPresent = KdDebuggerNotPresent;
2346
2347 /* Exit the debugger and return the state */
2349 return DebuggerNotPresent;
2350}
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:1876
VOID NTAPI KdExitDebugger(IN BOOLEAN Enable)
Definition: kdapi.c:1929
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().