mirror of
https://github.com/reactos/reactos.git
synced 2025-05-06 18:31:26 +00:00
[NTOS:KD] Fix wrong debug level checking logic in KdpPrint.
Use NtQueryDebugFilterState in that function for consistency. Thanks Hermès Bélusca-Maïto for help
This commit is contained in:
parent
ef103d7d69
commit
b6e33426bf
1 changed files with 4 additions and 19 deletions
|
@ -343,31 +343,16 @@ KdpPrint(
|
|||
STRING OutputString;
|
||||
CHAR CapturedString[512];
|
||||
|
||||
/* Assume failure */
|
||||
*Handled = FALSE;
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_VISTA)
|
||||
if ((ComponentId >= KdComponentTableSize) && (ComponentId < MAXULONG))
|
||||
{
|
||||
/* Use the default component ID */
|
||||
Mask = &Kd_DEFAULT_Mask;
|
||||
// Level = DPFLTR_INFO_LEVEL; // Override the Level.
|
||||
}
|
||||
#endif
|
||||
/* Convert Level to bit field if required */
|
||||
if (Level < 32) Level = 1 << Level;
|
||||
Level &= ~DPFLTR_MASK;
|
||||
|
||||
/* Validate the mask */
|
||||
if (!(Kd_WIN2000_Mask & Level) ||
|
||||
((ComponentId < KdComponentTableSize) &&
|
||||
!(*KdComponentTable[ComponentId] & Level)))
|
||||
if (NtQueryDebugFilterState(ComponentId, Level) == (NTSTATUS)FALSE)
|
||||
{
|
||||
/* Mask validation failed */
|
||||
*Handled = TRUE;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* Assume failure */
|
||||
*Handled = FALSE;
|
||||
|
||||
/* Normalize the length */
|
||||
Length = min(Length, sizeof(CapturedString));
|
||||
|
||||
|
|
Loading…
Reference in a new issue