ReactOS  0.4.14-dev-368-gfa26425
kd64.h File Reference

Go to the source code of this file.

Classes

struct  _BREAKPOINT_ENTRY
 

Macros

#define KD_DEFAULT_LOG_BUFFER_SIZE   0x1000
 
#define KD_BREAKPOINT_MAX   32
 
#define KD_HIGHEST_USER_BREAKPOINT_ADDRESS   (PVOID)0x60000000
 
#define KD_BREAKPOINT_ACTIVE   0x01
 
#define KD_BREAKPOINT_PENDING   0x02
 
#define KD_BREAKPOINT_SUSPENDED   0x04
 
#define KD_BREAKPOINT_EXPIRED   0x08
 
#define MAX_KD_COMPONENT_TABLE_ENTRIES   147
 

Typedefs

typedef struct _BREAKPOINT_ENTRY BREAKPOINT_ENTRY
 
typedef struct _BREAKPOINT_ENTRYPBREAKPOINT_ENTRY
 
typedef BOOLEAN(NTAPIPKDEBUG_ROUTINE) (IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame, IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context, IN KPROCESSOR_MODE PreviousMode, IN BOOLEAN SecondChance)
 
typedef BOOLEAN(NTAPIPKDEBUG_SWITCH_ROUTINE) (IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context, IN BOOLEAN SecondChance)
 

Functions

BOOLEAN NTAPI KdInitSystem (ULONG Reserved, PLOADER_PARAMETER_BLOCK LoaderBlock)
 
VOID NTAPI KdUpdateDataBlock (VOID)
 
BOOLEAN NTAPI KdIsThisAKdTrap (IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context, IN KPROCESSOR_MODE PreviousMode)
 
BOOLEAN NTAPI KdpSwitchProcessor (IN PEXCEPTION_RECORD ExceptionRecord, IN OUT PCONTEXT ContextRecord, IN BOOLEAN SecondChanceException)
 
VOID NTAPI KdpTimeSlipWork (IN PVOID Context)
 
VOID NTAPI KdpTimeSlipDpcRoutine (IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
 
BOOLEAN NTAPI KdpStub (IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame, IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT ContextRecord, IN KPROCESSOR_MODE PreviousMode, IN BOOLEAN SecondChanceException)
 
BOOLEAN NTAPI KdpTrap (IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame, IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT ContextRecord, IN KPROCESSOR_MODE PreviousMode, IN BOOLEAN SecondChanceException)
 
VOID NTAPI KdpPortLock (VOID)
 
VOID NTAPI KdpPortUnlock (VOID)
 
BOOLEAN NTAPI KdpPollBreakInWithPortLock (VOID)
 
BOOLEAN NTAPI KdEnterDebugger (IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame)
 
VOID NTAPI KdExitDebugger (IN BOOLEAN Enable)
 
NTSTATUS NTAPI KdEnableDebuggerWithLock (IN BOOLEAN NeedLock)
 
NTSTATUS NTAPI KdDisableDebuggerWithLock (IN BOOLEAN NeedLock)
 
NTSTATUS NTAPI KdpPrint (_In_ ULONG ComponentId, _In_ ULONG Level, _In_reads_bytes_(Length) PCHAR String, _In_ USHORT Length, _In_ KPROCESSOR_MODE PreviousMode, _In_ PKTRAP_FRAME TrapFrame, _In_ PKEXCEPTION_FRAME ExceptionFrame, _Out_ PBOOLEAN Handled)
 
USHORT NTAPI KdpPrompt (_In_reads_bytes_(PromptLength) PCHAR PromptString, _In_ USHORT PromptLength, _Out_writes_bytes_(MaximumResponseLength) PCHAR ResponseString, _In_ USHORT MaximumResponseLength, _In_ KPROCESSOR_MODE PreviousMode, _In_ PKTRAP_FRAME TrapFrame, _In_ PKEXCEPTION_FRAME ExceptionFrame)
 
VOID NTAPI KdpSymbol (IN PSTRING DllPath, IN PKD_SYMBOLS_INFO SymbolInfo, IN BOOLEAN Unload, IN KPROCESSOR_MODE PreviousMode, IN PCONTEXT ContextRecord, IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame)
 
VOID NTAPI KdpCommandString (IN PSTRING NameString, IN PSTRING CommandString, IN KPROCESSOR_MODE PreviousMode, IN PCONTEXT ContextRecord, IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame)
 
VOID NTAPI KdpReportLoadSymbolsStateChange (IN PSTRING PathName, IN PKD_SYMBOLS_INFO SymbolInfo, IN BOOLEAN Unload, IN OUT PCONTEXT Context)
 
VOID NTAPI KdpReportCommandStringStateChange (IN PSTRING NameString, IN PSTRING CommandString, IN OUT PCONTEXT Context)
 
BOOLEAN NTAPI KdpReportExceptionStateChange (IN PEXCEPTION_RECORD ExceptionRecord, IN OUT PCONTEXT Context, IN BOOLEAN SecondChanceException)
 
ULONG NTAPI KdpAddBreakpoint (IN PVOID Address)
 
VOID NTAPI KdSetOwedBreakpoints (VOID)
 
BOOLEAN NTAPI KdpDeleteBreakpoint (IN ULONG BpEntry)
 
BOOLEAN NTAPI KdpDeleteBreakpointRange (IN PVOID Base, IN PVOID Limit)
 
VOID NTAPI KdpSuspendBreakPoint (IN ULONG BpEntry)
 
VOID NTAPI KdpRestoreAllBreakpoints (VOID)
 
VOID NTAPI KdpSuspendAllBreakPoints (VOID)
 
NTSTATUS NTAPI KdpAllowDisable (VOID)
 
NTSTATUS NTAPI KdpCopyMemoryChunks (_In_ ULONG64 Address, _In_ PVOID Buffer, _In_ ULONG TotalSize, _In_ ULONG ChunkSize, _In_ ULONG Flags, _Out_opt_ PULONG ActualSize)
 
VOID NTAPI KdpMoveMemory (_In_ PVOID Destination, _In_ PVOID Source, _In_ SIZE_T Length)
 
VOID NTAPI KdpZeroMemory (_In_ PVOID Destination, _In_ SIZE_T Length)
 
VOID NTAPI KdpSysGetVersion (IN PDBGKD_GET_VERSION64 Version)
 
VOID NTAPI KdpGetStateChange (IN PDBGKD_MANIPULATE_STATE64 State, IN PCONTEXT Context)
 
VOID NTAPI KdpSetContextState (IN PDBGKD_ANY_WAIT_STATE_CHANGE WaitStateChange, IN PCONTEXT Context)
 
NTSTATUS NTAPI KdpSysReadMsr (IN ULONG Msr, OUT PLARGE_INTEGER MsrValue)
 
NTSTATUS NTAPI KdpSysWriteMsr (IN ULONG Msr, IN PLARGE_INTEGER MsrValue)
 
NTSTATUS NTAPI KdpSysReadBusData (IN ULONG BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN ULONG Offset, IN PVOID Buffer, IN ULONG Length, OUT PULONG ActualLength)
 
NTSTATUS NTAPI KdpSysWriteBusData (IN ULONG BusDataType, IN ULONG BusNumber, IN ULONG SlotNumber, IN ULONG Offset, IN PVOID Buffer, IN ULONG Length, OUT PULONG ActualLength)
 
NTSTATUS NTAPI KdpSysReadControlSpace (IN ULONG Processor, IN ULONG64 BaseAddress, IN PVOID Buffer, IN ULONG Length, OUT PULONG ActualLength)
 
NTSTATUS NTAPI KdpSysWriteControlSpace (IN ULONG Processor, IN ULONG64 BaseAddress, IN PVOID Buffer, IN ULONG Length, OUT PULONG ActualLength)
 
NTSTATUS NTAPI KdpSysReadIoSpace (IN ULONG InterfaceType, IN ULONG BusNumber, IN ULONG AddressSpace, IN ULONG64 IoAddress, IN PVOID DataValue, IN ULONG DataSize, OUT PULONG ActualDataSize)
 
NTSTATUS NTAPI KdpSysWriteIoSpace (IN ULONG InterfaceType, IN ULONG BusNumber, IN ULONG AddressSpace, IN ULONG64 IoAddress, IN PVOID DataValue, IN ULONG DataSize, OUT PULONG ActualDataSize)
 
NTSTATUS NTAPI KdpSysCheckLowMemory (IN ULONG Flags)
 
VOID __cdecl KdpDprintf (_In_ PCHAR Format,...)
 

Variables

DBGKD_GET_VERSION64 KdVersionBlock
 
KDDEBUGGER_DATA64 KdDebuggerDataBlock
 
LIST_ENTRY KdpDebuggerDataListHead
 
KSPIN_LOCK KdpDataSpinLock
 
LARGE_INTEGER KdPerformanceCounterRate
 
LARGE_INTEGER KdTimerStart
 
ULONG KdDisableCount
 
KD_CONTEXT KdpContext
 
PKDEBUG_ROUTINE KiDebugRoutine
 
PKDEBUG_SWITCH_ROUTINE KiDebugSwitchRoutine
 
BOOLEAN KdBreakAfterSymbolLoad
 
BOOLEAN KdPitchDebugger
 
BOOLEAN KdAutoEnableOnEvent
 
BOOLEAN KdBlockEnable
 
BOOLEAN KdIgnoreUmExceptions
 
BOOLEAN KdPreviouslyEnabled
 
BOOLEAN KdpDebuggerStructuresInitialized
 
BOOLEAN KdEnteredDebugger
 
KDPC KdpTimeSlipDpc
 
KTIMER KdpTimeSlipTimer
 
WORK_QUEUE_ITEM KdpTimeSlipWorkItem
 
LONG KdpTimeSlipPending
 
PKEVENT KdpTimeSlipEvent
 
KSPIN_LOCK KdpTimeSlipEventLock
 
BOOLEAN KdpPortLocked
 
BOOLEAN KdpControlCPressed
 
BOOLEAN KdpContextSent
 
KSPIN_LOCK KdpDebuggerLock
 
LARGE_INTEGER KdTimerStop
 
LARGE_INTEGER KdTimerDifference
 
CHAR KdpMessageBuffer [0x1000]
 
CHAR KdpPathBuffer [0x1000]
 
CHAR KdPrintDefaultCircularBuffer [KD_DEFAULT_LOG_BUFFER_SIZE]
 
BREAKPOINT_ENTRY KdpBreakpointTable [KD_BREAKPOINT_MAX]
 
KD_BREAKPOINT_TYPE KdpBreakpointInstruction
 
BOOLEAN KdpOweBreakpoint
 
BOOLEAN BreakpointsSuspended
 
ULONG KdpNumInternalBreakpoints
 
ULONG_PTR KdpCurrentSymbolStart
 
ULONG_PTR KdpCurrentSymbolEnd
 
ULONG TraceDataBuffer [40]
 
ULONG TraceDataBufferPosition
 
ULONG KdComponentTableSize
 
PULONG KdComponentTable [MAX_KD_COMPONENT_TABLE_ENTRIES]
 
ULONG Kd_WIN2000_Mask
 
ULONG Kd_SYSTEM_Mask
 
ULONG Kd_SMSS_Mask
 
ULONG Kd_SETUP_Mask
 
ULONG Kd_NTFS_Mask
 
ULONG Kd_FSTUB_Mask
 
ULONG Kd_CRASHDUMP_Mask
 
ULONG Kd_CDAUDIO_Mask
 
ULONG Kd_CDROM_Mask
 
ULONG Kd_CLASSPNP_Mask
 
ULONG Kd_DISK_Mask
 
ULONG Kd_REDBOOK_Mask
 
ULONG Kd_STORPROP_Mask
 
ULONG Kd_SCSIPORT_Mask
 
ULONG Kd_SCSIMINIPORT_Mask
 
ULONG Kd_CONFIG_Mask
 
ULONG Kd_I8042PRT_Mask
 
ULONG Kd_SERMOUSE_Mask
 
ULONG Kd_LSERMOUS_Mask
 
ULONG Kd_KBDHID_Mask
 
ULONG Kd_MOUHID_Mask
 
ULONG Kd_KBDCLASS_Mask
 
ULONG Kd_MOUCLASS_Mask
 
ULONG Kd_TWOTRACK_Mask
 
ULONG Kd_WMILIB_Mask
 
ULONG Kd_ACPI_Mask
 
ULONG Kd_AMLI_Mask
 
ULONG Kd_HALIA64_Mask
 
ULONG Kd_VIDEO_Mask
 
ULONG Kd_SVCHOST_Mask
 
ULONG Kd_VIDEOPRT_Mask
 
ULONG Kd_TCPIP_Mask
 
ULONG Kd_DMSYNTH_Mask
 
ULONG Kd_NTOSPNP_Mask
 
ULONG Kd_FASTFAT_Mask
 
ULONG Kd_SAMSS_Mask
 
ULONG Kd_PNPMGR_Mask
 
ULONG Kd_NETAPI_Mask
 
ULONG Kd_SCSERVER_Mask
 
ULONG Kd_SCCLIENT_Mask
 
ULONG Kd_SERIAL_Mask
 
ULONG Kd_SERENUM_Mask
 
ULONG Kd_UHCD_Mask
 
ULONG Kd_RPCPROXY_Mask
 
ULONG Kd_AUTOCHK_Mask
 
ULONG Kd_DCOMSS_Mask
 
ULONG Kd_UNIMODEM_Mask
 
ULONG Kd_SIS_Mask
 
ULONG Kd_FLTMGR_Mask
 
ULONG Kd_WMICORE_Mask
 
ULONG Kd_BURNENG_Mask
 
ULONG Kd_IMAPI_Mask
 
ULONG Kd_SXS_Mask
 
ULONG Kd_FUSION_Mask
 
ULONG Kd_IDLETASK_Mask
 
ULONG Kd_SOFTPCI_Mask
 
ULONG Kd_TAPE_Mask
 
ULONG Kd_MCHGR_Mask
 
ULONG Kd_IDEP_Mask
 
ULONG Kd_PCIIDE_Mask
 
ULONG Kd_FLOPPY_Mask
 
ULONG Kd_FDC_Mask
 
ULONG Kd_TERMSRV_Mask
 
ULONG Kd_W32TIME_Mask
 
ULONG Kd_PREFETCHER_Mask
 
ULONG Kd_RSFILTER_Mask
 
ULONG Kd_FCPORT_Mask
 
ULONG Kd_PCI_Mask
 
ULONG Kd_DMIO_Mask
 
ULONG Kd_DMCONFIG_Mask
 
ULONG Kd_DMADMIN_Mask
 
ULONG Kd_WSOCKTRANSPORT_Mask
 
ULONG Kd_VSS_Mask
 
ULONG Kd_PNPMEM_Mask
 
ULONG Kd_PROCESSOR_Mask
 
ULONG Kd_DMSERVER_Mask
 
ULONG Kd_SR_Mask
 
ULONG Kd_INFINIBAND_Mask
 
ULONG Kd_IHVDRIVER_Mask
 
ULONG Kd_IHVVIDEO_Mask
 
ULONG Kd_IHVAUDIO_Mask
 
ULONG Kd_IHVNETWORK_Mask
 
ULONG Kd_IHVSTREAMING_Mask
 
ULONG Kd_IHVBUS_Mask
 
ULONG Kd_HPS_Mask
 
ULONG Kd_RTLTHREADPOOL_Mask
 
ULONG Kd_LDR_Mask
 
ULONG Kd_TCPIP6_Mask
 
ULONG Kd_ISAPNP_Mask
 
ULONG Kd_SHPC_Mask
 
ULONG Kd_STORPORT_Mask
 
ULONG Kd_STORMINIPORT_Mask
 
ULONG Kd_PRINTSPOOLER_Mask
 
ULONG Kd_VSSDYNDISK_Mask
 
ULONG Kd_VERIFIER_Mask
 
ULONG Kd_VDS_Mask
 
ULONG Kd_VDSBAS_Mask
 
ULONG Kd_VDSDYN_Mask
 
ULONG Kd_VDSDYNDR_Mask
 
ULONG Kd_VDSLDR_Mask
 
ULONG Kd_VDSUTIL_Mask
 
ULONG Kd_DFRGIFC_Mask
 
ULONG Kd_DEFAULT_Mask
 
ULONG Kd_MM_Mask
 
ULONG Kd_DFSC_Mask
 
ULONG Kd_WOW64_Mask
 
ULONG Kd_ALPC_Mask
 
ULONG Kd_WDI_Mask
 
ULONG Kd_PERFLIB_Mask
 
ULONG Kd_KTM_Mask
 
ULONG Kd_IOSTRESS_Mask
 
ULONG Kd_HEAP_Mask
 
ULONG Kd_WHEA_Mask
 
ULONG Kd_USERGDI_Mask
 
ULONG Kd_MMCSS_Mask
 
ULONG Kd_TPM_Mask
 
ULONG Kd_THREADORDER_Mask
 
ULONG Kd_ENVIRON_Mask
 
ULONG Kd_EMS_Mask
 
ULONG Kd_WDT_Mask
 
ULONG Kd_FVEVOL_Mask
 
ULONG Kd_NDIS_Mask
 
ULONG Kd_NVCTRACE_Mask
 
ULONG Kd_LUAFV_Mask
 
ULONG Kd_APPCOMPAT_Mask
 
ULONG Kd_USBSTOR_Mask
 
ULONG Kd_SBP2PORT_Mask
 
ULONG Kd_COVERAGE_Mask
 
ULONG Kd_CACHEMGR_Mask
 
ULONG Kd_MOUNTMGR_Mask
 
ULONG Kd_CFR_Mask
 
ULONG Kd_TXF_Mask
 
ULONG Kd_KSECDD_Mask
 
ULONG Kd_FLTREGRESS_Mask
 
ULONG Kd_MPIO_Mask
 
ULONG Kd_MSDSM_Mask
 
ULONG Kd_UDFS_Mask
 
ULONG Kd_PSHED_Mask
 
ULONG Kd_STORVSP_Mask
 
ULONG Kd_LSASS_Mask
 
ULONG Kd_SSPICLI_Mask
 
ULONG Kd_CNG_Mask
 
ULONG Kd_EXFAT_Mask
 
ULONG Kd_FILETRACE_Mask
 
ULONG Kd_XSAVE_Mask
 
ULONG Kd_SE_Mask
 
ULONG Kd_DRIVEEXTENDER_Mask
 

Macro Definition Documentation

◆ KD_BREAKPOINT_ACTIVE

#define KD_BREAKPOINT_ACTIVE   0x01

Definition at line 40 of file kd64.h.

◆ KD_BREAKPOINT_EXPIRED

#define KD_BREAKPOINT_EXPIRED   0x08

Definition at line 43 of file kd64.h.

◆ KD_BREAKPOINT_MAX

#define KD_BREAKPOINT_MAX   32

Definition at line 23 of file kd64.h.

◆ KD_BREAKPOINT_PENDING

#define KD_BREAKPOINT_PENDING   0x02

Definition at line 41 of file kd64.h.

◆ KD_BREAKPOINT_SUSPENDED

#define KD_BREAKPOINT_SUSPENDED   0x04

Definition at line 42 of file kd64.h.

◆ KD_DEFAULT_LOG_BUFFER_SIZE

#define KD_DEFAULT_LOG_BUFFER_SIZE   0x1000

Definition at line 17 of file kd64.h.

◆ KD_HIGHEST_USER_BREAKPOINT_ADDRESS

#define KD_HIGHEST_USER_BREAKPOINT_ADDRESS   (PVOID)0x60000000

Definition at line 35 of file kd64.h.

◆ MAX_KD_COMPONENT_TABLE_ENTRIES

#define MAX_KD_COMPONENT_TABLE_ENTRIES   147

Definition at line 564 of file kd64.h.

Typedef Documentation

◆ BREAKPOINT_ENTRY

◆ PBREAKPOINT_ENTRY

◆ PKDEBUG_ROUTINE

typedef BOOLEAN(NTAPI * PKDEBUG_ROUTINE) (IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame, IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context, IN KPROCESSOR_MODE PreviousMode, IN BOOLEAN SecondChance)

Definition at line 61 of file kd64.h.

◆ PKDEBUG_SWITCH_ROUTINE

typedef BOOLEAN(NTAPI * PKDEBUG_SWITCH_ROUTINE) (IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context, IN BOOLEAN SecondChance)

Definition at line 72 of file kd64.h.

Function Documentation

◆ KdDisableDebuggerWithLock()

NTSTATUS NTAPI KdDisableDebuggerWithLock ( IN BOOLEAN  NeedLock)

Referenced by KdInitSystem().

◆ KdEnableDebuggerWithLock()

NTSTATUS NTAPI KdEnableDebuggerWithLock ( IN BOOLEAN  NeedLock)

Definition at line 361 of file kdmain.c.

362 {
363  return STATUS_ACCESS_DENIED;
364 }
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145

Referenced by KeBugCheckWithTf().

◆ KdEnterDebugger()

BOOLEAN NTAPI KdEnterDebugger ( IN PKTRAP_FRAME  TrapFrame,
IN PKEXCEPTION_FRAME  ExceptionFrame 
)

Definition at line 309 of file kdmain.c.

311 {
312  return FALSE;
313 }

Referenced by KdpPrint(), KdpPrompt(), KdpReport(), and KdSetOwedBreakpoints().

◆ KdExitDebugger()

VOID NTAPI KdExitDebugger ( IN BOOLEAN  Enable)

Definition at line 317 of file kdmain.c.

318 {
319 }

Referenced by KdpPrint(), KdpPrompt(), KdpReport(), and KdSetOwedBreakpoints().

◆ KdInitSystem()

BOOLEAN NTAPI KdInitSystem ( ULONG  Reserved,
PLOADER_PARAMETER_BLOCK  LoaderBlock 
)

Definition at line 169 of file kdinit.c.

171 {
172  ULONG Value;
173  ULONG i;
174  PCHAR CommandLine, Port = NULL, BaudRate = NULL, Irq = NULL;
175 
176  /* Set Default Port Options */
177  if (BootPhase == 0)
178  {
179  /* Check if we have a loader block */
180  if (LoaderBlock)
181  {
182  /* Check if we have a command line */
183  CommandLine = LoaderBlock->LoadOptions;
184  if (CommandLine)
185  {
186  /* Upcase it */
187  _strupr(CommandLine);
188 
189  /* XXX Check for settings that we support */
190  if (strstr(CommandLine, "NODEBUG")) KdDebuggerEnabled = FALSE;
191  else if (strstr(CommandLine, "CRASHDEBUG")) KdDebuggerEnabled = FALSE;
192  else if (strstr(CommandLine, "DEBUG"))
193  {
194  /* Enable the kernel debugger */
197 #ifdef KDBG
198  /* Get the KDBG Settings */
200 #endif
201  }
202 
203  /* Get the port and baud rate */
204  Port = strstr(CommandLine, "DEBUGPORT");
205  BaudRate = strstr(CommandLine, "BAUDRATE");
206  Irq = strstr(CommandLine, "IRQ");
207  }
208  else
209  {
210  /* No command line options? Disable debugger by default */
212  }
213  }
214  else
215  {
216  /* Called from a bugcheck or a re-enable. Unconditionally enable KD. */
218  }
219 
220  /* Let user-mode know our state */
221  SharedUserData->KdDebuggerEnabled = KdDebuggerEnabled;
222 
223  /* Check if we got the /DEBUGPORT parameter(s) */
224  while (Port)
225  {
226  /* Move past the actual string, to reach the port*/
227  Port += sizeof("DEBUGPORT") - 1;
228 
229  /* Now get past any spaces and skip the equal sign */
230  while (*Port == ' ') Port++;
231  Port++;
232 
233  /* Get the debug mode and wrapper */
235  Port = strstr(Port, "DEBUGPORT");
236  }
237 
238  /* Use serial port then */
239  if (KdDebuggerEnabled && KdpDebugMode.Value == 0)
240  KdpDebugMode.Serial = TRUE;
241 
242  /* Check if we got a baud rate */
243  if (BaudRate)
244  {
245  /* Move past the actual string, to reach the rate */
246  BaudRate += sizeof("BAUDRATE") - 1;
247 
248  /* Now get past any spaces */
249  while (*BaudRate == ' ') BaudRate++;
250 
251  /* And make sure we have a rate */
252  if (*BaudRate)
253  {
254  /* Read and set it */
255  Value = atol(BaudRate + 1);
257  }
258  }
259 
260  /* Check Serial Port Settings [IRQ] */
261  if (Irq)
262  {
263  /* Move past the actual string, to reach the rate */
264  Irq += sizeof("IRQ") - 1;
265 
266  /* Now get past any spaces */
267  while (*Irq == ' ') Irq++;
268 
269  /* And make sure we have an IRQ */
270  if (*Irq)
271  {
272  /* Read and set it */
273  Value = atol(Irq + 1);
274  if (Value) KdpPortIrq = Value;
275  }
276  }
277 
278  /* Call Providers at Phase 0 */
279  for (i = 0; i < KdMax; i++)
280  {
281  InitRoutines[i](&DispatchTable[i], 0);
282  }
283 
284  /* Call Wrapper at Phase 0 */
286  return TRUE;
287  }
288  else /* BootPhase > 0 */
289  {
290  }
291 
292  /* Call the Initialization Routines of the Registered Providers */
293  KdpCallInitRoutine(BootPhase);
294 
295  /* Return success */
296  return TRUE;
297 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
signed char * PCHAR
Definition: retypes.h:7
CPPORT Port[4]
Definition: headless.c:34
#define TRUE
Definition: types.h:120
INIT_FUNCTION PCHAR NTAPI KdpGetDebugMode(PCHAR Currentp2)
Definition: kdinit.c:45
KDP_DEBUG_MODE KdpDebugMode
Definition: kdinit.c:25
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
CPPORT PortInfo
Definition: kdinit.c:20
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
KD_DISPATCH_TABLE DispatchTable[KdMax]
Definition: kdinit.c:30
smooth NULL
Definition: ftsmooth.c:416
BOOLEAN KdDebuggerEnabled
Definition: kdmain.c:48
PKDP_INIT_ROUTINE InitRoutines[KdMax]
Definition: kdinit.c:32
INIT_FUNCTION VOID NTAPI KdpCallInitRoutine(ULONG BootPhase)
Definition: kdinit.c:141
ULONG KdpPortIrq
Definition: kdinit.c:21
_Check_return_ long __cdecl atol(_In_z_ const char *_Str)
#define SharedUserData
INIT_FUNCTION VOID NTAPI KdbpGetCommandLineSettings(PCHAR p1)
Definition: kdb.c:1697
PKDP_INIT_ROUTINE WrapperInitRoutine
Definition: kdinit.c:27
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
ULONG BaudRate
Definition: cportlib.h:30
CPPORT SerialPortInfo
Definition: kdio.c:31
KD_DISPATCH_TABLE WrapperTable
Definition: kdinit.c:28
unsigned int ULONG
Definition: retypes.h:1
BOOLEAN KdDebuggerNotPresent
Definition: kdmain.c:50

Referenced by IoInitSystem(), KeEnterKernelDebugger(), KiInitializeSystem(), KiSystemStartup(), KiSystemStartupReal(), and Phase1InitializationDiscard().

◆ KdIsThisAKdTrap()

BOOLEAN NTAPI KdIsThisAKdTrap ( IN PEXCEPTION_RECORD  ExceptionRecord,
IN PCONTEXT  Context,
IN KPROCESSOR_MODE  PreviousMode 
)

Definition at line 291 of file kdmain.c.

294 {
295  /* KDBG has its own mechanism for ignoring user mode exceptions */
296  return FALSE;
297 }

Referenced by KiDispatchException().

◆ KdpAddBreakpoint()

ULONG NTAPI KdpAddBreakpoint ( IN PVOID  Address)

Definition at line 20 of file kdbreak.c.

21 {
22  KD_BREAKPOINT_TYPE Content;
23  ULONG i;
25 
26  /* Check whether we are not setting a breakpoint twice */
27  for (i = 0; i < KD_BREAKPOINT_MAX; i++)
28  {
29  /* Check if the breakpoint is valid */
32  {
33  /* Were we not able to remove it earlier? */
35  {
36  /* Just re-use it! */
38  return i + 1;
39  }
40  else
41  {
42  /* Fail */
43  return 0;
44  }
45  }
46  }
47 
48  /* Find a free entry */
49  for (i = 0; i < KD_BREAKPOINT_MAX; i++)
50  {
51  if (KdpBreakpointTable[i].Flags == 0)
52  break;
53  }
54 
55  /* Fail if no free entry was found */
56  if (i == KD_BREAKPOINT_MAX) return 0;
57 
58  /* Save the breakpoint */
60 
61  /* If we are setting the breakpoint in user space, save the active process context */
63  KdpBreakpointTable[i].DirectoryTableBase = KeGetCurrentThread()->ApcState.Process->DirectoryTableBase[0];
64 
65  /* Try to save the old instruction */
67  &Content,
69  0,
71  NULL);
72  if (NT_SUCCESS(Status))
73  {
74  /* Memory accessible, set the breakpoint */
75  KdpBreakpointTable[i].Content = Content;
77 
78  /* Write the breakpoint */
82  0,
84  NULL);
85  if (!NT_SUCCESS(Status))
86  {
87  /* This should never happen */
88  KdpDprintf("Unable to write breakpoint to address 0x%p\n", Address);
89  }
90  }
91  else
92  {
93  /* Memory is inaccessible now, setting breakpoint is deferred */
94  KdpDprintf("Failed to set breakpoint at address 0x%p, adding deferred breakpoint.\n", Address);
97  }
98 
99  /* Return the breakpoint handle */
100  return i + 1;
101 }
#define TRUE
Definition: types.h:120
NTSTATUS NTAPI KdpCopyMemoryChunks(_In_ ULONG64 Address, _In_ PVOID Buffer, _In_ ULONG TotalSize, _In_ ULONG ChunkSize, _In_ ULONG Flags, _Out_opt_ PULONG ActualSize)
Definition: kdapi.c:50
LONG NTSTATUS
Definition: precomp.h:26
uint32_t ULONG_PTR
Definition: typedefs.h:63
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
ULONG_PTR DirectoryTableBase
Definition: kd64.h:51
BOOLEAN KdpOweBreakpoint
Definition: kddata.c:102
smooth NULL
Definition: ftsmooth.c:416
static WCHAR Address[46]
Definition: ping.c:68
#define MMDBG_COPY_WRITE
Definition: mm.h:53
ULONG Flags
Definition: kd64.h:50
#define KD_BREAKPOINT_PENDING
Definition: kd64.h:41
#define KD_HIGHEST_USER_BREAKPOINT_ADDRESS
Definition: kd64.h:35
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
KD_BREAKPOINT_TYPE Content
Definition: kd64.h:53
KD_BREAKPOINT_TYPE KdpBreakpointInstruction
Definition: kddata.c:101
#define KD_BREAKPOINT_MAX
Definition: kd64.h:23
Status
Definition: gdiplustypes.h:24
#define KD_BREAKPOINT_TYPE
Definition: ke.h:117
#define MMDBG_COPY_UNSAFE
Definition: mm.h:55
BREAKPOINT_ENTRY KdpBreakpointTable[KD_BREAKPOINT_MAX]
Definition: kddata.c:100
#define KdpDprintf
Definition: mmdbg.c:19
PVOID Address
Definition: kd64.h:52
unsigned int ULONG
Definition: retypes.h:1
#define KD_BREAKPOINT_SIZE
Definition: ke.h:118
#define KeGetCurrentThread
Definition: hal.h:44
#define KD_BREAKPOINT_EXPIRED
Definition: kd64.h:43
#define KD_BREAKPOINT_ACTIVE
Definition: kd64.h:40

◆ KdpAllowDisable()

NTSTATUS NTAPI KdpAllowDisable ( VOID  )

Definition at line 364 of file kdx64.c.

365 {
367  return STATUS_ACCESS_DENIED;
368 }
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ KdpCommandString()

VOID NTAPI KdpCommandString ( IN PSTRING  NameString,
IN PSTRING  CommandString,
IN KPROCESSOR_MODE  PreviousMode,
IN PCONTEXT  ContextRecord,
IN PKTRAP_FRAME  TrapFrame,
IN PKEXCEPTION_FRAME  ExceptionFrame 
)

Referenced by KdpTrap().

◆ KdpCopyMemoryChunks()

NTSTATUS NTAPI KdpCopyMemoryChunks ( _In_ ULONG64  Address,
_In_ PVOID  Buffer,
_In_ ULONG  TotalSize,
_In_ ULONG  ChunkSize,
_In_ ULONG  Flags,
_Out_opt_ PULONG  ActualSize 
)

Definition at line 50 of file kdapi.c.

57 {
59  ULONG RemainingLength, CopyChunk;
60 
61  /* Check if we didn't get a chunk size or if it is too big */
62  if (ChunkSize == 0)
63  {
64  /* Default to 4 byte chunks */
65  ChunkSize = 4;
66  }
67  else if (ChunkSize > MMDBG_COPY_MAX_SIZE)
68  {
69  /* Normalize to maximum size */
71  }
72 
73  /* Copy the whole range in aligned chunks */
74  RemainingLength = TotalSize;
75  CopyChunk = 1;
76  while (RemainingLength > 0)
77  {
78  /*
79  * Determine the best chunk size for this round.
80  * The ideal size is aligned, isn't larger than the
81  * the remaining length and respects the chunk limit.
82  */
83  while (((CopyChunk * 2) <= RemainingLength) &&
84  (CopyChunk < ChunkSize) &&
85  ((Address & ((CopyChunk * 2) - 1)) == 0))
86  {
87  /* Increase it */
88  CopyChunk *= 2;
89  }
90 
91  /*
92  * The chunk size can be larger than the remaining size if this
93  * isn't the first round, so check if we need to shrink it back.
94  */
95  while (CopyChunk > RemainingLength)
96  {
97  /* Shrink it */
98  CopyChunk /= 2;
99  }
100 
101  /* Do the copy */
102  Status = MmDbgCopyMemory(Address, Buffer, CopyChunk, Flags);
103  if (!NT_SUCCESS(Status))
104  {
105  /* Copy failed, break out */
106  break;
107  }
108 
109  /* Update pointers and length for the next run */
110  Address = Address + CopyChunk;
111  Buffer = (PVOID)((ULONG_PTR)Buffer + CopyChunk);
112  RemainingLength = RemainingLength - CopyChunk;
113  }
114 
115  /* We may have modified executable code, flush the instruction cache */
116  KeSweepICache((PVOID)(ULONG_PTR)Address, TotalSize);
117 
118  /*
119  * Return the size we managed to copy and return
120  * success if we could copy the whole range.
121  */
122  if (ActualSize) *ActualSize = TotalSize - RemainingLength;
123  return RemainingLength == 0 ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
124 }
LONG NTSTATUS
Definition: precomp.h:26
uint32_t ULONG_PTR
Definition: typedefs.h:63
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_Inout_ PUCHAR _In_ PUCHAR _Out_ PUCHAR _Out_ PULONG ChunkSize
Definition: rtlfuncs.h:2276
static WCHAR Address[46]
Definition: ping.c:68
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI MmDbgCopyMemory(IN ULONG64 Address, IN PVOID Buffer, IN ULONG Size, IN ULONG Flags)
Definition: mmdbg.c:126
#define MMDBG_COPY_MAX_SIZE
Definition: mm.h:63
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2938
FORCEINLINE VOID KeSweepICache(IN PVOID BaseAddress, IN SIZE_T FlushSize)
Definition: ke.h:217

Referenced by GspReadMemSafe(), GspWriteMemSafe(), KdbpSafeReadMemory(), KdbpSafeWriteMemory(), KdpAddBreakpoint(), KdpLowRestoreBreakpoint(), KdpLowWriteContent(), KdpSysReadControlSpace(), KdpSysWriteControlSpace(), and KdSetOwedBreakpoints().

◆ KdpDeleteBreakpoint()

BOOLEAN NTAPI KdpDeleteBreakpoint ( IN ULONG  BpEntry)

Definition at line 311 of file kdbreak.c.

312 {
313  ULONG BpIndex = BpEntry - 1;
314 
315  /* Check for invalid breakpoint entry */
316  if (!BpEntry || (BpEntry > KD_BREAKPOINT_MAX)) return FALSE;
317 
318  /* If the specified breakpoint table entry is not valid, then return FALSE. */
319  if (!KdpBreakpointTable[BpIndex].Flags) return FALSE;
320 
321  /* Check if the breakpoint is suspended */
323  {
324  /* Check if breakpoint is not being deleted */
326  {
327  /* Invalidate it and return success */
328  KdpBreakpointTable[BpIndex].Flags = 0;
329  return TRUE;
330  }
331  }
332 
333  /* Restore original data, then invalidate it and return success */
334  if (KdpLowWriteContent(BpIndex)) KdpBreakpointTable[BpIndex].Flags = 0;
335  return TRUE;
336 }
#define TRUE
Definition: types.h:120
#define KD_BREAKPOINT_SUSPENDED
Definition: kd64.h:42
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
BOOLEAN NTAPI KdpLowWriteContent(IN ULONG BpIndex)
Definition: kdbreak.c:226
ULONG Flags
Definition: kd64.h:50
#define KD_BREAKPOINT_MAX
Definition: kd64.h:23
BREAKPOINT_ENTRY KdpBreakpointTable[KD_BREAKPOINT_MAX]
Definition: kddata.c:100
unsigned int ULONG
Definition: retypes.h:1
#define KD_BREAKPOINT_EXPIRED
Definition: kd64.h:43

Referenced by KdpDeleteBreakpointRange().

◆ KdpDeleteBreakpointRange()

BOOLEAN NTAPI KdpDeleteBreakpointRange ( IN PVOID  Base,
IN PVOID  Limit 
)

Definition at line 340 of file kdbreak.c.

342 {
343  ULONG BpIndex;
344  BOOLEAN DeletedBreakpoints;
345 
346  /* Assume no breakpoints will be deleted */
347  DeletedBreakpoints = FALSE;
348 
349  /* Loop the breakpoint table */
350  for (BpIndex = 0; BpIndex < KD_BREAKPOINT_MAX; BpIndex++)
351  {
352  /* Make sure that the breakpoint is active and matches the range. */
353  if ((KdpBreakpointTable[BpIndex].Flags & KD_BREAKPOINT_ACTIVE) &&
354  ((KdpBreakpointTable[BpIndex].Address >= Base) &&
355  (KdpBreakpointTable[BpIndex].Address <= Limit)))
356  {
357  /* Delete it, and remember if we succeeded at least once */
358  if (KdpDeleteBreakpoint(BpIndex + 1)) DeletedBreakpoints = TRUE;
359  }
360  }
361 
362  /* Return whether we deleted anything */
363  return DeletedBreakpoints;
364 }
#define TRUE
Definition: types.h:120
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2343
BOOLEAN NTAPI KdpDeleteBreakpoint(IN ULONG BpEntry)
Definition: kdbreak.c:311
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
unsigned char BOOLEAN
static WCHAR Address[46]
Definition: ping.c:68
#define KD_BREAKPOINT_MAX
Definition: kd64.h:23
BREAKPOINT_ENTRY KdpBreakpointTable[KD_BREAKPOINT_MAX]
Definition: kddata.c:100
unsigned int ULONG
Definition: retypes.h:1
_In_ LONG _In_ LONG Limit
Definition: kefuncs.h:328
#define KD_BREAKPOINT_ACTIVE
Definition: kd64.h:40

◆ KdpDprintf()

VOID __cdecl KdpDprintf ( _In_ PCHAR  Format,
  ... 
)

Definition at line 431 of file kdprint.c.

434 {
435  STRING String;
436  USHORT Length;
437  va_list ap;
438  CHAR Buffer[100];
439 
440  /* Format the string */
441  va_start(ap, Format);
443  sizeof(Buffer),
444  Format,
445  ap);
446  va_end(ap);
447 
448  /* Set it up */
449  String.Buffer = Buffer;
450  String.Length = String.MaximumLength = Length;
451 
452  /* Send it to the debugger directly */
454 }
char CHAR
Definition: xmlstorage.h:175
static WCHAR String[]
Definition: stringtable.c:55
BOOLEAN NTAPI KdpPrintString(_In_ PSTRING Output)
Definition: kdio.c:590
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
Definition: bufpool.h:45
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
std::wstring STRING
Definition: fontsub.cpp:33
unsigned short USHORT
Definition: pedump.c:61
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define _vsnprintf
Definition: xmlstorage.h:202
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char * Format
Definition: acpixf.h:1212

◆ KdpGetStateChange()

VOID NTAPI KdpGetStateChange ( IN PDBGKD_MANIPULATE_STATE64  State,
IN PCONTEXT  Context 
)

Definition at line 22 of file kdx64.c.

24 {
25  PKPRCB Prcb;
26  ULONG i;
27 
28  /* Check for success */
29  if (NT_SUCCESS(State->u.Continue2.ContinueStatus))
30  {
31  /* Check if we're tracing */
32  if (State->u.Continue2.ControlSet.TraceFlag)
33  {
34  /* Enable TF */
35  Context->EFlags |= EFLAGS_TF;
36  }
37  else
38  {
39  /* Remove it */
40  Context->EFlags &= ~EFLAGS_TF;
41  }
42 
43  /* Loop all processors */
44  for (i = 0; i < KeNumberProcessors; i++)
45  {
46  /* Get the PRCB and update DR7 and DR6 */
47  Prcb = KiProcessorBlock[i];
49  State->u.Continue2.ControlSet.Dr7;
51  }
52 
53  /* Check if we have new symbol information */
54  if (State->u.Continue2.ControlSet.CurrentSymbolStart != 1)
55  {
56  /* Update it */
58  State->u.Continue2.ControlSet.CurrentSymbolStart;
59  KdpCurrentSymbolEnd= State->u.Continue2.ControlSet.CurrentSymbolEnd;
60  }
61  }
62 }
ULONG64 KernelDr7
Definition: ketypes.h:505
KSPECIAL_REGISTERS SpecialRegisters
Definition: ketypes.h:530
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
ULONG_PTR KdpCurrentSymbolEnd
Definition: kddata.c:109
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
KPROCESSOR_STATE ProcessorState
Definition: ketypes.h:579
ULONG_PTR KdpCurrentSymbolStart
Definition: kddata.c:109
#define EFLAGS_TF
Definition: ketypes.h:125
CCHAR KeNumberProcessors
Definition: krnlinit.c:35
PKPRCB KiProcessorBlock[]
Definition: krnlinit.c:32
unsigned int ULONG
Definition: retypes.h:1
ULONG64 KernelDr6
Definition: ketypes.h:504

◆ KdpMoveMemory()

VOID NTAPI KdpMoveMemory ( _In_ PVOID  Destination,
_In_ PVOID  Source,
_In_ SIZE_T  Length 
)

Definition at line 22 of file kdapi.c.

26 {
27  PCHAR DestinationBytes, SourceBytes;
28 
29  /* Copy the buffers 1 byte at a time */
30  DestinationBytes = Destination;
31  SourceBytes = Source;
32  while (Length--) *DestinationBytes++ = *SourceBytes++;
33 }
signed char * PCHAR
Definition: retypes.h:7
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2891
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167

Referenced by KdpEnterDebuggerException(), KdpPrint(), KdpPrompt(), and KdpReport().

◆ KdpPollBreakInWithPortLock()

BOOLEAN NTAPI KdpPollBreakInWithPortLock ( VOID  )

Definition at line 35 of file kdlock.c.

36 {
37  BOOLEAN DoBreak = FALSE;
38 
39  /* First make sure that KD is enabled */
41  {
42  /* Check if a CTRL-C is in the queue */
44  {
45  /* Set it and prepare for break */
46  DoBreak = TRUE;
48  }
49  else
50  {
51  /* Now get a packet */
53  NULL,
54  NULL,
55  NULL,
57  {
58  /* Successful breakin */
59  DoBreak = TRUE;
60  }
61  }
62  }
63 
64  /* Tell the caller to do a break */
65  return DoBreak;
66 }
#define KdPacketReceived
Definition: kddll.h:5
#define TRUE
Definition: types.h:120
KDP_STATUS NTAPI KdReceivePacket(IN ULONG PacketType, OUT PSTRING MessageHeader, OUT PSTRING MessageData, OUT PULONG DataLength, IN OUT PKD_CONTEXT KdContext)
Definition: kddll.c:80
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
BOOLEAN KdDebuggerEnabled
Definition: kdmain.c:48
KD_CONTEXT KdpContext
Definition: kddata.c:65
BOOLEAN KdpControlCPending
Definition: windbgkd.h:227
#define PACKET_TYPE_KD_POLL_BREAKIN
Definition: windbgkd.h:49

◆ KdpPortLock()

VOID NTAPI KdpPortLock ( VOID  )

Definition at line 19 of file kdlock.c.

20 {
21  /* Acquire the lock */
23 }
KSPIN_LOCK KdpDebuggerLock
Definition: kddata.c:67
VOID FASTCALL KiAcquireSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:32

◆ KdpPortUnlock()

VOID NTAPI KdpPortUnlock ( VOID  )

Definition at line 27 of file kdlock.c.

28 {
29  /* Release the lock */
31 }
KSPIN_LOCK KdpDebuggerLock
Definition: kddata.c:67
VOID FASTCALL KiReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:39

Referenced by KdPollBreakIn().

◆ KdpPrint()

NTSTATUS NTAPI KdpPrint ( _In_ ULONG  ComponentId,
_In_ ULONG  Level,
_In_reads_bytes_(Length) PCHAR  String,
_In_ USHORT  Length,
_In_ KPROCESSOR_MODE  PreviousMode,
_In_ PKTRAP_FRAME  TrapFrame,
_In_ PKEXCEPTION_FRAME  ExceptionFrame,
_Out_ PBOOLEAN  Handled 
)

Definition at line 331 of file kdprint.c.

340 {
342  BOOLEAN Enable;
343  STRING OutputString;
344  CHAR CapturedString[512];
345 
346  /* Assume failure */
347  *Handled = FALSE;
348 
349 #if (NTDDI_VERSION >= NTDDI_VISTA)
351  {
352  /* Use the default component ID */
353  Mask = &Kd_DEFAULT_Mask;
354  // Level = DPFLTR_INFO_LEVEL; // Override the Level.
355  }
356 #endif
357  /* Convert Level to bit field if required */
358  if (Level < 32) Level = 1 << Level;
359  Level &= ~DPFLTR_MASK;
360 
361  /* Validate the mask */
362  if (!(Kd_WIN2000_Mask & Level) ||
365  {
366  /* Mask validation failed */
367  *Handled = TRUE;
368  return STATUS_SUCCESS;
369  }
370 
371  /* Normalize the length */
372  Length = min(Length, sizeof(CapturedString));
373 
374  /* Check if we need to verify the string */
375  if (PreviousMode != KernelMode)
376  {
377  /* Capture user-mode buffers */
378  _SEH2_TRY
379  {
380  /* Probe and capture the string */
382  KdpMoveMemory(CapturedString, String, Length);
383  String = CapturedString;
384  }
386  {
387  /* Bad string pointer, bail out */
389  }
390  _SEH2_END;
391  }
392 
393  /* Setup the output string */
394  OutputString.Buffer = String;
395  OutputString.Length = OutputString.MaximumLength = Length;
396 
397  /* Log the print */
398  //KdLogDbgPrint(&OutputString);
399 
400  /* Check for a debugger */
402  {
403  /* Fail */
404  *Handled = TRUE;
406  }
407 
408  /* Enter the debugger */
409  Enable = KdEnterDebugger(TrapFrame, ExceptionFrame);
410 
411  /* Print the string */
412  if (KdpPrintString(&OutputString))
413  {
414  /* User pressed CTRL-C, breakpoint on return */
416  }
417  else
418  {
419  /* String was printed */
421  }
422 
423  /* Exit the debugger and return */
425  *Handled = TRUE;
426  return Status;
427 }
#define TRUE
Definition: types.h:120
VOID NTAPI KdpMoveMemory(_In_ PVOID Destination, _In_ PVOID Source, _In_ SIZE_T Length)
Definition: kdapi.c:22
char CHAR
Definition: xmlstorage.h:175
LONG NTSTATUS
Definition: precomp.h:26
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
ULONG KdComponentTableSize
Definition: kddata.c:459
#define DPFLTR_MASK
Definition: kdtypes.h:34
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 ComponentId
Definition: acpixf.h:1270
static WCHAR String[]
Definition: stringtable.c:55
VOID NTAPI KdExitDebugger(IN BOOLEAN Enable)
Definition: kdmain.c:317
_SEH2_TRY
Definition: create.c:4250
BOOLEAN NTAPI KdpPrintString(_In_ PSTRING Output)
Definition: kdio.c:590
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
unsigned char BOOLEAN
#define STATUS_BREAKPOINT
Definition: ntstatus.h:172
#define STATUS_DEVICE_NOT_CONNECTED
Definition: udferr_usr.h:160
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
_In_ BOOLEAN Handled
Definition: ketypes.h:337
ULONG Kd_WIN2000_Mask
Definition: kddata.c:147
PULONG KdComponentTable[MAX_KD_COMPONENT_TABLE_ENTRIES]
Definition: kddata.c:303
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
std::wstring STRING
Definition: fontsub.cpp:33
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
Status
Definition: gdiplustypes.h:24
#define MAXULONG
Definition: typedefs.h:250
_SEH2_END
Definition: create.c:4424
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:228
ULONG Kd_DEFAULT_Mask
Definition: kddata.c:249
#define min(a, b)
Definition: monoChain.cc:55
BOOLEAN NTAPI KdEnterDebugger(IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame)
Definition: kdmain.c:309
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
return STATUS_SUCCESS
Definition: btrfs.c:2938
BOOLEAN KdDebuggerNotPresent
Definition: kdmain.c:50

Referenced by KdpEnterDebuggerException(), KdpServiceDispatcher(), and KdpTrap().

◆ KdpPrompt()

USHORT NTAPI KdpPrompt ( _In_reads_bytes_(PromptLength) PCHAR  PromptString,
_In_ USHORT  PromptLength,
_Out_writes_bytes_(MaximumResponseLength) PCHAR  ResponseString,
_In_ USHORT  MaximumResponseLength,
_In_ KPROCESSOR_MODE  PreviousMode,
_In_ PKTRAP_FRAME  TrapFrame,
_In_ PKEXCEPTION_FRAME  ExceptionFrame 
)

Definition at line 234 of file kdprint.c.

242 {
243  STRING PromptBuffer, ResponseBuffer;
244  BOOLEAN Enable, Resend;
245  PCHAR SafeResponseString;
246  CHAR CapturedPrompt[512];
247  CHAR SafeResponseBuffer[512];
248 
249  /* Normalize the lengths */
250  PromptLength = min(PromptLength,
251  sizeof(CapturedPrompt));
253  sizeof(SafeResponseBuffer));
254 
255  /* Check if we need to verify the string */
256  if (PreviousMode != KernelMode)
257  {
258  /* Handle user-mode buffers safely */
259  _SEH2_TRY
260  {
261  /* Probe and capture the prompt */
262  ProbeForRead(PromptString, PromptLength, 1);
263  KdpMoveMemory(CapturedPrompt, PromptString, PromptLength);
264  PromptString = CapturedPrompt;
265 
266  /* Probe and make room for the response */
267  ProbeForWrite(ResponseString, MaximumResponseLength, 1);
268  SafeResponseString = SafeResponseBuffer;
269  }
271  {
272  /* Bad string pointer, bail out */
273  _SEH2_YIELD(return 0);
274  }
275  _SEH2_END;
276  }
277  else
278  {
279  SafeResponseString = ResponseString;
280  }
281 
282  /* Setup the prompt and response buffers */
283  PromptBuffer.Buffer = PromptString;
284  PromptBuffer.Length = PromptBuffer.MaximumLength = PromptLength;
285  ResponseBuffer.Buffer = SafeResponseString;
286  ResponseBuffer.Length = 0;
287  ResponseBuffer.MaximumLength = MaximumResponseLength;
288 
289  /* Log the print */
290  //KdLogDbgPrint(&PromptBuffer);
291 
292  /* Enter the debugger */
293  Enable = KdEnterDebugger(TrapFrame, ExceptionFrame);
294 
295  /* Enter prompt loop */
296  do
297  {
298  /* Send the prompt and receive the response */
299  Resend = KdpPromptString(&PromptBuffer, &ResponseBuffer);
300 
301  /* Loop while we need to resend */
302  } while (Resend);
303 
304  /* Exit the debugger */
306 
307  /* Copy back the response if required */
308  if (PreviousMode != KernelMode)
309  {
310  _SEH2_TRY
311  {
312  /* Safely copy back the response to user mode */
313  KdpMoveMemory(ResponseString,
314  ResponseBuffer.Buffer,
315  ResponseBuffer.Length);
316  }
318  {
319  /* String became invalid after we exited, fail */
320  _SEH2_YIELD(return 0);
321  }
322  _SEH2_END;
323  }
324 
325  /* Return the number of characters received */
326  return ResponseBuffer.Length;
327 }
signed char * PCHAR
Definition: retypes.h:7
VOID NTAPI KdpMoveMemory(_In_ PVOID Destination, _In_ PVOID Source, _In_ SIZE_T Length)
Definition: kdapi.c:22
char CHAR
Definition: xmlstorage.h:175
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
BOOLEAN NTAPI KdpPromptString(_In_ PSTRING PromptString, _In_ PSTRING ResponseString)
Definition: kdio.c:625
VOID NTAPI KdExitDebugger(IN BOOLEAN Enable)
Definition: kdmain.c:317
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
_SEH2_TRY
Definition: create.c:4250
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
unsigned char BOOLEAN
_In_ ULONG MaximumResponseLength
Definition: kdfuncs.h:11
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
std::wstring STRING
Definition: fontsub.cpp:33
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
_SEH2_END
Definition: create.c:4424
#define min(a, b)
Definition: monoChain.cc:55
BOOLEAN NTAPI KdEnterDebugger(IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame)
Definition: kdmain.c:309
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6

Referenced by KdpEnterDebuggerException(), and KdpTrap().

◆ KdpReportCommandStringStateChange()

VOID NTAPI KdpReportCommandStringStateChange ( IN PSTRING  NameString,
IN PSTRING  CommandString,
IN OUT PCONTEXT  Context 
)

◆ KdpReportExceptionStateChange()

BOOLEAN NTAPI KdpReportExceptionStateChange ( IN PEXCEPTION_RECORD  ExceptionRecord,
IN OUT PCONTEXT  Context,
IN BOOLEAN  SecondChanceException 
)

Referenced by KdpReport().

◆ KdpReportLoadSymbolsStateChange()

VOID NTAPI KdpReportLoadSymbolsStateChange ( IN PSTRING  PathName,
IN PKD_SYMBOLS_INFO  SymbolInfo,
IN BOOLEAN  Unload,
IN OUT PCONTEXT  Context 
)

◆ KdpRestoreAllBreakpoints()

VOID NTAPI KdpRestoreAllBreakpoints ( VOID  )

Definition at line 368 of file kdbreak.c.

369 {
370  ULONG BpIndex;
371 
372  /* No more suspended Breakpoints */
374 
375  /* Loop the breakpoints */
376  for (BpIndex = 0; BpIndex < KD_BREAKPOINT_MAX; BpIndex++)
377  {
378  /* Check if they are valid, suspended breakpoints */
379  if ((KdpBreakpointTable[BpIndex].Flags & KD_BREAKPOINT_ACTIVE) &&
381  {
382  /* Unsuspend them */
384  KdpLowRestoreBreakpoint(BpIndex);
385  }
386  }
387 }
#define KD_BREAKPOINT_SUSPENDED
Definition: kd64.h:42
BOOLEAN BreakpointsSuspended
Definition: kddata.c:103
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
ULONG Flags
Definition: kd64.h:50
BOOLEAN NTAPI KdpLowRestoreBreakpoint(IN ULONG BpIndex)
Definition: kdbreak.c:268
#define KD_BREAKPOINT_MAX
Definition: kd64.h:23
BREAKPOINT_ENTRY KdpBreakpointTable[KD_BREAKPOINT_MAX]
Definition: kddata.c:100
unsigned int ULONG
Definition: retypes.h:1
#define KD_BREAKPOINT_ACTIVE
Definition: kd64.h:40

◆ KdpSetContextState()

VOID NTAPI KdpSetContextState ( IN PDBGKD_ANY_WAIT_STATE_CHANGE  WaitStateChange,
IN PCONTEXT  Context 
)

Definition at line 66 of file kdx64.c.

68 {
69  PKPRCB Prcb = KeGetCurrentPrcb();
70 
71  /* Copy i386 specific debug registers */
72  WaitStateChange->ControlReport.Dr6 = Prcb->ProcessorState.SpecialRegisters.
73  KernelDr6;
74  WaitStateChange->ControlReport.Dr7 = Prcb->ProcessorState.SpecialRegisters.
75  KernelDr7;
76 
77  /* Copy i386 specific segments */
78  WaitStateChange->ControlReport.SegCs = (USHORT)Context->SegCs;
79  WaitStateChange->ControlReport.SegDs = (USHORT)Context->SegDs;
80  WaitStateChange->ControlReport.SegEs = (USHORT)Context->SegEs;
81  WaitStateChange->ControlReport.SegFs = (USHORT)Context->SegFs;
82 
83  /* Copy EFlags */
84  WaitStateChange->ControlReport.EFlags = Context->EFlags;
85 
86  /* Set Report Flags */
87  WaitStateChange->ControlReport.ReportFlags = REPORT_INCLUDES_SEGS;
88  if (WaitStateChange->ControlReport.SegCs == KGDT64_R0_CODE)
89  {
90  WaitStateChange->ControlReport.ReportFlags |= REPORT_STANDARD_CS;
91  }
92 }
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1062
KSPECIAL_REGISTERS SpecialRegisters
Definition: ketypes.h:530
#define REPORT_STANDARD_CS
Definition: windbgkd.h:148
#define KGDT64_R0_CODE
Definition: ketypes.h:72
KPROCESSOR_STATE ProcessorState
Definition: ketypes.h:579
#define REPORT_INCLUDES_SEGS
Definition: windbgkd.h:147
unsigned short USHORT
Definition: pedump.c:61

◆ KdpStub()

BOOLEAN NTAPI KdpStub ( IN PKTRAP_FRAME  TrapFrame,
IN PKEXCEPTION_FRAME  ExceptionFrame,
IN PEXCEPTION_RECORD  ExceptionRecord,
IN PCONTEXT  ContextRecord,
IN KPROCESSOR_MODE  PreviousMode,
IN BOOLEAN  SecondChanceException 
)

Definition at line 266 of file kdtrap.c.

272 {
273  ULONG_PTR ExceptionCommand;
274 
275  /* Check if this was a breakpoint due to DbgPrint or Load/UnloadSymbols */
276  ExceptionCommand = ExceptionRecord->ExceptionInformation[0];
277  if ((ExceptionRecord->ExceptionCode == STATUS_BREAKPOINT) &&
278  (ExceptionRecord->NumberParameters > 0) &&
279  ((ExceptionCommand == BREAKPOINT_LOAD_SYMBOLS) ||
280  (ExceptionCommand == BREAKPOINT_UNLOAD_SYMBOLS) ||
281  (ExceptionCommand == BREAKPOINT_COMMAND_STRING) ||
282  (ExceptionCommand == BREAKPOINT_PRINT)))
283  {
284  /* This we can handle: simply bump the Program Counter */
287  return TRUE;
288  }
289  else if (KdPitchDebugger)
290  {
291  /* There's no debugger, fail. */
292  return FALSE;
293  }
294  else if ((KdAutoEnableOnEvent) &&
296  !(KdDebuggerEnabled) &&
299  {
300  /* Debugging was Auto-Enabled. We can now send this to KD. */
301  return KdpTrap(TrapFrame,
302  ExceptionFrame,
303  ExceptionRecord,
305  PreviousMode,
306  SecondChanceException);
307  }
308  else
309  {
310  /* FIXME: All we can do in this case is trace this exception */
311  return FALSE;
312  }
313 }
#define TRUE
Definition: types.h:120
BOOLEAN NTAPI KdpTrap(IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame, IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT ContextRecord, IN KPROCESSOR_MODE PreviousMode, IN BOOLEAN SecondChanceException)
Definition: kdtrap.c:135
BOOLEAN KdAutoEnableOnEvent
BOOLEAN KdPreviouslyEnabled
BOOLEAN KdPitchDebugger
Definition: kdmain.c:52
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define BREAKPOINT_UNLOAD_SYMBOLS
Definition: kdtypes.h:54
#define STATUS_BREAKPOINT
Definition: ntstatus.h:172
BOOLEAN KdDebuggerEnabled
Definition: kdmain.c:48
#define KeGetContextPc(Context)
Definition: ke.h:124
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS NTAPI KdEnableDebugger(VOID)
Definition: kdmain.c:371
_IRQL_requires_same_ _In_ PVOID _Inout_ struct _CONTEXT * ContextRecord
Definition: ntbasedef.h:661
#define BREAKPOINT_PRINT
Definition: kdtypes.h:51
#define BREAKPOINT_LOAD_SYMBOLS
Definition: kdtypes.h:53
#define BREAKPOINT_COMMAND_STRING
Definition: kdtypes.h:55
#define KD_BREAKPOINT_SIZE
Definition: ke.h:118
#define KeSetContextPc(Context, ProgramCounter)
Definition: ke.h:127

Referenced by KdInitSystem().

◆ KdpSuspendAllBreakPoints()

VOID NTAPI KdpSuspendAllBreakPoints ( VOID  )

Definition at line 407 of file kdbreak.c.

408 {
409  ULONG BpEntry;
410 
411  /* Breakpoints are suspended */
413 
414  /* Loop every breakpoint */
415  for (BpEntry = 1; BpEntry <= KD_BREAKPOINT_MAX; BpEntry++)
416  {
417  /* Suspend it */
418  KdpSuspendBreakPoint(BpEntry);
419  }
420 }
#define TRUE
Definition: types.h:120
BOOLEAN BreakpointsSuspended
Definition: kddata.c:103
#define KD_BREAKPOINT_MAX
Definition: kd64.h:23
VOID NTAPI KdpSuspendBreakPoint(IN ULONG BpEntry)
Definition: kdbreak.c:391
unsigned int ULONG
Definition: retypes.h:1

◆ KdpSuspendBreakPoint()

VOID NTAPI KdpSuspendBreakPoint ( IN ULONG  BpEntry)

Definition at line 391 of file kdbreak.c.

392 {
393  ULONG BpIndex = BpEntry - 1;
394 
395  /* Check if this is a valid, unsuspended breakpoint */
396  if ((KdpBreakpointTable[BpIndex].Flags & KD_BREAKPOINT_ACTIVE) &&
398  {
399  /* Suspend it */
401  KdpLowWriteContent(BpIndex);
402  }
403 }
#define KD_BREAKPOINT_SUSPENDED
Definition: kd64.h:42
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
BOOLEAN NTAPI KdpLowWriteContent(IN ULONG BpIndex)
Definition: kdbreak.c:226
ULONG Flags
Definition: kd64.h:50
BREAKPOINT_ENTRY KdpBreakpointTable[KD_BREAKPOINT_MAX]
Definition: kddata.c:100
unsigned int ULONG
Definition: retypes.h:1
#define KD_BREAKPOINT_ACTIVE
Definition: kd64.h:40

Referenced by KdpSuspendAllBreakPoints().

◆ KdpSwitchProcessor()

BOOLEAN NTAPI KdpSwitchProcessor ( IN PEXCEPTION_RECORD  ExceptionRecord,
IN OUT PCONTEXT  ContextRecord,
IN BOOLEAN  SecondChanceException 
)

Referenced by KdInitSystem().

◆ KdpSymbol()

VOID NTAPI KdpSymbol ( IN PSTRING  DllPath,
IN PKD_SYMBOLS_INFO  SymbolInfo,
IN BOOLEAN  Unload,
IN KPROCESSOR_MODE  PreviousMode,
IN PCONTEXT  ContextRecord,
IN PKTRAP_FRAME  TrapFrame,
IN PKEXCEPTION_FRAME  ExceptionFrame 
)

Referenced by KdpTrap().

◆ KdpSysCheckLowMemory()

NTSTATUS NTAPI KdpSysCheckLowMemory ( IN ULONG  Flags)

Definition at line 356 of file kdx64.c.

357 {
359  return STATUS_UNSUCCESSFUL;
360 }
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ KdpSysGetVersion()

VOID NTAPI KdpSysGetVersion ( IN PDBGKD_GET_VERSION64  Version)

◆ KdpSysReadBusData()

NTSTATUS NTAPI KdpSysReadBusData ( IN ULONG  BusDataType,
IN ULONG  BusNumber,
IN ULONG  SlotNumber,
IN ULONG  Offset,
IN PVOID  Buffer,
IN ULONG  Length,
OUT PULONG  ActualLength 
)

Definition at line 134 of file kdx64.c.

141 {
143  return STATUS_UNSUCCESSFUL;
144 }
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ KdpSysReadControlSpace()

NTSTATUS NTAPI KdpSysReadControlSpace ( IN ULONG  Processor,
IN ULONG64  BaseAddress,
IN PVOID  Buffer,
IN ULONG  Length,
OUT PULONG  ActualLength 
)

Definition at line 162 of file kdx64.c.

167 {
168  PVOID ControlStart;
170  PKIPCR Pcr = CONTAINING_RECORD(Prcb, KIPCR, Prcb);
171 
172  switch (BaseAddress)
173  {
175  /* Copy a pointer to the Pcr */
176  ControlStart = &Pcr;
177  *ActualLength = sizeof(PVOID);
178  break;
179 
181  /* Copy a pointer to the Prcb */
182  ControlStart = &Prcb;
183  *ActualLength = sizeof(PVOID);
184  break;
185 
187  /* Copy SpecialRegisters */
188  ControlStart = &Prcb->ProcessorState.SpecialRegisters;
189  *ActualLength = sizeof(KSPECIAL_REGISTERS);
190  break;
191 
193  /* Copy a pointer to the current Thread */
194  ControlStart = &Prcb->CurrentThread;
195  *ActualLength = sizeof(PVOID);
196  break;
197 
198  default:
199  *ActualLength = 0;
200  ASSERT(FALSE);
201  return STATUS_UNSUCCESSFUL;
202  }
203 
204  /* Copy the memory */
205  RtlCopyMemory(Buffer, ControlStart, min(Length, *ActualLength));
206 
207  /* Finish up */
208  return STATUS_SUCCESS;
209 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define AMD64_DEBUG_CONTROL_SPACE_KPCR
Definition: windbgkd.h:203
_In_ UCHAR Processor
Definition: kefuncs.h:695
KSPECIAL_REGISTERS SpecialRegisters
Definition: ketypes.h:530
#define AMD64_DEBUG_CONTROL_SPACE_KTHREAD
Definition: windbgkd.h:206
struct _KTHREAD * CurrentThread
Definition: ketypes.h:566
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
KPROCESSOR_STATE ProcessorState
Definition: ketypes.h:579
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
struct _KSPECIAL_REGISTERS KSPECIAL_REGISTERS
PKPRCB KiProcessorBlock[]
Definition: krnlinit.c:32
#define min(a, b)
Definition: monoChain.cc:55
#define AMD64_DEBUG_CONTROL_SPACE_KSPECIAL
Definition: windbgkd.h:205
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define AMD64_DEBUG_CONTROL_SPACE_KPRCB
Definition: windbgkd.h:204

◆ KdpSysReadIoSpace()

NTSTATUS NTAPI KdpSysReadIoSpace ( IN ULONG  InterfaceType,
IN ULONG  BusNumber,
IN ULONG  AddressSpace,
IN ULONG64  IoAddress,
IN PVOID  DataValue,
IN ULONG  DataSize,
OUT PULONG  ActualDataSize 
)

Definition at line 108 of file kdarm.c.

115 {
117  return STATUS_UNSUCCESSFUL;
118 }
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ KdpSysReadMsr()

NTSTATUS NTAPI KdpSysReadMsr ( IN ULONG  Msr,
OUT PLARGE_INTEGER  MsrValue 
)

Definition at line 96 of file kdx64.c.

98 {
99  /* Use SEH to protect from invalid MSRs */
100  _SEH2_TRY
101  {
102  MsrValue->QuadPart = __readmsr(Msr);
103  }
105  {
107  }
108  _SEH2_END;
109 
110  return STATUS_SUCCESS;
111 }
_SEH2_TRY
Definition: create.c:4250
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
PPC_QUAL unsigned long long __readmsr()
Definition: intrin_ppc.h:741
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
_SEH2_END
Definition: create.c:4424
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
return STATUS_SUCCESS
Definition: btrfs.c:2938

◆ KdpSysWriteBusData()

NTSTATUS NTAPI KdpSysWriteBusData ( IN ULONG  BusDataType,
IN ULONG  BusNumber,
IN ULONG  SlotNumber,
IN ULONG  Offset,
IN PVOID  Buffer,
IN ULONG  Length,
OUT PULONG  ActualLength 
)

Definition at line 148 of file kdx64.c.

155 {
157  return STATUS_UNSUCCESSFUL;
158 }
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57

◆ KdpSysWriteControlSpace()

NTSTATUS NTAPI KdpSysWriteControlSpace ( IN ULONG  Processor,
IN ULONG64  BaseAddress,
IN PVOID  Buffer,
IN ULONG  Length,
OUT PULONG  ActualLength 
)

Definition at line 213 of file kdx64.c.

218 {
219  PVOID ControlStart;
221 
222  switch (BaseAddress)
223  {
225  /* Copy SpecialRegisters */
226  ControlStart = &Prcb->ProcessorState.SpecialRegisters;
227  *ActualLength = sizeof(KSPECIAL_REGISTERS);
228  break;
229 
230  default:
231  *ActualLength = 0;
232  ASSERT(FALSE);
233  return STATUS_UNSUCCESSFUL;
234  }
235 
236  /* Copy the memory */
237  RtlCopyMemory(ControlStart, Buffer, min(Length, *ActualLength));
238 
239  return STATUS_SUCCESS;
240 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
_In_ UCHAR Processor
Definition: kefuncs.h:695
KSPECIAL_REGISTERS SpecialRegisters
Definition: ketypes.h:530
Definition: bufpool.h:45
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
KPROCESSOR_STATE ProcessorState
Definition: ketypes.h:579
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
struct _KSPECIAL_REGISTERS KSPECIAL_REGISTERS
PKPRCB KiProcessorBlock[]
Definition: krnlinit.c:32
#define min(a, b)
Definition: monoChain.cc:55
#define AMD64_DEBUG_CONTROL_SPACE_KSPECIAL
Definition: windbgkd.h:205
return STATUS_SUCCESS
Definition: btrfs.c:2938

◆ KdpSysWriteIoSpace()

NTSTATUS NTAPI KdpSysWriteIoSpace ( IN ULONG  InterfaceType,
IN ULONG  BusNumber,
IN ULONG  AddressSpace,
IN ULONG64  IoAddress,
IN PVOID  DataValue,
IN ULONG  DataSize,
OUT PULONG  ActualDataSize 
)

Definition at line 300 of file kdx64.c.

307 {
308  /* Verify parameters */
309  if (InterfaceType != Isa || BusNumber != 0 || AddressSpace != 1)
310  {
311  /* No data was written */
312  *ActualDataSize = 0;
314  }
315 
316  /* Check for correct alignment */
317  if ((IoAddress & (DataSize - 1)))
318  {
319  /* Invalid alignment */
320  *ActualDataSize = 0;
322  }
323 
324  switch (DataSize)
325  {
326  case sizeof(UCHAR):
327  /* Write one UCHAR */
328  WRITE_PORT_UCHAR((PUCHAR)IoAddress, *(PUCHAR)DataValue);
329  break;
330 
331  case sizeof(USHORT):
332  /* Write one USHORT */
333  WRITE_PORT_USHORT((PUSHORT)IoAddress, *(PUSHORT)DataValue);
334  break;
335 
336  case sizeof(ULONG):
337  /* Write one ULONG */
338  WRITE_PORT_ULONG((PULONG)IoAddress, *(PULONG)DataValue);
339  break;
340 
341  default:
342  /* Invalid data size */
343  *ActualDataSize = 0;
345  }
346 
347  /* Return the size of the data */
348  *ActualDataSize = DataSize;
349 
350  /* Success! */
351  return STATUS_SUCCESS;
352 }
VOID NTAPI WRITE_PORT_USHORT(IN PUSHORT Port, IN USHORT Value)
Definition: portio.c:115
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2268
unsigned char * PUCHAR
Definition: retypes.h:3
VOID NTAPI WRITE_PORT_ULONG(IN PULONG Port, IN ULONG Value)
Definition: portio.c:123
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
unsigned char UCHAR
Definition: xmlstorage.h:181
unsigned short USHORT
Definition: pedump.c:61
unsigned int * PULONG
Definition: retypes.h:1
#define STATUS_DATATYPE_MISALIGNMENT
Definition: ntstatus.h:171
unsigned int ULONG
Definition: retypes.h:1
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532
return STATUS_SUCCESS
Definition: btrfs.c:2938
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4751
unsigned short * PUSHORT
Definition: retypes.h:2

◆ KdpSysWriteMsr()

NTSTATUS NTAPI KdpSysWriteMsr ( IN ULONG  Msr,
IN PLARGE_INTEGER  MsrValue 
)

Definition at line 115 of file kdx64.c.

117 {
118  /* Use SEH to protect from invalid MSRs */
119  _SEH2_TRY
120  {
121  __writemsr(Msr, MsrValue->QuadPart);
122  }
124  {
126  }
127  _SEH2_END;
128 
129  return STATUS_SUCCESS;
130 }
_SEH2_TRY
Definition: create.c:4250
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136
PPC_QUAL void __writemsr(const unsigned long Value)
Definition: intrin_ppc.h:748
_SEH2_END
Definition: create.c:4424
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
return STATUS_SUCCESS
Definition: btrfs.c:2938

◆ KdpTimeSlipDpcRoutine()

VOID NTAPI KdpTimeSlipDpcRoutine ( IN PKDPC  Dpc,
IN PVOID  DeferredContext,
IN PVOID  SystemArgument1,
IN PVOID  SystemArgument2 
)

Referenced by KdInitSystem().

◆ KdpTimeSlipWork()

VOID NTAPI KdpTimeSlipWork ( IN PVOID  Context)

Referenced by KdInitSystem().

◆ KdpTrap()

BOOLEAN NTAPI KdpTrap ( IN PKTRAP_FRAME  TrapFrame,
IN PKEXCEPTION_FRAME  ExceptionFrame,
IN PEXCEPTION_RECORD  ExceptionRecord,
IN PCONTEXT  ContextRecord,
IN KPROCESSOR_MODE  PreviousMode,
IN BOOLEAN  SecondChanceException 
)

Definition at line 135 of file kdtrap.c.

141 {
142  BOOLEAN Unload;
143  ULONG_PTR ProgramCounter;
145  NTSTATUS ReturnStatus;
147 
148  /*
149  * Check if we got a STATUS_BREAKPOINT with a SubID for Print, Prompt or
150  * Load/Unload symbols. Make sure it isn't a software breakpoints as those
151  * are handled by KdpReport.
152  */
153  if ((ExceptionRecord->ExceptionCode == STATUS_BREAKPOINT) &&
154  (ExceptionRecord->ExceptionInformation[0] != BREAKPOINT_BREAK))
155  {
156  /* Save Program Counter */
157  ProgramCounter = KeGetContextPc(ContextRecord);
158 
159  /* Check what kind of operation was requested from us */
160  Unload = FALSE;
161  switch (ExceptionRecord->ExceptionInformation[0])
162  {
163  /* DbgPrint */
164  case BREAKPOINT_PRINT:
165 
166  /* Call the worker routine */
167  ReturnStatus = KdpPrint((ULONG)KdpGetParameterThree(ContextRecord),
168  (ULONG)KdpGetParameterFour(ContextRecord),
169  (PCHAR)ExceptionRecord->ExceptionInformation[1],
170  (USHORT)ExceptionRecord->ExceptionInformation[2],
171  PreviousMode,
172  TrapFrame,
173  ExceptionFrame,
174  &Handled);
175 
176  /* Update the return value for the caller */
178  break;
179 
180  /* DbgPrompt */
181  case BREAKPOINT_PROMPT:
182 
183  /* Call the worker routine */
184  ReturnLength = KdpPrompt((PCHAR)ExceptionRecord->ExceptionInformation[1],
185  (USHORT)ExceptionRecord->ExceptionInformation[2],
186  (PCHAR)KdpGetParameterThree(ContextRecord),
187  (USHORT)KdpGetParameterFour(ContextRecord),
188  PreviousMode,
189  TrapFrame,
190  ExceptionFrame);
191  Handled = TRUE;
192 
193  /* Update the return value for the caller */
195  break;
196 
197  /* DbgUnLoadImageSymbols */
199 
200  /* Drop into the load case below, with the unload parameter */
201  Unload = TRUE;
202 
203  /* DbgLoadImageSymbols */
205 
206  /* Call the worker routine */
207  KdpSymbol((PSTRING)ExceptionRecord->ExceptionInformation[1],
208  (PKD_SYMBOLS_INFO)ExceptionRecord->ExceptionInformation[2],
209  Unload,
210  PreviousMode,
212  TrapFrame,
213  ExceptionFrame);
214  Handled = TRUE;
215  break;
216 
217  /* DbgCommandString */
219 
220  /* Call the worker routine */
221  KdpCommandString((PSTRING)ExceptionRecord->ExceptionInformation[1],
222  (PSTRING)ExceptionRecord->ExceptionInformation[2],
223  PreviousMode,
225  TrapFrame,
226  ExceptionFrame);
227  Handled = TRUE;
228  break;
229 
230  /* Anything else, do nothing */
231  default:
232 
233  /* Invalid debug service! Don't handle this! */
234  Handled = FALSE;
235  break;
236  }
237 
238  /*
239  * If the PC was not updated, we'll increment it ourselves so execution
240  * continues past the breakpoint.
241  */
242  if (ProgramCounter == KeGetContextPc(ContextRecord))
243  {
244  /* Update it */
246  ProgramCounter + KD_BREAKPOINT_SIZE);
247  }
248  }
249  else
250  {
251  /* Call the worker routine */
252  Handled = KdpReport(TrapFrame,
253  ExceptionFrame,
254  ExceptionRecord,
256  PreviousMode,
257  SecondChanceException);
258  }
259 
260  /* Return TRUE or FALSE to caller */
261  return Handled;
262 }
NTSTATUS NTAPI KdpPrint(_In_ ULONG ComponentId, _In_ ULONG Level, _In_reads_bytes_(Length) PCHAR String, _In_ USHORT Length, _In_ KPROCESSOR_MODE PreviousMode, _In_ PKTRAP_FRAME TrapFrame, _In_ PKEXCEPTION_FRAME ExceptionFrame, _Out_ PBOOLEAN Handled)
Definition: kdprint.c:331
signed char * PCHAR
Definition: retypes.h:7
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
#define TRUE
Definition: types.h:120
VOID NTAPI Unload(PDRIVER_OBJECT DriverObject)
Definition: csqtest.c:160
#define KeSetContextReturnRegister(Context, ReturnValue)
Definition: ke.h:139
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI KdpReport(IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame, IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT ContextRecord, IN KPROCESSOR_MODE PreviousMode, IN BOOLEAN SecondChanceException)
Definition: kdtrap.c:52
uint32_t ULONG_PTR
Definition: typedefs.h:63
VOID NTAPI KdpCommandString(IN PSTRING NameString, IN PSTRING CommandString, IN KPROCESSOR_MODE PreviousMode, IN PCONTEXT ContextRecord, IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame)
#define BREAKPOINT_UNLOAD_SYMBOLS
Definition: kdtypes.h:54
unsigned char BOOLEAN
#define STATUS_BREAKPOINT
Definition: ntstatus.h:172
#define KeGetContextPc(Context)
Definition: ke.h:124
#define BREAKPOINT_PROMPT
Definition: kdtypes.h:52
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
VOID NTAPI KdpSymbol(IN PSTRING DllPath, IN PKD_SYMBOLS_INFO SymbolInfo, IN BOOLEAN Unload, IN KPROCESSOR_MODE PreviousMode, IN PCONTEXT ContextRecord, IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame)
_In_ BOOLEAN Handled
Definition: ketypes.h:337
_IRQL_requires_same_ _In_ PVOID _Inout_ struct _CONTEXT * ContextRecord
Definition: ntbasedef.h:661
#define BREAKPOINT_PRINT
Definition: kdtypes.h:51
unsigned short USHORT
Definition: pedump.c:61
USHORT NTAPI KdpPrompt(_In_reads_bytes_(PromptLength) PCHAR PromptString, _In_ USHORT PromptLength, _Out_writes_bytes_(MaximumResponseLength) PCHAR ResponseString, _In_ USHORT MaximumResponseLength, _In_ KPROCESSOR_MODE PreviousMode, _In_ PKTRAP_FRAME TrapFrame, _In_ PKEXCEPTION_FRAME ExceptionFrame)
Definition: kdprint.c:234
#define BREAKPOINT_LOAD_SYMBOLS
Definition: kdtypes.h:53
unsigned int ULONG
Definition: retypes.h:1
#define BREAKPOINT_COMMAND_STRING
Definition: kdtypes.h:55
#define KD_BREAKPOINT_SIZE
Definition: ke.h:118
#define KeSetContextPc(Context, ProgramCounter)
Definition: ke.h:127
#define BREAKPOINT_BREAK
Definition: kdtypes.h:50

Referenced by KdInitSystem(), and KdpStub().

◆ KdpZeroMemory()

VOID NTAPI KdpZeroMemory ( _In_ PVOID  Destination,
_In_ SIZE_T  Length 
)

Definition at line 37 of file kdapi.c.

40 {
41  PCHAR DestinationBytes;
42 
43  /* Zero the buffer 1 byte at a time */
44  DestinationBytes = Destination;
45  while (Length--) *DestinationBytes++ = 0;
46 }
signed char * PCHAR
Definition: retypes.h:7
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2891
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101

◆ KdSetOwedBreakpoints()

VOID NTAPI KdSetOwedBreakpoints ( VOID  )

Definition at line 105 of file kdbreak.c.

106 {
107  BOOLEAN Enable;
108  KD_BREAKPOINT_TYPE Content;
109  ULONG i;
111 
112  /* If we don't owe any breakpoints, just return */
113  if (!KdpOweBreakpoint) return;
114 
115  /* Enter the debugger */
117 
118  /*
119  * Suppose we succeed in setting all the breakpoints.
120  * If we fail to do so, the flag will be set again.
121  */
123 
124  /* Loop through current breakpoints and try to set or delete the pending ones */
125  for (i = 0; i < KD_BREAKPOINT_MAX; i++)
126  {
128  {
129  /*
130  * Set the breakpoint only if it is in kernel space, or if it is
131  * in user space and the active process context matches.
132  */
134  KdpBreakpointTable[i].DirectoryTableBase != KeGetCurrentThread()->ApcState.Process->DirectoryTableBase[0])
135  {
137  continue;
138  }
139 
140  /* Try to save the old instruction */
142  &Content,
144  0,
146  NULL);
147  if (!NT_SUCCESS(Status))
148  {
149  /* Memory is still inaccessible, breakpoint setting will be deferred again */
150  // KdpDprintf("Failed to set deferred breakpoint at address 0x%p\n",
151  // KdpBreakpointTable[i].Address);
153  continue;
154  }
155 
156  /* Check if we need to write the breakpoint */
158  {
159  /* Memory accessible, set the breakpoint */
160  KdpBreakpointTable[i].Content = Content;
161 
162  /* Write the breakpoint */
166  0,
168  NULL);
169  if (!NT_SUCCESS(Status))
170  {
171  /* This should never happen */
172  KdpDprintf("Unable to write deferred breakpoint to address 0x%p\n",
175  }
176  else
177  {
179  }
180 
181  continue;
182  }
183 
184  /* Check if we need to restore the original instruction */
186  {
187  /* Write it back */
189  &KdpBreakpointTable[i].Content,
191  0,
193  NULL);
194  if (!NT_SUCCESS(Status))
195  {
196  /* This should never happen */
197  KdpDprintf("Unable to delete deferred breakpoint at address 0x%p\n",
200  }
201  else
202  {
203  /* Check if the breakpoint is suspended */
205  {
207  }
208  else
209  {
210  /* Invalidate it */
212  }
213  }
214 
215  continue;
216  }
217  }
218  }
219 
220  /* Exit the debugger */
222 }
#define TRUE
Definition: types.h:120
NTSTATUS NTAPI KdpCopyMemoryChunks(_In_ ULONG64 Address, _In_ PVOID Buffer, _In_ ULONG TotalSize, _In_ ULONG ChunkSize, _In_ ULONG Flags, _Out_opt_ PULONG ActualSize)
Definition: kdapi.c:50
LONG NTSTATUS
Definition: precomp.h:26
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
#define KD_BREAKPOINT_SUSPENDED
Definition: kd64.h:42
VOID NTAPI KdExitDebugger(IN BOOLEAN Enable)
Definition: kdmain.c:317
uint32_t ULONG_PTR
Definition: typedefs.h:63
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
BOOLEAN KdpOweBreakpoint
Definition: kddata.c:102
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
static WCHAR Address[46]
Definition: ping.c:68
#define MMDBG_COPY_WRITE
Definition: mm.h:53
ULONG Flags
Definition: kd64.h:50
#define KD_BREAKPOINT_PENDING
Definition: kd64.h:41
#define KD_HIGHEST_USER_BREAKPOINT_ADDRESS
Definition: kd64.h:35
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
KD_BREAKPOINT_TYPE Content
Definition: kd64.h:53
KD_BREAKPOINT_TYPE KdpBreakpointInstruction
Definition: kddata.c:101
#define KD_BREAKPOINT_MAX
Definition: kd64.h:23
Status
Definition: gdiplustypes.h:24
#define KD_BREAKPOINT_TYPE
Definition: ke.h:117
#define MMDBG_COPY_UNSAFE
Definition: mm.h:55
_Out_ PKAPC_STATE ApcState
Definition: mm.h:1492
BREAKPOINT_ENTRY KdpBreakpointTable[KD_BREAKPOINT_MAX]
Definition: kddata.c:100
#define KdpDprintf
Definition: mmdbg.c:19
unsigned int ULONG
Definition: retypes.h:1
BOOLEAN NTAPI KdEnterDebugger(IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame)
Definition: kdmain.c:309
#define KD_BREAKPOINT_SIZE
Definition: ke.h:118
#define KeGetCurrentThread
Definition: hal.h:44
#define KD_BREAKPOINT_EXPIRED
Definition: kd64.h:43
#define KD_BREAKPOINT_ACTIVE
Definition: kd64.h:40

Referenced by KiTrap0EHandler().

◆ KdUpdateDataBlock()

VOID NTAPI KdUpdateDataBlock ( VOID  )

Definition at line 303 of file kdmain.c.

304 {
305 }

Referenced by PspInitializeSystemDll().

Variable Documentation

◆ BreakpointsSuspended

BOOLEAN BreakpointsSuspended

Definition at line 103 of file kddata.c.

Referenced by KdpRestoreAllBreakpoints(), and KdpSuspendAllBreakPoints().

◆ Kd_ACPI_Mask

ULONG Kd_ACPI_Mask

Definition at line 172 of file kddata.c.

◆ Kd_ALPC_Mask

ULONG Kd_ALPC_Mask

Definition at line 256 of file kddata.c.

◆ Kd_AMLI_Mask

ULONG Kd_AMLI_Mask

Definition at line 173 of file kddata.c.

◆ Kd_APPCOMPAT_Mask

ULONG Kd_APPCOMPAT_Mask

Definition at line 274 of file kddata.c.

◆ Kd_AUTOCHK_Mask

ULONG Kd_AUTOCHK_Mask

Definition at line 191 of file kddata.c.

◆ Kd_BURNENG_Mask

ULONG Kd_BURNENG_Mask

Definition at line 197 of file kddata.c.

◆ Kd_CACHEMGR_Mask

ULONG Kd_CACHEMGR_Mask

Definition at line 278 of file kddata.c.

◆ Kd_CDAUDIO_Mask

ULONG Kd_CDAUDIO_Mask

Definition at line 154 of file kddata.c.

◆ Kd_CDROM_Mask

ULONG Kd_CDROM_Mask

Definition at line 155 of file kddata.c.

◆ Kd_CFR_Mask

ULONG Kd_CFR_Mask

Definition at line 280 of file kddata.c.

◆ Kd_CLASSPNP_Mask

ULONG Kd_CLASSPNP_Mask

Definition at line 156 of file kddata.c.

◆ Kd_CNG_Mask

ULONG Kd_CNG_Mask

Definition at line 291 of file kddata.c.

◆ Kd_CONFIG_Mask

ULONG Kd_CONFIG_Mask

Definition at line 162 of file kddata.c.

◆ Kd_COVERAGE_Mask

ULONG Kd_COVERAGE_Mask

Definition at line 277 of file kddata.c.

◆ Kd_CRASHDUMP_Mask

ULONG Kd_CRASHDUMP_Mask

Definition at line 153 of file kddata.c.

◆ Kd_DCOMSS_Mask

ULONG Kd_DCOMSS_Mask

Definition at line 192 of file kddata.c.

◆ Kd_DEFAULT_Mask

ULONG Kd_DEFAULT_Mask

Definition at line 249 of file kddata.c.

Referenced by KdpPrint(), NtQueryDebugFilterState(), and NtSetDebugFilterState().

◆ Kd_DFRGIFC_Mask

ULONG Kd_DFRGIFC_Mask

Definition at line 248 of file kddata.c.

◆ Kd_DFSC_Mask

ULONG Kd_DFSC_Mask

Definition at line 251 of file kddata.c.

◆ Kd_DISK_Mask

ULONG Kd_DISK_Mask

Definition at line 157 of file kddata.c.

◆ Kd_DMADMIN_Mask

ULONG Kd_DMADMIN_Mask

Definition at line 217 of file kddata.c.

◆ Kd_DMCONFIG_Mask

ULONG Kd_DMCONFIG_Mask

Definition at line 216 of file kddata.c.

◆ Kd_DMIO_Mask

ULONG Kd_DMIO_Mask

Definition at line 215 of file kddata.c.

◆ Kd_DMSERVER_Mask

ULONG Kd_DMSERVER_Mask

Definition at line 222 of file kddata.c.

◆ Kd_DMSYNTH_Mask

ULONG Kd_DMSYNTH_Mask

Definition at line 179 of file kddata.c.

◆ Kd_DRIVEEXTENDER_Mask

ULONG Kd_DRIVEEXTENDER_Mask

Definition at line 296 of file kddata.c.

◆ Kd_EMS_Mask

ULONG Kd_EMS_Mask

Definition at line 268 of file kddata.c.

◆ Kd_ENVIRON_Mask

ULONG Kd_ENVIRON_Mask

Definition at line 267 of file kddata.c.

◆ Kd_EXFAT_Mask

ULONG Kd_EXFAT_Mask

Definition at line 292 of file kddata.c.

◆ Kd_FASTFAT_Mask

ULONG Kd_FASTFAT_Mask

Definition at line 181 of file kddata.c.

◆ Kd_FCPORT_Mask

ULONG Kd_FCPORT_Mask

Definition at line 213 of file kddata.c.

◆ Kd_FDC_Mask

ULONG Kd_FDC_Mask

Definition at line 208 of file kddata.c.

◆ Kd_FILETRACE_Mask

ULONG Kd_FILETRACE_Mask

Definition at line 293 of file kddata.c.

◆ Kd_FLOPPY_Mask

ULONG Kd_FLOPPY_Mask

Definition at line 207 of file kddata.c.

◆ Kd_FLTMGR_Mask

ULONG Kd_FLTMGR_Mask

Definition at line 195 of file kddata.c.

◆ Kd_FLTREGRESS_Mask

ULONG Kd_FLTREGRESS_Mask

Definition at line 283 of file kddata.c.

◆ Kd_FSTUB_Mask

ULONG Kd_FSTUB_Mask

Definition at line 152 of file kddata.c.

◆ Kd_FUSION_Mask

ULONG Kd_FUSION_Mask

Definition at line 200 of file kddata.c.

◆ Kd_FVEVOL_Mask

ULONG Kd_FVEVOL_Mask

Definition at line 270 of file kddata.c.

◆ Kd_HALIA64_Mask

ULONG Kd_HALIA64_Mask

Definition at line 174 of file kddata.c.

◆ Kd_HEAP_Mask

ULONG Kd_HEAP_Mask

Definition at line 261 of file kddata.c.

◆ Kd_HPS_Mask

ULONG Kd_HPS_Mask

Definition at line 231 of file kddata.c.

◆ Kd_I8042PRT_Mask

ULONG Kd_I8042PRT_Mask

Definition at line 163 of file kddata.c.

◆ Kd_IDEP_Mask

ULONG Kd_IDEP_Mask

Definition at line 205 of file kddata.c.

◆ Kd_IDLETASK_Mask

ULONG Kd_IDLETASK_Mask

Definition at line 201 of file kddata.c.

◆ Kd_IHVAUDIO_Mask

ULONG Kd_IHVAUDIO_Mask

Definition at line 227 of file kddata.c.

◆ Kd_IHVBUS_Mask

ULONG Kd_IHVBUS_Mask

Definition at line 230 of file kddata.c.

◆ Kd_IHVDRIVER_Mask

ULONG Kd_IHVDRIVER_Mask

Definition at line 225 of file kddata.c.

◆ Kd_IHVNETWORK_Mask

ULONG Kd_IHVNETWORK_Mask

Definition at line 228 of file kddata.c.

◆ Kd_IHVSTREAMING_Mask

ULONG Kd_IHVSTREAMING_Mask

Definition at line 229 of file kddata.c.

◆ Kd_IHVVIDEO_Mask

ULONG Kd_IHVVIDEO_Mask

Definition at line 226 of file kddata.c.

◆ Kd_IMAPI_Mask

ULONG Kd_IMAPI_Mask

Definition at line 198 of file kddata.c.

◆ Kd_INFINIBAND_Mask

ULONG Kd_INFINIBAND_Mask

Definition at line 224 of file kddata.c.

◆ Kd_IOSTRESS_Mask

ULONG Kd_IOSTRESS_Mask

Definition at line 260 of file kddata.c.

◆ Kd_ISAPNP_Mask

ULONG Kd_ISAPNP_Mask

Definition at line 235 of file kddata.c.

◆ Kd_KBDCLASS_Mask

ULONG Kd_KBDCLASS_Mask

Definition at line 168 of file kddata.c.

◆ Kd_KBDHID_Mask

ULONG Kd_KBDHID_Mask

Definition at line 166 of file kddata.c.

◆ Kd_KSECDD_Mask

ULONG Kd_KSECDD_Mask

Definition at line 282 of file kddata.c.

◆ Kd_KTM_Mask

ULONG Kd_KTM_Mask

Definition at line 259 of file kddata.c.

◆ Kd_LDR_Mask

ULONG Kd_LDR_Mask

Definition at line 233 of file kddata.c.

◆ Kd_LSASS_Mask

ULONG Kd_LSASS_Mask

Definition at line 289 of file kddata.c.

◆ Kd_LSERMOUS_Mask

ULONG Kd_LSERMOUS_Mask

Definition at line 165 of file kddata.c.

◆ Kd_LUAFV_Mask

ULONG Kd_LUAFV_Mask

Definition at line 273 of file kddata.c.

◆ Kd_MCHGR_Mask

ULONG Kd_MCHGR_Mask

Definition at line 204 of file kddata.c.

◆ Kd_MM_Mask

ULONG Kd_MM_Mask

Definition at line 250 of file kddata.c.

◆ Kd_MMCSS_Mask

ULONG Kd_MMCSS_Mask

Definition at line 264 of file kddata.c.

◆ Kd_MOUCLASS_Mask

ULONG Kd_MOUCLASS_Mask

Definition at line 169 of file kddata.c.

◆ Kd_MOUHID_Mask

ULONG Kd_MOUHID_Mask

Definition at line 167 of file kddata.c.

◆ Kd_MOUNTMGR_Mask

ULONG Kd_MOUNTMGR_Mask

Definition at line 279 of file kddata.c.

◆ Kd_MPIO_Mask

ULONG Kd_MPIO_Mask

Definition at line 284 of file kddata.c.

◆ Kd_MSDSM_Mask

ULONG Kd_MSDSM_Mask

Definition at line 285 of file kddata.c.

◆ Kd_NDIS_Mask

ULONG Kd_NDIS_Mask

Definition at line 271 of file kddata.c.

◆ Kd_NETAPI_Mask

ULONG Kd_NETAPI_Mask

Definition at line 184 of file kddata.c.

◆ Kd_NTFS_Mask

ULONG Kd_NTFS_Mask

Definition at line 151 of file kddata.c.

◆ Kd_NTOSPNP_Mask

ULONG Kd_NTOSPNP_Mask

Definition at line 180 of file kddata.c.

◆ Kd_NVCTRACE_Mask

ULONG Kd_NVCTRACE_Mask

Definition at line 272 of file kddata.c.

◆ Kd_PCI_Mask

ULONG Kd_PCI_Mask

Definition at line 214 of file kddata.c.

◆ Kd_PCIIDE_Mask

ULONG Kd_PCIIDE_Mask

Definition at line 206 of file kddata.c.

◆ Kd_PERFLIB_Mask

ULONG Kd_PERFLIB_Mask

Definition at line 258 of file kddata.c.

◆ Kd_PNPMEM_Mask

ULONG Kd_PNPMEM_Mask

Definition at line 220 of file kddata.c.

◆ Kd_PNPMGR_Mask

ULONG Kd_PNPMGR_Mask

Definition at line 183 of file kddata.c.

◆ Kd_PREFETCHER_Mask

ULONG Kd_PREFETCHER_Mask

Definition at line 211 of file kddata.c.

◆ Kd_PRINTSPOOLER_Mask

ULONG Kd_PRINTSPOOLER_Mask

Definition at line 239 of file kddata.c.

◆ Kd_PROCESSOR_Mask

ULONG Kd_PROCESSOR_Mask

Definition at line 221 of file kddata.c.

◆ Kd_PSHED_Mask

ULONG Kd_PSHED_Mask

Definition at line 287 of file kddata.c.

◆ Kd_REDBOOK_Mask

ULONG Kd_REDBOOK_Mask

Definition at line 158 of file kddata.c.

◆ Kd_RPCPROXY_Mask

ULONG Kd_RPCPROXY_Mask

Definition at line 190 of file kddata.c.

◆ Kd_RSFILTER_Mask

ULONG Kd_RSFILTER_Mask

Definition at line 212 of file kddata.c.

◆ Kd_RTLTHREADPOOL_Mask

ULONG Kd_RTLTHREADPOOL_Mask

Definition at line 232 of file kddata.c.

◆ Kd_SAMSS_Mask

ULONG Kd_SAMSS_Mask

Definition at line 182 of file kddata.c.

◆ Kd_SBP2PORT_Mask

ULONG Kd_SBP2PORT_Mask

Definition at line 276 of file kddata.c.

◆ Kd_SCCLIENT_Mask

ULONG Kd_SCCLIENT_Mask

Definition at line 186 of file kddata.c.

◆ Kd_SCSERVER_Mask

ULONG Kd_SCSERVER_Mask

Definition at line 185 of file kddata.c.

◆ Kd_SCSIMINIPORT_Mask

ULONG Kd_SCSIMINIPORT_Mask

Definition at line 161 of file kddata.c.

◆ Kd_SCSIPORT_Mask

ULONG Kd_SCSIPORT_Mask

Definition at line 160 of file kddata.c.

◆ Kd_SE_Mask

ULONG Kd_SE_Mask

Definition at line 295 of file kddata.c.

◆ Kd_SERENUM_Mask

ULONG Kd_SERENUM_Mask

Definition at line 188 of file kddata.c.

◆ Kd_SERIAL_Mask

ULONG Kd_SERIAL_Mask

Definition at line 187 of file kddata.c.

◆ Kd_SERMOUSE_Mask

ULONG Kd_SERMOUSE_Mask

Definition at line 164 of file kddata.c.

◆ Kd_SETUP_Mask

ULONG Kd_SETUP_Mask

Definition at line 150 of file kddata.c.

◆ Kd_SHPC_Mask

ULONG Kd_SHPC_Mask

Definition at line 236 of file kddata.c.

◆ Kd_SIS_Mask

ULONG Kd_SIS_Mask

Definition at line 194 of file kddata.c.

◆ Kd_SMSS_Mask

ULONG Kd_SMSS_Mask

Definition at line 149 of file kddata.c.

◆ Kd_SOFTPCI_Mask

ULONG Kd_SOFTPCI_Mask

Definition at line 202 of file kddata.c.

◆ Kd_SR_Mask

ULONG Kd_SR_Mask

Definition at line 223 of file kddata.c.

◆ Kd_SSPICLI_Mask

ULONG Kd_SSPICLI_Mask

Definition at line 290 of file kddata.c.

◆ Kd_STORMINIPORT_Mask

ULONG Kd_STORMINIPORT_Mask

Definition at line 238 of file kddata.c.

◆ Kd_STORPORT_Mask

ULONG Kd_STORPORT_Mask

Definition at line 237 of file kddata.c.

◆ Kd_STORPROP_Mask

ULONG Kd_STORPROP_Mask

Definition at line 159 of file kddata.c.

◆ Kd_STORVSP_Mask

ULONG Kd_STORVSP_Mask

Definition at line 288 of file kddata.c.

◆ Kd_SVCHOST_Mask

ULONG Kd_SVCHOST_Mask

Definition at line 176 of file kddata.c.

◆ Kd_SXS_Mask

ULONG Kd_SXS_Mask

Definition at line 199 of file kddata.c.

◆ Kd_SYSTEM_Mask

ULONG Kd_SYSTEM_Mask

Definition at line 148 of file kddata.c.

◆ Kd_TAPE_Mask

ULONG Kd_TAPE_Mask

Definition at line 203 of file kddata.c.

◆ Kd_TCPIP6_Mask

ULONG Kd_TCPIP6_Mask

Definition at line 234 of file kddata.c.

◆ Kd_TCPIP_Mask

ULONG Kd_TCPIP_Mask

Definition at line 178 of file kddata.c.

◆ Kd_TERMSRV_Mask

ULONG Kd_TERMSRV_Mask

Definition at line 209 of file kddata.c.

◆ Kd_THREADORDER_Mask

ULONG Kd_THREADORDER_Mask

Definition at line 266 of file kddata.c.

◆ Kd_TPM_Mask

ULONG Kd_TPM_Mask

Definition at line 265 of file kddata.c.

◆ Kd_TWOTRACK_Mask

ULONG Kd_TWOTRACK_Mask

Definition at line 170 of file kddata.c.

◆ Kd_TXF_Mask

ULONG Kd_TXF_Mask

Definition at line 281 of file kddata.c.

◆ Kd_UDFS_Mask

ULONG Kd_UDFS_Mask

Definition at line 286 of file kddata.c.

◆ Kd_UHCD_Mask

ULONG Kd_UHCD_Mask

Definition at line 189 of file kddata.c.

◆ Kd_UNIMODEM_Mask

ULONG Kd_UNIMODEM_Mask

Definition at line 193 of file kddata.c.

◆ Kd_USBSTOR_Mask

ULONG Kd_USBSTOR_Mask

Definition at line 275 of file kddata.c.

◆ Kd_USERGDI_Mask

ULONG Kd_USERGDI_Mask

Definition at line 263 of file kddata.c.

◆ Kd_VDS_Mask

ULONG Kd_VDS_Mask

Definition at line 242 of file kddata.c.

◆ Kd_VDSBAS_Mask

ULONG Kd_VDSBAS_Mask

Definition at line 243 of file kddata.c.

◆ Kd_VDSDYN_Mask

ULONG Kd_VDSDYN_Mask

Definition at line 244 of file kddata.c.

◆ Kd_VDSDYNDR_Mask

ULONG Kd_VDSDYNDR_Mask

Definition at line 245 of file kddata.c.

◆ Kd_VDSLDR_Mask

ULONG Kd_VDSLDR_Mask

Definition at line 246 of file kddata.c.

◆ Kd_VDSUTIL_Mask

ULONG Kd_VDSUTIL_Mask

Definition at line 247 of file kddata.c.

◆ Kd_VERIFIER_Mask

ULONG Kd_VERIFIER_Mask

Definition at line 241 of file kddata.c.

◆ Kd_VIDEO_Mask

ULONG Kd_VIDEO_Mask

Definition at line 175 of file kddata.c.

◆ Kd_VIDEOPRT_Mask

ULONG Kd_VIDEOPRT_Mask

Definition at line 177 of file kddata.c.

◆ Kd_VSS_Mask

ULONG Kd_VSS_Mask

Definition at line 219 of file kddata.c.

◆ Kd_VSSDYNDISK_Mask

ULONG Kd_VSSDYNDISK_Mask

Definition at line 240 of file kddata.c.

◆ Kd_W32TIME_Mask

ULONG Kd_W32TIME_Mask

Definition at line 210 of file kddata.c.

◆ Kd_WDI_Mask

ULONG Kd_WDI_Mask

Definition at line 257 of file kddata.c.

◆ Kd_WDT_Mask

ULONG Kd_WDT_Mask

Definition at line 269 of file kddata.c.

◆ Kd_WHEA_Mask

ULONG Kd_WHEA_Mask

Definition at line 262 of file kddata.c.

◆ Kd_WIN2000_Mask

ULONG Kd_WIN2000_Mask

Definition at line 147 of file kddata.c.

Referenced by KdpPrint(), NtQueryDebugFilterState(), and NtSetDebugFilterState().

◆ Kd_WMICORE_Mask

ULONG Kd_WMICORE_Mask

Definition at line 196 of file kddata.c.

◆ Kd_WMILIB_Mask

ULONG Kd_WMILIB_Mask

Definition at line 171 of file kddata.c.

◆ Kd_WOW64_Mask

ULONG Kd_WOW64_Mask

Definition at line 252 of file kddata.c.

◆ Kd_WSOCKTRANSPORT_Mask

ULONG Kd_WSOCKTRANSPORT_Mask

Definition at line 218 of file kddata.c.

◆ Kd_XSAVE_Mask

ULONG Kd_XSAVE_Mask

Definition at line 294 of file kddata.c.

◆ KdAutoEnableOnEvent

BOOLEAN KdAutoEnableOnEvent

Referenced by KdInitSystem(), and KdpStub().

◆ KdBlockEnable

BOOLEAN KdBlockEnable

Referenced by KdInitSystem().

◆ KdBreakAfterSymbolLoad

BOOLEAN KdBreakAfterSymbolLoad

Definition at line 51 of file kdmain.c.

Referenced by ExpInitializeExecutive(), and KdInitSystem().

◆ KdComponentTable

Definition at line 303 of file kddata.c.

Referenced by KdpPrint(), NtQueryDebugFilterState(), and NtSetDebugFilterState().

◆ KdComponentTableSize

ULONG KdComponentTableSize

Definition at line 459 of file kddata.c.

Referenced by KdpPrint(), NtQueryDebugFilterState(), and NtSetDebugFilterState().

◆ KdDebuggerDataBlock

KDDEBUGGER_DATA64 KdDebuggerDataBlock

Definition at line 21 of file kdpacket.c.

Referenced by GetVersionSendHandler().

◆ KdDisableCount

ULONG KdDisableCount

◆ KdEnteredDebugger

BOOLEAN KdEnteredDebugger

Definition at line 49 of file kdmain.c.

◆ KdIgnoreUmExceptions

BOOLEAN KdIgnoreUmExceptions

Definition at line 53 of file kdmain.c.

Referenced by KdInitSystem(), and KiDispatchException().

◆ KdpBreakpointInstruction

KD_BREAKPOINT_TYPE KdpBreakpointInstruction

◆ KdpBreakpointTable

◆ KdpContext

KD_CONTEXT KdpContext

Definition at line 65 of file kddata.c.

Referenced by KdInitSystem(), KdPollBreakIn(), and KdpPollBreakInWithPortLock().

◆ KdpContextSent

BOOLEAN KdpContextSent

Definition at line 69 of file kddata.c.

◆ KdpControlCPressed

BOOLEAN KdpControlCPressed

Definition at line 68 of file kddata.c.

Referenced by KdPollBreakIn(), and KdpReport().

◆ KdpCurrentSymbolEnd

ULONG_PTR KdpCurrentSymbolEnd

Definition at line 109 of file kddata.c.

Referenced by KdpGetStateChange().

◆ KdpCurrentSymbolStart

ULONG_PTR KdpCurrentSymbolStart

Definition at line 109 of file kddata.c.

Referenced by KdpGetStateChange().

◆ KdpDataSpinLock

KSPIN_LOCK KdpDataSpinLock

Definition at line 465 of file kddata.c.

Referenced by KdRegisterDebuggerDataBlock().

◆ KdpDebuggerDataListHead

LIST_ENTRY KdpDebuggerDataListHead

Definition at line 464 of file kddata.c.

Referenced by KdInitSystem(), and KdRegisterDebuggerDataBlock().

◆ KdpDebuggerLock

KSPIN_LOCK KdpDebuggerLock

Definition at line 67 of file kddata.c.

Referenced by KdPollBreakIn(), KdpPortLock(), and KdpPortUnlock().

◆ KdpDebuggerStructuresInitialized

BOOLEAN KdpDebuggerStructuresInitialized

Referenced by KdInitSystem().

◆ KdPerformanceCounterRate

LARGE_INTEGER KdPerformanceCounterRate

Referenced by KdInitSystem().

◆ KdPitchDebugger

BOOLEAN KdPitchDebugger

Definition at line 52 of file kdmain.c.

Referenced by KdInitSystem(), KdpStub(), KeBugCheckWithTf(), and KeEnterKernelDebugger().

◆ KdpMessageBuffer

CHAR KdpMessageBuffer[0x1000]

Definition at line 131 of file kddata.c.

◆ KdpNumInternalBreakpoints

ULONG KdpNumInternalBreakpoints

Definition at line 104 of file kddata.c.

◆ KdpOweBreakpoint

◆ KdpPathBuffer

CHAR KdpPathBuffer[0x1000]

Definition at line 132 of file kddata.c.

◆ KdpPortLocked

BOOLEAN KdpPortLocked

Definition at line 66 of file kddata.c.

◆ KdPreviouslyEnabled

BOOLEAN KdPreviouslyEnabled

Referenced by KdpStub().

◆ KdPrintDefaultCircularBuffer

CHAR KdPrintDefaultCircularBuffer[KD_DEFAULT_LOG_BUFFER_SIZE]

Definition at line 137 of file kddata.c.

◆ KdpTimeSlipDpc

KDPC KdpTimeSlipDpc

Definition at line 120 of file kddata.c.

Referenced by KdInitSystem().

◆ KdpTimeSlipEvent

PKEVENT KdpTimeSlipEvent

Definition at line 124 of file kddata.c.

◆ KdpTimeSlipEventLock

KSPIN_LOCK KdpTimeSlipEventLock

Definition at line 125 of file kddata.c.

◆ KdpTimeSlipPending

LONG KdpTimeSlipPending

Definition at line 123 of file kddata.c.

Referenced by Phase1InitializationDiscard().

◆ KdpTimeSlipTimer

KTIMER KdpTimeSlipTimer

Definition at line 121 of file kddata.c.

Referenced by KdInitSystem().

◆ KdpTimeSlipWorkItem

WORK_QUEUE_ITEM KdpTimeSlipWorkItem

Definition at line 122 of file kddata.c.

Referenced by KdInitSystem().

◆ KdTimerDifference

LARGE_INTEGER KdTimerDifference

Definition at line 126 of file kddata.c.

◆ KdTimerStart

LARGE_INTEGER KdTimerStart

Definition at line 548 of file kd64.h.

Referenced by KdInitSystem().

◆ KdTimerStop

LARGE_INTEGER KdTimerStop

Definition at line 126 of file kddata.c.

◆ KdVersionBlock

DBGKD_GET_VERSION64 KdVersionBlock

Definition at line 470 of file kddata.c.

Referenced by KdInitSystem(), and KiDispatchException().

◆ KiDebugRoutine

PKDEBUG_ROUTINE KiDebugRoutine

Definition at line 448 of file kdmain.c.

Referenced by KdInitSystem(), and KiDispatchException().

◆ KiDebugSwitchRoutine

PKDEBUG_SWITCH_ROUTINE KiDebugSwitchRoutine

Referenced by KdInitSystem().

◆ TraceDataBuffer

ULONG TraceDataBuffer[40]

Definition at line 114 of file kddata.c.

◆ TraceDataBufferPosition

ULONG TraceDataBufferPosition

Definition at line 115 of file kddata.c.