ReactOS  0.4.14-dev-1332-g6db3d88
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 2487 of file iofuncs.h.

2495 {
2496  PriorityInfo->Size = sizeof(IO_PRIORITY_INFO);
2497  PriorityInfo->ThreadPriority = 0xffff;
2498  PriorityInfo->IoPriority = IoPriorityNormal;
2499  PriorityInfo->PagePriority = 0;
2500 }
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:918
#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(), CsrCaptureArguments(), CsrIdentifyAlertableThread(), 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(), HalClearSoftwareInterrupt(), HalpAddDevice(), HalpGetParameters(), HalpOpcodeInvalid(), HalRequestSoftwareInterrupt(), HalReturnToFirmware(), IKsPin_PinStatePropertyHandler(), KeFlushIoBuffers(), KeStartThread(), KeUpdateRunTime(), KiCheckTimerTable(), KiIpiServiceRoutine(), KsPinAttemptProcessing(), KsStreamPointerAdvance(), KsStreamPointerAdvanceOffsets(), KsStreamPointerAdvanceOffsetsAndUnlock(), KsStreamPointerDelete(), KsStreamPointerGetNextClone(), LdrpInitializeProcess(), LdrpRunInitializeRoutines(), MiSubsectionConsistent(), 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(), 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 342 of file kdmain.c.

343 {
344  KIRQL OldIrql;
345 
346  /* Raise IRQL */
348 
349  /* TODO: Disable any breakpoints */
350 
351  /* Disable the Debugger */
353  SharedUserData->KdDebuggerEnabled = FALSE;
354 
355  /* Lower the IRQL */
357 
358  /* Return success */
359  return STATUS_SUCCESS;
360 }
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
UCHAR KIRQL
Definition: env_spec_w32.h:591
BOOLEAN KdDebuggerEnabled
Definition: kdmain.c:48
#define SharedUserData
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by PcipGetFunctionLimits().

◆ KdEnableDebugger()

NTKERNELAPI NTSTATUS NTAPI KdEnableDebugger ( VOID  )

Definition at line 374 of file kdmain.c.

375 {
376  KIRQL OldIrql;
377 
378  /* Raise IRQL */
380 
381  /* TODO: Re-enable any breakpoints */
382 
383  /* Enable the Debugger */
385  SharedUserData->KdDebuggerEnabled = TRUE;
386 
387  /* Lower the IRQL */
389 
390  /* Return success */
391  return STATUS_SUCCESS;
392 }
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define TRUE
Definition: types.h:120
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
UCHAR KIRQL
Definition: env_spec_w32.h:591
BOOLEAN KdDebuggerEnabled
Definition: kdmain.c:48
#define SharedUserData
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by KdpStub(), and PcipGetFunctionLimits().

◆ KdRefreshDebuggerNotPresent()

NTKERNELAPI BOOLEAN NTAPI KdRefreshDebuggerNotPresent ( VOID  )

Definition at line 329 of file kdmain.c.

330 {
332 
333  /* Just return whatever was set previously -- FIXME! */
334  return KdDebuggerNotPresent;
335 }
#define UNIMPLEMENTED
Definition: debug.h:114
BOOLEAN KdDebuggerNotPresent
Definition: kdmain.c:50

Variable Documentation

◆ KdDebuggerEnabled

◆ KdDebuggerNotPresent

◆ MaximumResponseLength

_In_ ULONG MaximumResponseLength

Definition at line 11 of file kdfuncs.h.

Referenced by DbgPrompt(), and KdpPrompt().