ReactOS  0.4.14-dev-342-gdc047f9
kdmain.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
Include dependency graph for kdmain.c:

Go to the source code of this file.

Classes

struct  KD_COMPONENT_DATA
 

Macros

#define NDEBUG
 
#define MAX_KD_COMPONENT_TABLE_ENTRIES   128
 

Functions

VOID NTAPI PspDumpThreads (BOOLEAN SystemThreads)
 
ULONG NTAPI KdpServiceDispatcher (ULONG Service, PVOID Buffer1, ULONG Buffer1Length, KPROCESSOR_MODE PreviousMode)
 
BOOLEAN NTAPI KdpEnterDebuggerException (IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame, IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context, IN KPROCESSOR_MODE PreviousMode, IN BOOLEAN SecondChance)
 
BOOLEAN NTAPI KdIsThisAKdTrap (IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context, IN KPROCESSOR_MODE PreviousMode)
 
VOID NTAPI KdUpdateDataBlock (VOID)
 
BOOLEAN NTAPI KdRefreshDebuggerNotPresent (VOID)
 
NTSTATUS NTAPI KdDisableDebugger (VOID)
 
NTSTATUS NTAPI KdEnableDebuggerWithLock (IN BOOLEAN NeedLock)
 
NTSTATUS NTAPI KdEnableDebugger (VOID)
 
BOOLEAN NTAPI KdPollBreakIn (VOID)
 
NTSTATUS NTAPI KdPowerTransition (ULONG PowerState)
 
NTSTATUS NTAPI KdChangeOption (IN KD_OPTION Option, IN ULONG InBufferLength OPTIONAL, IN PVOID InBuffer, IN ULONG OutBufferLength OPTIONAL, OUT PVOID OutBuffer, OUT PULONG OutBufferRequiredLength OPTIONAL)
 
NTSTATUS NTAPI NtQueryDebugFilterState (IN ULONG ComponentId, IN ULONG Level)
 
NTSTATUS NTAPI NtSetDebugFilterState (IN ULONG ComponentId, IN ULONG Level, IN BOOLEAN State)
 
NTSTATUS NTAPI KdSystemDebugControl (IN SYSDBG_COMMAND Command, IN PVOID InputBuffer, IN ULONG InputBufferLength, OUT PVOID OutputBuffer, IN ULONG OutputBufferLength, IN OUT PULONG ReturnLength, IN KPROCESSOR_MODE PreviousMode)
 

Variables

BOOLEAN KdDebuggerEnabled = FALSE
 
BOOLEAN KdEnteredDebugger = FALSE
 
BOOLEAN KdDebuggerNotPresent = TRUE
 
BOOLEAN KdBreakAfterSymbolLoad = FALSE
 
BOOLEAN KdPitchDebugger = TRUE
 
BOOLEAN KdIgnoreUmExceptions = FALSE
 
KD_CONTEXT KdpContext
 
ULONG Kd_WIN2000_Mask
 
LONG KdpTimeSlipPending
 
KDDEBUGGER_DATA64 KdDebuggerDataBlock
 
KD_COMPONENT_DATA KdpComponentTable [MAX_KD_COMPONENT_TABLE_ENTRIES]
 
ULONG KdComponentTableEntries = 0
 
ULONG Kd_DEFAULT_MASK = 1 << DPFLTR_ERROR_LEVEL
 
PKDEBUG_ROUTINE KiDebugRoutine = KdpEnterDebuggerException
 

Macro Definition Documentation

◆ MAX_KD_COMPONENT_TABLE_ENTRIES

#define MAX_KD_COMPONENT_TABLE_ENTRIES   128

Definition at line 33 of file kdmain.c.

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file kdmain.c.

Function Documentation

◆ KdChangeOption()

NTSTATUS NTAPI KdChangeOption ( IN KD_OPTION  Option,
IN ULONG InBufferLength  OPTIONAL,
IN PVOID  InBuffer,
IN ULONG OutBufferLength  OPTIONAL,
OUT PVOID  OutBuffer,
OUT PULONG OutBufferRequiredLength  OPTIONAL 
)

Definition at line 373 of file kdmain.c.

379 {
381  return STATUS_NOT_IMPLEMENTED;
382 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114

◆ KdDisableDebugger()

NTSTATUS NTAPI KdDisableDebugger ( VOID  )

Definition at line 295 of file kdmain.c.

296 {
297  KIRQL OldIrql;
298 
299  /* Raise IRQL */
301 
302  /* TODO: Disable any breakpoints */
303 
304  /* Disable the Debugger */
306  SharedUserData->KdDebuggerEnabled = FALSE;
307 
308  /* Lower the IRQL */
310 
311  /* Return success */
312  return STATUS_SUCCESS;
313 }
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
UCHAR KIRQL
Definition: env_spec_w32.h:591
BOOLEAN KdDebuggerEnabled
Definition: kdmain.c:16
#define SharedUserData
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by PcipGetFunctionLimits().

◆ KdEnableDebugger()

NTSTATUS NTAPI KdEnableDebugger ( VOID  )

Definition at line 327 of file kdmain.c.

328 {
329  KIRQL OldIrql;
330 
331  /* Raise IRQL */
333 
334  /* TODO: Re-enable any breakpoints */
335 
336  /* Enable the Debugger */
338  SharedUserData->KdDebuggerEnabled = TRUE;
339 
340  /* Lower the IRQL */
342 
343  /* Return success */
344  return STATUS_SUCCESS;
345 }
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define TRUE
Definition: types.h:120
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
UCHAR KIRQL
Definition: env_spec_w32.h:591
BOOLEAN KdDebuggerEnabled
Definition: kdmain.c:16
#define SharedUserData
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by KdpStub(), and PcipGetFunctionLimits().

◆ KdEnableDebuggerWithLock()

NTSTATUS NTAPI KdEnableDebuggerWithLock ( IN BOOLEAN  NeedLock)

Definition at line 317 of file kdmain.c.

318 {
319  return STATUS_ACCESS_DENIED;
320 }
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145

◆ KdIsThisAKdTrap()

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

Definition at line 261 of file kdmain.c.

264 {
265  /* KDBG has its own mechanism for ignoring user mode exceptions */
266  return FALSE;
267 }

◆ KdpEnterDebuggerException()

BOOLEAN NTAPI KdpEnterDebuggerException ( 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 125 of file kdmain.c.

131 {
132  KD_CONTINUE_TYPE Return = kdHandleException;
133  ULONG ExceptionCommand = ExceptionRecord->ExceptionInformation[0];
134 
135  /* Check if this was a breakpoint due to DbgPrint or Load/UnloadSymbols */
136  if ((ExceptionRecord->ExceptionCode == STATUS_BREAKPOINT) &&
137  (ExceptionRecord->NumberParameters > 0) &&
138  ((ExceptionCommand == BREAKPOINT_LOAD_SYMBOLS) ||
139  (ExceptionCommand == BREAKPOINT_UNLOAD_SYMBOLS) ||
140  (ExceptionCommand == BREAKPOINT_COMMAND_STRING) ||
141  (ExceptionCommand == BREAKPOINT_PRINT) ||
142  (ExceptionCommand == BREAKPOINT_PROMPT)))
143  {
144  /* Check if this is a debug print */
145  if (ExceptionCommand == BREAKPOINT_PRINT)
146  {
147  /* Print the string */
149  (PVOID)ExceptionRecord->ExceptionInformation[1],
150  ExceptionRecord->ExceptionInformation[2],
151  PreviousMode);
152 
153  /* Return success */
155  }
156 #ifdef KDBG
157  else if (ExceptionCommand == BREAKPOINT_LOAD_SYMBOLS)
158  {
159  PKD_SYMBOLS_INFO SymbolsInfo;
160  KD_SYMBOLS_INFO CapturedSymbolsInfo;
161  PLDR_DATA_TABLE_ENTRY LdrEntry;
162 
163  SymbolsInfo = (PKD_SYMBOLS_INFO)ExceptionRecord->ExceptionInformation[2];
165  {
166  _SEH2_TRY
167  {
168  ProbeForRead(SymbolsInfo,
169  sizeof(*SymbolsInfo),
170  1);
171  RtlCopyMemory(&CapturedSymbolsInfo,
172  SymbolsInfo,
173  sizeof(*SymbolsInfo));
174  SymbolsInfo = &CapturedSymbolsInfo;
175  }
177  {
178  SymbolsInfo = NULL;
179  }
180  _SEH2_END;
181  }
182 
183  if (SymbolsInfo != NULL)
184  {
185  /* Load symbols. Currently implemented only for KDBG! */
186  if (KdbpSymFindModule(SymbolsInfo->BaseOfDll, NULL, -1, &LdrEntry))
187  {
188  KdbSymProcessSymbols(LdrEntry);
189  }
190  }
191  }
192  else if (ExceptionCommand == BREAKPOINT_PROMPT)
193  {
195  LPSTR OutString;
196  USHORT OutStringLength;
197 
198  /* Get the response string and length */
199  OutString = (LPSTR)Context->Ebx;
200  OutStringLength = (USHORT)Context->Edi;
201 
202  /* Call KDBG */
203  ReturnValue = KdpPrompt((LPSTR)ExceptionRecord->
204  ExceptionInformation[1],
205  (USHORT)ExceptionRecord->
206  ExceptionInformation[2],
207  OutString,
208  OutStringLength,
209  PreviousMode,
210  TrapFrame,
211  ExceptionFrame);
212 
213  /* Return the number of characters that we received */
214  Context->Eax = ReturnValue;
215  }
216 #endif
217 
218  /* This we can handle: simply bump the Program Counter */
220  return TRUE;
221  }
222 
223 #ifdef KDBG
224  /* Check if this is an assertion failure */
225  if (ExceptionRecord->ExceptionCode == STATUS_ASSERTION_FAILURE)
226  {
227  /* Bump EIP to the instruction following the int 2C */
228  Context->Eip += 2;
229  }
230 #endif
231 
232  /* Get out of here if the Debugger isn't connected */
233  if (KdDebuggerNotPresent) return FALSE;
234 
235 #ifdef KDBG
236  /* Call KDBG if available */
237  Return = KdbEnterDebuggerException(ExceptionRecord,
238  PreviousMode,
239  Context,
240  TrapFrame,
241  !SecondChance);
242 #else /* not KDBG */
243  if (WrapperInitRoutine)
244  {
245  /* Call GDB */
246  Return = WrapperTable.KdpExceptionRoutine(ExceptionRecord,
247  Context,
248  TrapFrame);
249  }
250 #endif /* not KDBG */
251 
252  /* Debugger didn't handle it, please handle! */
253  if (Return == kdHandleException) return FALSE;
254 
255  /* Debugger handled it */
256  return TRUE;
257 }
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
struct _KD_SYMBOLS_INFO * PKD_SYMBOLS_INFO
#define KeSetContextReturnRegister(Context, ReturnValue)
Definition: ke.h:139
ULONG NTAPI KdpServiceDispatcher(ULONG Service, PVOID Buffer1, ULONG Buffer1Length, KPROCESSOR_MODE PreviousMode)
Definition: kdmain.c:43
USHORT NTAPI KdpPrompt(IN LPSTR PromptString, IN USHORT PromptLength, OUT LPSTR ResponseString, IN USHORT MaximumResponseLength, IN KPROCESSOR_MODE PreviousMode, IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame)
char * LPSTR
Definition: xmlstorage.h:182
_SEH2_TRY
Definition: create.c:4250
UINT32 void void ** ReturnValue
Definition: acevents.h:214
#define BREAKPOINT_UNLOAD_SYMBOLS
Definition: kdtypes.h:54
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define STATUS_BREAKPOINT
Definition: ntstatus.h:172
PVOID BaseOfDll
Definition: kdtypes.h:170
#define KeGetContextPc(Context)
Definition: ke.h:124
#define BREAKPOINT_PROMPT
Definition: kdtypes.h:52
#define STATUS_ASSERTION_FAILURE
Definition: ntstatus.h:946
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define BREAKPOINT_PRINT
Definition: kdtypes.h:51
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
VOID KdbSymProcessSymbols(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
Definition: kdb_symbols.c:424
Definition: btrfs_drv.h:1853
PKDP_INIT_ROUTINE WrapperInitRoutine
Definition: kdinit.c:27
_SEH2_END
Definition: create.c:4424
unsigned short USHORT
Definition: pedump.c:61
#define BREAKPOINT_LOAD_SYMBOLS
Definition: kdtypes.h:53
KD_DISPATCH_TABLE WrapperTable
Definition: kdinit.c:28
unsigned int ULONG
Definition: retypes.h:1
#define BREAKPOINT_COMMAND_STRING
Definition: kdtypes.h:55
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define KD_BREAKPOINT_SIZE
Definition: ke.h:118
KD_CONTINUE_TYPE KdbEnterDebuggerException(IN PEXCEPTION_RECORD ExceptionRecord OPTIONAL, IN KPROCESSOR_MODE PreviousMode, IN PCONTEXT Context, IN OUT PKTRAP_FRAME TrapFrame, IN BOOLEAN FirstChance)
KDB Exception filter.
Definition: kdb.c:1325
#define KeSetContextPc(Context, ProgramCounter)
Definition: ke.h:127
return STATUS_SUCCESS
Definition: btrfs.c:2938
BOOLEAN KdDebuggerNotPresent
Definition: kdmain.c:18
BOOLEAN KdbpSymFindModule(IN PVOID Address OPTIONAL, IN LPCWSTR Name OPTIONAL, IN INT Index OPTIONAL, OUT PLDR_DATA_TABLE_ENTRY *pLdrEntry)
Find a module...
Definition: kdb_symbols.c:76

◆ KdPollBreakIn()

BOOLEAN NTAPI KdPollBreakIn ( VOID  )

Definition at line 352 of file kdmain.c.

353 {
354  return FALSE;
355 }

Referenced by KdInitSystem(), KeUpdateSystemTime(), KiInitializeSystem(), KiSystemStartup(), and KiSystemStartupReal().

◆ KdPowerTransition()

NTSTATUS NTAPI KdPowerTransition ( ULONG  PowerState)

Definition at line 362 of file kdmain.c.

363 {
365  return STATUS_NOT_IMPLEMENTED;
366 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114

◆ KdpServiceDispatcher()

ULONG NTAPI KdpServiceDispatcher ( ULONG  Service,
PVOID  Buffer1,
ULONG  Buffer1Length,
KPROCESSOR_MODE  PreviousMode 
)

Definition at line 43 of file kdmain.c.

47 {
48  ULONG Result = 0;
49 
50  switch (Service)
51  {
52  case BREAKPOINT_PRINT: /* DbgPrint */
53  Result = KdpPrintString(Buffer1, Buffer1Length, PreviousMode);
54  break;
55 
56 #if DBG
57  case ' soR': /* ROS-INTERNAL */
58  {
59  switch ((ULONG_PTR)Buffer1)
60  {
61  case DumpAllThreads:
63  break;
64 
65  case DumpUserThreads:
67  break;
68 
69  case KdSpare3:
71  break;
72 
73  default:
74  break;
75  }
76  break;
77  }
78 
79 #if defined(_M_IX86) && !defined(_WINKD_) // See ke/i386/traphdlr.c
80  /* Register a debug callback */
81  case 'CsoR':
82  {
83  switch (Buffer1Length)
84  {
85  case ID_Win32PreServiceHook:
86  KeWin32PreServiceHook = Buffer1;
87  break;
88 
89  case ID_Win32PostServiceHook:
90  KeWin32PostServiceHook = Buffer1;
91  break;
92 
93  }
94  break;
95  }
96 #endif
97 
98  /* Special case for stack frame dumps */
99  case 'DsoR':
100  {
101  KeRosDumpStackFrames((PULONG)Buffer1, Buffer1Length);
102  break;
103  }
104 
105 #if defined(KDBG)
106  /* Register KDBG CLI callback */
107  case 'RbdK':
108  {
109  Result = KdbRegisterCliCallback(Buffer1, Buffer1Length);
110  break;
111  }
112 #endif /* KDBG */
113 #endif /* DBG */
114  default:
115  DPRINT1("Invalid debug service call!\n");
116  HalDisplayString("Invalid debug service call!\r\n");
117  break;
118  }
119 
120  return Result;
121 }
#define KeRosDumpStackFrames(Frames, Count)
Definition: gdidebug.h:11
#define TRUE
Definition: types.h:120
VOID NTAPI MmDumpArmPfnDatabase(IN BOOLEAN StatusOnly)
Definition: mminit.c:1474
VOID NTAPI PspDumpThreads(BOOLEAN SystemThreads)
uint32_t ULONG_PTR
Definition: typedefs.h:63
BOOLEAN NTAPI KdbRegisterCliCallback(PVOID Callback, BOOLEAN Deregister)
Definition: kdb_cli.c:3462
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
#define BREAKPOINT_PRINT
Definition: kdtypes.h:51
unsigned int * PULONG
Definition: retypes.h:1
NTHALAPI VOID NTAPI HalDisplayString(PUCHAR String)
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
ULONG NTAPI KdpPrintString(_In_reads_bytes_(Length) PCHAR UnsafeString, _In_ ULONG Length, _In_ KPROCESSOR_MODE PreviousMode)
Definition: kdio.c:573

Referenced by KdpEnterDebuggerException(), and KdSystemDebugControl().

◆ KdRefreshDebuggerNotPresent()

BOOLEAN NTAPI KdRefreshDebuggerNotPresent ( VOID  )

Definition at line 282 of file kdmain.c.

283 {
285 
286  /* Just return whatever was set previously -- FIXME! */
287  return KdDebuggerNotPresent;
288 }
#define UNIMPLEMENTED
Definition: debug.h:114
BOOLEAN KdDebuggerNotPresent
Definition: kdmain.c:18

◆ KdSystemDebugControl()

NTSTATUS NTAPI KdSystemDebugControl ( IN SYSDBG_COMMAND  Command,
IN PVOID  InputBuffer,
IN ULONG  InputBufferLength,
OUT PVOID  OutputBuffer,
IN ULONG  OutputBufferLength,
IN OUT PULONG  ReturnLength,
IN KPROCESSOR_MODE  PreviousMode 
)

Definition at line 474 of file kdmain.c.

481 {
482  /* HACK */
484  InputBuffer,
486  PreviousMode);
487 }
ULONG NTAPI KdpServiceDispatcher(ULONG Service, PVOID Buffer1, ULONG Buffer1Length, KPROCESSOR_MODE PreviousMode)
Definition: kdmain.c:43
Definition: shell.h:41
CHAR InputBuffer[80]
Definition: conmgr.c:33
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG InputBufferLength
Definition: fltkernel.h:1372

Referenced by DriverEntry(), i8042KbdInterruptService(), KdRosDumpStackFrames(), KdRosSetDebugCallback(), and NtSystemDebugControl().

◆ KdUpdateDataBlock()

VOID NTAPI KdUpdateDataBlock ( VOID  )

Definition at line 273 of file kdmain.c.

274 {
275 }

◆ NtQueryDebugFilterState()

NTSTATUS NTAPI NtQueryDebugFilterState ( IN ULONG  ComponentId,
IN ULONG  Level 
)

Definition at line 387 of file kdmain.c.

389 {
390  ULONG i;
391 
392  /* Convert Level to mask if it isn't already one */
393  if (Level < 32)
394  Level = 1 << Level;
395 
396  /* Check if it is not the default component */
397  if (ComponentId != MAXULONG)
398  {
399  /* No, search for an existing entry in the table */
400  for (i = 0; i < KdComponentTableEntries; i++)
401  {
402  /* Check if it is the right component */
404  {
405  /* Check if mask are matching */
406  return (Level & KdpComponentTable[i].Level) ? TRUE : FALSE;
407  }
408  }
409  }
410 
411  /* Entry not found in the table, use default mask */
412  return (Level & Kd_DEFAULT_MASK) ? TRUE : FALSE;
413 }
#define TRUE
Definition: types.h:120
_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
KD_COMPONENT_DATA KdpComponentTable[MAX_KD_COMPONENT_TABLE_ENTRIES]
Definition: kdmain.c:34
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
#define MAXULONG
Definition: typedefs.h:250
ULONG Kd_DEFAULT_MASK
Definition: kdmain.c:37
ULONG KdComponentTableEntries
Definition: kdmain.c:35
unsigned int ULONG
Definition: retypes.h:1

Referenced by DbgQueryDebugFilterState(), and vDbgPrintExWithPrefixInternal().

◆ NtSetDebugFilterState()

NTSTATUS NTAPI NtSetDebugFilterState ( IN ULONG  ComponentId,
IN ULONG  Level,
IN BOOLEAN  State 
)

Definition at line 417 of file kdmain.c.

420 {
421  ULONG i;
422 
423  /* Convert Level to mask if it isn't already one */
424  if (Level < 32)
425  Level = 1 << Level;
426  Level &= ~DPFLTR_MASK;
427 
428  /* Check if it is the default component */
429  if (ComponentId == MAXULONG)
430  {
431  /* Yes, modify the default mask */
432  if (State)
434  else
436 
437  return STATUS_SUCCESS;
438  }
439 
440  /* Search for an existing entry */
441  for (i = 0; i < KdComponentTableEntries; i++ )
442  {
444  break;
445  }
446 
447  /* Check if we have found an existing entry */
448  if (i == KdComponentTableEntries)
449  {
450  /* Check if we have enough space in the table */
453 
454  /* Add a new entry */
458  }
459 
460  /* Update entry table */
461  if (State)
463  else
465 
466  return STATUS_SUCCESS;
467 }
#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
KD_COMPONENT_DATA KdpComponentTable[MAX_KD_COMPONENT_TABLE_ENTRIES]
Definition: kdmain.c:34
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
#define MAX_KD_COMPONENT_TABLE_ENTRIES
Definition: kdmain.c:33
#define STATUS_INVALID_PARAMETER_1
Definition: ntstatus.h:461
#define MAXULONG
Definition: typedefs.h:250
ULONG Kd_DEFAULT_MASK
Definition: kdmain.c:37
ULONG KdComponentTableEntries
Definition: kdmain.c:35
ULONG ComponentId
Definition: kdmain.c:30
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by DbgSetDebugFilterState(), and KdbpCmdFilter().

◆ PspDumpThreads()

VOID NTAPI PspDumpThreads ( BOOLEAN  SystemThreads)

Referenced by KdpServiceDispatcher().

Variable Documentation

◆ Kd_DEFAULT_MASK

ULONG Kd_DEFAULT_MASK = 1 << DPFLTR_ERROR_LEVEL

Definition at line 37 of file kdmain.c.

Referenced by NtQueryDebugFilterState(), and NtSetDebugFilterState().

◆ Kd_WIN2000_Mask

ULONG Kd_WIN2000_Mask

Definition at line 23 of file kdmain.c.

◆ KdBreakAfterSymbolLoad

BOOLEAN KdBreakAfterSymbolLoad = FALSE

Definition at line 19 of file kdmain.c.

◆ KdComponentTableEntries

ULONG KdComponentTableEntries = 0

Definition at line 35 of file kdmain.c.

Referenced by NtQueryDebugFilterState(), and NtSetDebugFilterState().

◆ KdDebuggerDataBlock

KDDEBUGGER_DATA64 KdDebuggerDataBlock

Definition at line 25 of file kdmain.c.

◆ KdDebuggerEnabled

◆ KdDebuggerNotPresent

◆ KdEnteredDebugger

BOOLEAN KdEnteredDebugger = FALSE

Definition at line 17 of file kdmain.c.

◆ KdIgnoreUmExceptions

BOOLEAN KdIgnoreUmExceptions = FALSE

Definition at line 21 of file kdmain.c.

◆ KdpComponentTable

Definition at line 34 of file kdmain.c.

Referenced by NtQueryDebugFilterState(), and NtSetDebugFilterState().

◆ KdpContext

KD_CONTEXT KdpContext

Definition at line 22 of file kdmain.c.

◆ KdPitchDebugger

BOOLEAN KdPitchDebugger = TRUE

Definition at line 20 of file kdmain.c.

◆ KdpTimeSlipPending

LONG KdpTimeSlipPending

Definition at line 24 of file kdmain.c.

◆ KiDebugRoutine

Definition at line 489 of file kdmain.c.