https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b6e33426bf9e1a997f3b7…
commit b6e33426bf9e1a997f3b708d81d86efe96f507ea
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Thu Dec 19 21:01:30 2019 +0300
Commit: Victor Perevertkin <victor(a)perevertkin.ru>
CommitDate: Mon Dec 30 05:57:49 2019 +0200
[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
---
ntoskrnl/kd64/kdprint.c | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)
diff --git a/ntoskrnl/kd64/kdprint.c b/ntoskrnl/kd64/kdprint.c
index 4d35bf6df76..81da68b7ec1 100644
--- a/ntoskrnl/kd64/kdprint.c
+++ b/ntoskrnl/kd64/kdprint.c
@@ -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));