ReactOS  0.4.14-dev-583-g2a1ba2c
kdfuncs.h File Reference
#include <umtypes.h>
#include <kdtypes.h>
Include dependency graph for kdfuncs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

NTSTATUS NTAPI KdSystemDebugControl (_In_ SYSDBG_COMMAND Command, _In_ PVOID InputBuffer, _In_ ULONG InputBufferLength, _Out_ PVOID OutputBuffer, _In_ ULONG OutputBufferLength, _Inout_ PULONG ReturnLength, _In_ KPROCESSOR_MODE PreviousMode)
 
BOOLEAN NTAPI KdPollBreakIn (VOID)
 
NTSYSCALLAPI NTSTATUS NTAPI NtQueryDebugFilterState (_In_ ULONG ComponentId, _In_ ULONG Level)
 
NTSYSCALLAPI NTSTATUS NTAPI NtSetDebugFilterState (_In_ ULONG ComponentId, _In_ ULONG Level, _In_ BOOLEAN State)
 
NTSYSCALLAPI NTSTATUS NTAPI NtSystemDebugControl (SYSDBG_COMMAND ControlCode, PVOID InputBuffer, ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength, PULONG ReturnLength)
 
NTSYSAPI NTSTATUS NTAPI ZwQueryDebugFilterState (ULONG ComponentId, ULONG Level)
 
NTSYSAPI NTSTATUS NTAPI ZwSetDebugFilterState (ULONG ComponentId, ULONG Level, BOOLEAN State)
 
NTSYSAPI NTSTATUS NTAPI ZwSystemDebugControl (SYSDBG_COMMAND ControlCode, PVOID InputBuffer, ULONG InputBufferLength, PVOID OutputBuffer, ULONG OutputBufferLength, PULONG ReturnLength)
 

Function Documentation

◆ KdPollBreakIn()

BOOLEAN NTAPI KdPollBreakIn ( VOID  )

Definition at line 396 of file kdmain.c.

397 {
398  return FALSE;
399 }

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

◆ KdSystemDebugControl()

NTSTATUS NTAPI KdSystemDebugControl ( _In_ SYSDBG_COMMAND  Command,
_In_ PVOID  InputBuffer,
_In_ ULONG  InputBufferLength,
_Out_ PVOID  OutputBuffer,
_In_ ULONG  OutputBufferLength,
_Inout_ PULONG  ReturnLength,
_In_ KPROCESSOR_MODE  PreviousMode 
)

◆ NtQueryDebugFilterState()

NTSYSCALLAPI NTSTATUS NTAPI NtQueryDebugFilterState ( _In_ ULONG  ComponentId,
_In_ ULONG  Level 
)

Definition at line 2334 of file kdapi.c.

2337 {
2338  PULONG Mask;
2339 
2340  /* Check if the ID fits in the component table */
2342  {
2343  /* It does, so get the mask from there */
2344  Mask = KdComponentTable[ComponentId];
2345  }
2346  else if (ComponentId == MAXULONG)
2347  {
2348  /*
2349  * This is the internal ID used for DbgPrint messages without ID
2350  * and Level. Use the system-wide mask for those.
2351  */
2352  Mask = &Kd_WIN2000_Mask;
2353  }
2354  else
2355  {
2356 #if (NTDDI_VERSION >= NTDDI_VISTA)
2357  /* Use the default component ID */
2358  Mask = &Kd_DEFAULT_Mask;
2359  // Level = DPFLTR_INFO_LEVEL; // Override the Level.
2360 #else
2361  /* Invalid ID, fail */
2363 #endif
2364  }
2365 
2366  /* Convert Level to bit field if required */
2367  if (Level < 32) Level = 1 << Level;
2368  Level &= ~DPFLTR_MASK;
2369 
2370  /* Determine if this Level is filtered out */
2371  if ((Kd_WIN2000_Mask & Level) || (*Mask & Level))
2372  {
2373  /* This mask will get through to the debugger */
2374  return (NTSTATUS)TRUE;
2375  }
2376  else
2377  {
2378  /* This mask is filtered out */
2379  return (NTSTATUS)FALSE;
2380  }
2381 }
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
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
ULONG Kd_WIN2000_Mask
Definition: kddata.c:147
PULONG KdComponentTable[MAX_KD_COMPONENT_TABLE_ENTRIES]
Definition: kddata.c:303
#define STATUS_INVALID_PARAMETER_1
Definition: ntstatus.h:461
#define MAXULONG
Definition: typedefs.h:250
ULONG Kd_DEFAULT_Mask
Definition: kddata.c:249
unsigned int * PULONG
Definition: retypes.h:1

Referenced by DbgQueryDebugFilterState(), and vDbgPrintExWithPrefixInternal().

◆ NtSetDebugFilterState()

NTSYSCALLAPI NTSTATUS NTAPI NtSetDebugFilterState ( _In_ ULONG  ComponentId,
_In_ ULONG  Level,
_In_ BOOLEAN  State 
)

Definition at line 2388 of file kdapi.c.

2392 {
2393  PULONG Mask;
2394 
2395  /* Modifying debug filters requires the debug privilege */
2397  {
2398  /* Fail */
2399  return STATUS_ACCESS_DENIED;
2400  }
2401 
2402  /* Check if the ID fits in the component table */
2404  {
2405  /* It does, so get the mask from there */
2406  Mask = KdComponentTable[ComponentId];
2407  }
2408  else if (ComponentId == MAXULONG)
2409  {
2410  /*
2411  * This is the internal ID used for DbgPrint messages without ID
2412  * and Level. Use the system-wide mask for those.
2413  */
2414  Mask = &Kd_WIN2000_Mask;
2415  }
2416  else
2417  {
2418 #if (NTDDI_VERSION >= NTDDI_VISTA)
2419  /* Use the default component ID */
2420  Mask = &Kd_DEFAULT_Mask;
2421 #else
2422  /* Invalid ID, fail */
2424 #endif
2425  }
2426 
2427  /* Convert Level to bit field if required */
2428  if (Level < 32) Level = 1 << Level;
2429  Level &= ~DPFLTR_MASK;
2430 
2431  /* Set or remove the Level */
2432  if (State)
2433  *Mask |= Level;
2434  else
2435  *Mask &= ~Level;
2436 
2437  return STATUS_SUCCESS;
2438 }
const LUID SeDebugPrivilege
Definition: priv.c:41
ULONG KdComponentTableSize
Definition: kddata.c:459
#define DPFLTR_MASK
Definition: kdtypes.h:34
BOOLEAN NTAPI SeSinglePrivilegeCheck(IN LUID PrivilegeValue, IN KPROCESSOR_MODE PreviousMode)
Definition: priv.c:524
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:3066
_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
ULONG Kd_WIN2000_Mask
Definition: kddata.c:147
PULONG KdComponentTable[MAX_KD_COMPONENT_TABLE_ENTRIES]
Definition: kddata.c:303
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define STATUS_INVALID_PARAMETER_1
Definition: ntstatus.h:461
#define MAXULONG
Definition: typedefs.h:250
ULONG Kd_DEFAULT_Mask
Definition: kddata.c:249
unsigned int * PULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by DbgSetDebugFilterState(), and KdbpCmdFilter().

◆ NtSystemDebugControl()

NTSYSCALLAPI NTSTATUS NTAPI NtSystemDebugControl ( SYSDBG_COMMAND  ControlCode,
PVOID  InputBuffer,
ULONG  InputBufferLength,
PVOID  OutputBuffer,
ULONG  OutputBufferLength,
PULONG  ReturnLength 
)

Definition at line 186 of file dbgctrl.c.

192 {
193  switch (ControlCode)
194  {
197  case SysDbgSetTracepoint:
201  case SysDbgQueryVersion:
202  case SysDbgReadVirtual:
203  case SysDbgWriteVirtual:
204  case SysDbgReadPhysical:
205  case SysDbgWritePhysical:
208  case SysDbgReadIoSpace:
209  case SysDbgWriteIoSpace:
210  case SysDbgReadMsr:
211  case SysDbgWriteMsr:
212  case SysDbgReadBusData:
213  case SysDbgWriteBusData:
215  case SysDbgGetTriageDump:
216  return STATUS_NOT_IMPLEMENTED;
217  case SysDbgBreakPoint:
228  return KdSystemDebugControl(
229  ControlCode,
233  default:
235  }
236 }
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define KeGetPreviousMode()
Definition: ketypes.h:1107
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG _In_ ULONG OutputBufferLength
Definition: fltkernel.h:1374
CHAR InputBuffer[80]
Definition: conmgr.c:33
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
Definition: iofuncs.h:713
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: kdmain.c:433
#define STATUS_INVALID_INFO_CLASS
Definition: ntstatus.h:226
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG InputBufferLength
Definition: fltkernel.h:1372

◆ ZwQueryDebugFilterState()

NTSYSAPI NTSTATUS NTAPI ZwQueryDebugFilterState ( ULONG  ComponentId,
ULONG  Level 
)

◆ ZwSetDebugFilterState()

NTSYSAPI NTSTATUS NTAPI ZwSetDebugFilterState ( ULONG  ComponentId,
ULONG  Level,
BOOLEAN  State 
)

◆ ZwSystemDebugControl()

NTSYSAPI NTSTATUS NTAPI ZwSystemDebugControl ( SYSDBG_COMMAND  ControlCode,
PVOID  InputBuffer,
ULONG  InputBufferLength,
PVOID  OutputBuffer,
ULONG  OutputBufferLength,
PULONG  ReturnLength 
)