ReactOS  0.4.9-dev-728-g3d012a4
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 KdpCallGdb (IN PKTRAP_FRAME TrapFrame, IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context)
 
BOOLEAN NTAPI KdIsThisAKdTrap (IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context, IN KPROCESSOR_MODE PreviousMode)
 
BOOLEAN NTAPI KdRefreshDebuggerNotPresent (VOID)
 
NTSTATUS NTAPI KdDisableDebugger (VOID)
 
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 KdpBreakPending = FALSE
 
BOOLEAN KdPitchDebugger = TRUE
 
BOOLEAN KdIgnoreUmExceptions = FALSE
 
KD_CONTEXT KdpContext
 
ULONG Kd_WIN2000_Mask
 
KD_COMPONENT_DATA KdComponentTable [MAX_KD_COMPONENT_TABLE_ENTRIES]
 
ULONG KdComponentTableEntries = 0
 
ULONG Kd_DEFAULT_MASK = 1 << DPFLTR_ERROR_LEVEL
 
PKDEBUG_ROUTINE KiDebugRoutine = KdpEnterDebuggerException
 

Macro Definition Documentation

#define MAX_KD_COMPONENT_TABLE_ENTRIES   128

Definition at line 32 of file kdmain.c.

Referenced by NtSetDebugFilterState().

#define NDEBUG

Definition at line 11 of file kdmain.c.

Function Documentation

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 388 of file kdmain.c.

394 {
396  return STATUS_NOT_IMPLEMENTED;
397 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114
NTSTATUS NTAPI KdDisableDebugger ( VOID  )

Definition at line 317 of file kdmain.c.

Referenced by PcipGetFunctionLimits().

318 {
319  KIRQL OldIrql;
320 
321  /* Raise IRQL */
322  KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
323 
324  /* TODO: Disable any breakpoints */
325 
326  /* Disable the Debugger */
328  SharedUserData->KdDebuggerEnabled = FALSE;
329 
330  /* Lower the IRQL */
331  KeLowerIrql(OldIrql);
332 
333  /* Return success */
334  return STATUS_SUCCESS;
335 }
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
return STATUS_SUCCESS
Definition: btrfs.c:2690
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define FALSE
Definition: types.h:117
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
NTSTATUS NTAPI KdEnableDebugger ( VOID  )

Definition at line 342 of file kdmain.c.

Referenced by KdpStub(), and PcipGetFunctionLimits().

343 {
344  KIRQL OldIrql;
345 
346  /* Raise IRQL */
347  KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
348 
349  /* TODO: Re-enable any breakpoints */
350 
351  /* Enable the Debugger */
353  SharedUserData->KdDebuggerEnabled = TRUE;
354 
355  /* Lower the IRQL */
356  KeLowerIrql(OldIrql);
357 
358  /* Return success */
359  return STATUS_SUCCESS;
360 }
#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
return STATUS_SUCCESS
Definition: btrfs.c:2690
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
BOOLEAN NTAPI KdIsThisAKdTrap ( IN PEXCEPTION_RECORD  ExceptionRecord,
IN PCONTEXT  Context,
IN KPROCESSOR_MODE  PreviousMode 
)

Definition at line 289 of file kdmain.c.

292 {
293  /* KDBG has its own mechanism for ignoring user mode exceptions */
294  return FALSE;
295 }
#define FALSE
Definition: types.h:117
BOOLEAN NTAPI KdpCallGdb ( IN PKTRAP_FRAME  TrapFrame,
IN PEXCEPTION_RECORD  ExceptionRecord,
IN PCONTEXT  Context 
)

Definition at line 258 of file kdmain.c.

261 {
262  KD_CONTINUE_TYPE Return = kdDoNotHandleException;
263 
264  /* Get out of here if the Debugger isn't connected */
265  if (KdDebuggerNotPresent) return FALSE;
266 
267  /* FIXME:
268  * Right now, the GDB wrapper seems to handle exceptions differntly
269  * from KDGB and both are called at different times, while the GDB
270  * one is only called once and that's it. I don't really have the knowledge
271  * to fix the GDB stub, so until then, we'll be using this hack
272  */
273  if (WrapperInitRoutine)
274  {
275  Return = WrapperTable.KdpExceptionRoutine(ExceptionRecord,
276  Context,
277  TrapFrame);
278  }
279 
280  /* Debugger didn't handle it, please handle! */
281  if (Return == kdHandleException) return FALSE;
282 
283  /* Debugger handled it */
284  return TRUE;
285 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
PKDP_INIT_ROUTINE WrapperInitRoutine
Definition: kdinit.c:27
KD_DISPATCH_TABLE WrapperTable
Definition: kdinit.c:28
BOOLEAN KdDebuggerNotPresent
Definition: kdmain.c:18
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 124 of file kdmain.c.

130 {
131  KD_CONTINUE_TYPE Return = kdHandleException;
132  ULONG ExceptionCommand = ExceptionRecord->ExceptionInformation[0];
133 
134  /* Check if this was a breakpoint due to DbgPrint or Load/UnloadSymbols */
135  if ((ExceptionRecord->ExceptionCode == STATUS_BREAKPOINT) &&
136  (ExceptionRecord->NumberParameters > 0) &&
137  ((ExceptionCommand == BREAKPOINT_LOAD_SYMBOLS) ||
138  (ExceptionCommand == BREAKPOINT_UNLOAD_SYMBOLS) ||
139  (ExceptionCommand == BREAKPOINT_COMMAND_STRING) ||
140  (ExceptionCommand == BREAKPOINT_PRINT) ||
141  (ExceptionCommand == BREAKPOINT_PROMPT)))
142  {
143  /* Check if this is a debug print */
144  if (ExceptionCommand == BREAKPOINT_PRINT)
145  {
146  /* Print the string */
148  (PVOID)ExceptionRecord->ExceptionInformation[1],
149  ExceptionRecord->ExceptionInformation[2],
150  PreviousMode);
151 
152  /* Return success */
154  }
155 #ifdef KDBG
156  else if (ExceptionCommand == BREAKPOINT_LOAD_SYMBOLS)
157  {
158  PKD_SYMBOLS_INFO SymbolsInfo;
159  KD_SYMBOLS_INFO CapturedSymbolsInfo;
160  PLDR_DATA_TABLE_ENTRY LdrEntry;
161 
162  SymbolsInfo = (PKD_SYMBOLS_INFO)ExceptionRecord->ExceptionInformation[2];
164  {
165  _SEH2_TRY
166  {
167  ProbeForRead(SymbolsInfo,
168  sizeof(*SymbolsInfo),
169  1);
170  RtlCopyMemory(&CapturedSymbolsInfo,
171  SymbolsInfo,
172  sizeof(*SymbolsInfo));
173  SymbolsInfo = &CapturedSymbolsInfo;
174  }
176  {
177  SymbolsInfo = NULL;
178  }
179  _SEH2_END;
180  }
181 
182  if (SymbolsInfo != NULL)
183  {
184  /* Load symbols. Currently implemented only for KDBG! */
185  if (KdbpSymFindModule(SymbolsInfo->BaseOfDll, NULL, -1, &LdrEntry))
186  {
187  KdbSymProcessSymbols(LdrEntry);
188  }
189  }
190  }
191  else if (ExceptionCommand == BREAKPOINT_PROMPT)
192  {
194  LPSTR OutString;
195  USHORT OutStringLength;
196 
197  /* Get the response string and length */
198  OutString = (LPSTR)Context->Ebx;
199  OutStringLength = (USHORT)Context->Edi;
200 
201  /* Call KDBG */
202  ReturnValue = KdpPrompt((LPSTR)ExceptionRecord->
203  ExceptionInformation[1],
204  (USHORT)ExceptionRecord->
205  ExceptionInformation[2],
206  OutString,
207  OutStringLength,
208  PreviousMode);
209 
210  /* Return the number of characters that we received */
211  Context->Eax = ReturnValue;
212  }
213 #endif
214 
215  /* This we can handle: simply bump the Program Counter */
217  return TRUE;
218  }
219 
220 #ifdef KDBG
221  /* Check if this is an assertion failure */
222  if (ExceptionRecord->ExceptionCode == STATUS_ASSERTION_FAILURE)
223  {
224  /* Bump EIP to the instruction following the int 2C */
225  Context->Eip += 2;
226  }
227 #endif
228 
229  /* Get out of here if the Debugger isn't connected */
230  if (KdDebuggerNotPresent) return FALSE;
231 
232 #ifdef KDBG
233  /* Call KDBG if available */
234  Return = KdbEnterDebuggerException(ExceptionRecord,
235  PreviousMode,
236  Context,
237  TrapFrame,
238  !SecondChance);
239 #else /* not KDBG */
240  if (WrapperInitRoutine)
241  {
242  /* Call GDB */
243  Return = WrapperTable.KdpExceptionRoutine(ExceptionRecord,
244  Context,
245  TrapFrame);
246  }
247 #endif /* not KDBG */
248 
249  /* Debugger didn't handle it, please handle! */
250  if (Return == kdHandleException) return FALSE;
251 
252  /* Debugger handled it */
253  return TRUE;
254 }
DWORD *typedef PVOID
Definition: winlogon.h:52
#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
return STATUS_SUCCESS
Definition: btrfs.c:2690
ULONG NTAPI KdpServiceDispatcher(ULONG Service, PVOID Buffer1, ULONG Buffer1Length, KPROCESSOR_MODE PreviousMode)
Definition: kdmain.c:42
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:192
#define FALSE
Definition: types.h:117
#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:717
#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:1762
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
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
BOOLEAN NTAPI KdPollBreakIn ( VOID  )

Definition at line 367 of file kdmain.c.

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

368 {
369  return KdpBreakPending;
370 }
BOOLEAN KdpBreakPending
Definition: kdmain.c:20
NTSTATUS NTAPI KdPowerTransition ( ULONG  PowerState)

Definition at line 377 of file kdmain.c.

378 {
380  return STATUS_NOT_IMPLEMENTED;
381 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114
ULONG NTAPI KdpServiceDispatcher ( ULONG  Service,
PVOID  Buffer1,
ULONG  Buffer1Length,
KPROCESSOR_MODE  PreviousMode 
)

Definition at line 42 of file kdmain.c.

Referenced by KdpEnterDebuggerException(), and KdSystemDebugControl().

46 {
47  ULONG Result = 0;
48 
49  switch (Service)
50  {
51  case BREAKPOINT_PRINT: /* DbgPrint */
52  Result = KdpPrintString(Buffer1, Buffer1Length, PreviousMode);
53  break;
54 
55 #if DBG
56  case ' soR': /* ROS-INTERNAL */
57  {
58  switch ((ULONG_PTR)Buffer1)
59  {
60  case DumpAllThreads:
62  break;
63 
64  case DumpUserThreads:
66  break;
67 
68  case KdSpare3:
70  break;
71 
72  default:
73  break;
74  }
75  break;
76  }
77 
78 #if defined(_M_IX86) && !defined(_WINKD_) // See ke/i386/traphdlr.c
79  /* Register a debug callback */
80  case 'CsoR':
81  {
82  switch (Buffer1Length)
83  {
84  case ID_Win32PreServiceHook:
85  KeWin32PreServiceHook = Buffer1;
86  break;
87 
88  case ID_Win32PostServiceHook:
89  KeWin32PostServiceHook = Buffer1;
90  break;
91 
92  }
93  break;
94  }
95 #endif
96 
97  /* Special case for stack frame dumps */
98  case 'DsoR':
99  {
100  KeRosDumpStackFrames((PULONG)Buffer1, Buffer1Length);
101  break;
102  }
103 
104 #if defined(KDBG)
105  /* Register KDBG CLI callback */
106  case 'RbdK':
107  {
108  Result = KdbRegisterCliCallback(Buffer1, Buffer1Length);
109  break;
110  }
111 #endif /* KDBG */
112 #endif /* DBG */
113  default:
114  DPRINT1("Invalid debug service call!\n");
115  HalDisplayString("Invalid debug service call!\r\n");
116  break;
117  }
118 
119  return Result;
120 }
#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)
_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
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define FALSE
Definition: types.h:117
BOOLEAN NTAPI KdbRegisterCliCallback(PVOID Callback, BOOLEAN Deregister)
Definition: kdb_cli.c:3313
_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:570
BOOLEAN NTAPI KdRefreshDebuggerNotPresent ( VOID  )

Definition at line 304 of file kdmain.c.

305 {
307 
308  /* Just return whatever was set previously -- FIXME! */
309  return KdDebuggerNotPresent;
310 }
#define UNIMPLEMENTED
Definition: debug.h:114
BOOLEAN KdDebuggerNotPresent
Definition: kdmain.c:18
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 489 of file kdmain.c.

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

496 {
497  /* HACK */
499  InputBuffer,
501  PreviousMode);
502 }
ULONG NTAPI KdpServiceDispatcher(ULONG Service, PVOID Buffer1, ULONG Buffer1Length, KPROCESSOR_MODE PreviousMode)
Definition: kdmain.c:42
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
NTSTATUS NTAPI NtQueryDebugFilterState ( IN ULONG  ComponentId,
IN ULONG  Level 
)

Definition at line 402 of file kdmain.c.

Referenced by DbgQueryDebugFilterState(), and vDbgPrintExWithPrefixInternal().

404 {
405  ULONG i;
406 
407  /* Convert Level to mask if it isn't already one */
408  if (Level < 32)
409  Level = 1 << Level;
410 
411  /* Check if it is not the default component */
412  if (ComponentId != MAXULONG)
413  {
414  /* No, search for an existing entry in the table */
415  for (i = 0; i < KdComponentTableEntries; i++)
416  {
417  /* Check if it is the right component */
419  {
420  /* Check if mask are matching */
421  return (Level & KdComponentTable[i].Level) ? TRUE : FALSE;
422  }
423  }
424  }
425 
426  /* Entry not found in the table, use default mask */
427  return (Level & Kd_DEFAULT_MASK) ? TRUE : FALSE;
428 }
KD_COMPONENT_DATA KdComponentTable[MAX_KD_COMPONENT_TABLE_ENTRIES]
Definition: kdmain.c:33
#define TRUE
Definition: types.h:120
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define FALSE
Definition: types.h:117
#define MAXULONG
Definition: typedefs.h:250
ULONG Kd_DEFAULT_MASK
Definition: kdmain.c:36
ULONG KdComponentTableEntries
Definition: kdmain.c:34
unsigned int ULONG
Definition: retypes.h:1
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 const char UINT32 const char const char UINT32 ComponentId
Definition: acpixf.h:1256
NTSTATUS NTAPI NtSetDebugFilterState ( IN ULONG  ComponentId,
IN ULONG  Level,
IN BOOLEAN  State 
)

Definition at line 432 of file kdmain.c.

Referenced by DbgSetDebugFilterState(), and KdbpCmdFilter().

435 {
436  ULONG i;
437 
438  /* Convert Level to mask if it isn't already one */
439  if (Level < 32)
440  Level = 1 << Level;
441  Level &= ~DPFLTR_MASK;
442 
443  /* Check if it is the default component */
444  if (ComponentId == MAXULONG)
445  {
446  /* Yes, modify the default mask */
447  if (State)
449  else
451 
452  return STATUS_SUCCESS;
453  }
454 
455  /* Search for an existing entry */
456  for (i = 0; i < KdComponentTableEntries; i++ )
457  {
459  break;
460  }
461 
462  /* Check if we have found an existing entry */
463  if (i == KdComponentTableEntries)
464  {
465  /* Check if we have enough space in the table */
468 
469  /* Add a new entry */
473  }
474 
475  /* Update entry table */
476  if (State)
478  else
480 
481  return STATUS_SUCCESS;
482 }
KD_COMPONENT_DATA KdComponentTable[MAX_KD_COMPONENT_TABLE_ENTRIES]
Definition: kdmain.c:33
return STATUS_SUCCESS
Definition: btrfs.c:2690
#define DPFLTR_MASK
Definition: kdtypes.h:34
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define MAX_KD_COMPONENT_TABLE_ENTRIES
Definition: kdmain.c:32
#define STATUS_INVALID_PARAMETER_1
Definition: ntstatus.h:461
#define MAXULONG
Definition: typedefs.h:250
ULONG Kd_DEFAULT_MASK
Definition: kdmain.c:36
ULONG KdComponentTableEntries
Definition: kdmain.c:34
ULONG ComponentId
Definition: kdmain.c:29
unsigned int ULONG
Definition: retypes.h:1
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 const char UINT32 const char const char UINT32 ComponentId
Definition: acpixf.h:1256
VOID NTAPI PspDumpThreads ( BOOLEAN  SystemThreads)

Referenced by KdpServiceDispatcher().

Variable Documentation

ULONG Kd_DEFAULT_MASK = 1 << DPFLTR_ERROR_LEVEL

Definition at line 36 of file kdmain.c.

Referenced by NtQueryDebugFilterState(), and NtSetDebugFilterState().

ULONG Kd_WIN2000_Mask

Definition at line 24 of file kdmain.c.

BOOLEAN KdBreakAfterSymbolLoad = FALSE

Definition at line 19 of file kdmain.c.

Definition at line 33 of file kdmain.c.

ULONG KdComponentTableEntries = 0

Definition at line 34 of file kdmain.c.

Referenced by NtQueryDebugFilterState(), and NtSetDebugFilterState().

BOOLEAN KdEnteredDebugger = FALSE

Definition at line 17 of file kdmain.c.

BOOLEAN KdIgnoreUmExceptions = FALSE

Definition at line 22 of file kdmain.c.

BOOLEAN KdpBreakPending = FALSE

Definition at line 20 of file kdmain.c.

Referenced by KdPollBreakIn().

KD_CONTEXT KdpContext

Definition at line 23 of file kdmain.c.

BOOLEAN KdPitchDebugger = TRUE

Definition at line 21 of file kdmain.c.

Definition at line 504 of file kdmain.c.