ReactOS  0.4.15-dev-1647-g91fceab
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 86 of file kdfuncs.h.

Function Documentation

◆ $endif()

$endif ( _NTDDK_  )

Definition at line 2490 of file iofuncs.h.

2498 {
2499  PriorityInfo->Size = sizeof(IO_PRIORITY_INFO);
2500  PriorityInfo->ThreadPriority = 0xffff;
2501  PriorityInfo->IoPriority = IoPriorityNormal;
2502  PriorityInfo->PagePriority = 0;
2503 }
struct _IO_PRIORITY_INFO IO_PRIORITY_INFO
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD _Inout_ PIO_PRIORITY_INFO PriorityInfo
Definition: fltkernel.h:2653

◆ $if()

$if ( _NTDDK_  )

Definition at line 176 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;
275  } DUMMYSTRUCTNAME;
276  } DUMMYUNIONNAME;
277  M128A VectorRegister[26];
278  ULONG64 VectorControl;
279  ULONG64 DebugControl;
280  ULONG64 LastBranchToRip;
281  ULONG64 LastBranchFromRip;
282  ULONG64 LastExceptionToRip;
283  ULONG64 LastExceptionFromRip;
284 } CONTEXT;
M128A
Definition: ketypes.h:925
#define DUMMYUNIONNAME
Definition: ntbasedef.h:32
Definition: Header.h:8
unsigned __int64 ULONG64
Definition: imports.h:198
struct _CONTEXT CONTEXT
unsigned short USHORT
Definition: pedump.c:61
XSAVE_FORMAT XMM_SAVE_AREA32
Definition: ke.h:35
unsigned int ULONG
Definition: retypes.h:1
#define DUMMYSTRUCTNAME
Definition: ntbasedef.h:58

◆ _Out_writes_bytes_()

_Out_writes_bytes_ ( MaximumResponseLength  )

◆ DbgBreakPoint()

__analysis_noreturn VOID NTAPI DbgBreakPoint ( VOID  )

Definition at line 553 of file mach.c.

553  {
554  __asm__("twi 31,0,0");
555 }
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")

Referenced by __cxa_pure_virtual(), __declspec(), ARPTransmit(), BaseInitializeContext(), CsrApiRequestThread(), CsrCallServerFromServer(), CsrCaptureArguments(), CsrIdentifyAlertableThread(), CsrReleaseCapturedArguments(), CsrSetPriorityClass(), CsrShutdownProcesses(), CsrValidateMessageBuffer(), DbgUiRemoteBreakin(), DeviceInterfaceChangeCallback(), Dispatch_fnDeviceIoControl(), DriverEntry(), EHCI_InterruptTransfer(), EHCI_QueryEndpointRequirements(), EHCI_SetAsyncEndpointState(), EHCI_SetEndpointStatus(), EHCI_SubmitTransfer(), EHCI_SuspendController(), ExAllocatePoolWithTag(), ExpInsertPoolTracker(), ExpRemovePoolTracker(), ExpWaitForResource(), FatalExit(), FatCompleteRequest_Real(), FatExceptionFilter(), FatMultiAsyncCompletionRoutine(), FatMultiSyncCompletionRoutine(), FatSingleAsyncCompletionRoutine(), FatSingleSyncCompletionRoutine(), FxLibraryCommonRegisterClient(), HalClearSoftwareInterrupt(), HalpAddDevice(), HalpGetParameters(), HalpOpcodeInvalid(), HalRequestSoftwareInterrupt(), HalReturnToFirmware(), IKsPin_PinStatePropertyHandler(), KeFlushIoBuffers(), KeStartThread(), KeUpdateRunTime(), KiCheckTimerTable(), KiIpiServiceRoutine(), KsPinAttemptProcessing(), KsStreamPointerAdvance(), KsStreamPointerAdvanceOffsets(), KsStreamPointerAdvanceOffsetsAndUnlock(), KsStreamPointerDelete(), KsStreamPointerGetNextClone(), LdrpInitializeProcess(), LdrpRunInitializeRoutines(), MiSubsectionConsistent(), Mx::MxDbgBreakPoint(), NdisInitializeWrapper(), NtProcessStartup(), ObInsertObject(), OHCI_InsertEndpointInSchedule(), OHCI_PollAsyncEndpoint(), OHCI_QueryEndpointRequirements(), OHCI_RemoveEndpointFromSchedule(), PciBeginStateTransition(), PciDispatchIrp(), PcRegisterSubdevice(), PinPropertyHandler(), PspCatchCriticalBreak(), Reboot(), RtlApplicationVerifierStop(), RtlAssert(), RtlInterlockedPushListSList(), RtlpDphAllocateVm(), RtlpDphEnterCriticalSection(), RtlpDphFreeVm(), RtlpDphPointerFromHandle(), RtlpDphProtectVm(), RtlpDphRemoveFromAvailableList(), RtlpPageHeapAllocate(), RtlpPageHeapDestroy(), RtlpPageHeapFree(), RxAssert(), SetLastError(), SmpAllocateSessionId(), SmpUnhandledExceptionFilter(), SpiParseDeviceInfo(), StreamClassDebugAssert(), UhciInterruptService(), UhciQueryEndpointRequirements(), UhciRHPortResetComplete(), UhciStopController(), USBH_ChangeIndicationWorker(), USBH_CompletePortWakeIrpsWorker(), USBH_DeviceControl(), USBH_FdoIdleNotificationCallback(), USBH_FdoPower(), USBH_FdoQueryBusRelations(), USBH_FdoStartDevice(), USBH_FdoStopDevice(), USBH_FdoWWIrpIoCompletion(), USBH_FlushPortPwrList(), USBH_HubCompleteQueuedPortIdleIrps(), USBH_HubCompleteQueuedPortWakeIrps(), USBH_HubDispatch(), USBH_HubQueuePortIdleIrps(), USBH_HubQueuePortWakeIrps(), USBH_PdoDispatch(), USBH_PdoInternalControl(), USBH_PdoPnP(), USBH_PdoStopDevice(), USBH_PdoUrbFilter(), USBH_PowerIrpCompletion(), USBH_ProcessHubStateChange(), USBH_ProcessPortStateChange(), USBH_SelectConfigOrInterfaceComplete(), USBPORT_AllocateBandwidthUSB2(), USBPORT_Dispatch(), USBPORT_DmaEndpointWorker(), USBPORT_PdoDevicePowerState(), USBPORT_RestoreDevice(), USBPORT_RootHubClassCommand(), USBPORT_RootHubCreateDevice(), USBPORT_SplitBulkInterruptTransfer(), USBPORT_StopDevice(), UserLoadKbdDll(), _FX_DRIVER_GLOBALS::WaitForSignal(), WdfVerifierDbgBreakPoint(), WdmAudControlOpenMixer(), and wmain().

◆ 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
#define TRUE
Definition: types.h:120

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 }
VOID NTAPI KdExitDebugger(IN BOOLEAN Enable)
Definition: kdapi.c:1924
BOOLEAN NTAPI KdEnterDebugger(IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame)
Definition: kdapi.c:1871
#define TRUE
Definition: types.h:120
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
BOOLEAN KdPitchDebugger
Definition: kddata.c:81
BOOLEAN KdDebuggerNotPresent
Definition: kddata.c:82
unsigned char BOOLEAN
#define NULL
Definition: types.h:112
#define KdpDprintf(...)
Definition: mmdbg.c:19

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().