mirror of
https://github.com/reactos/reactos.git
synced 2025-05-08 19:27:00 +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;
|
STRING OutputString;
|
||||||
CHAR CapturedString[512];
|
CHAR CapturedString[512];
|
||||||
|
|
||||||
/* Assume failure */
|
if (NtQueryDebugFilterState(ComponentId, Level) == (NTSTATUS)FALSE)
|
||||||
*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)))
|
|
||||||
{
|
{
|
||||||
/* Mask validation failed */
|
/* Mask validation failed */
|
||||||
*Handled = TRUE;
|
*Handled = TRUE;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Assume failure */
|
||||||
|
*Handled = FALSE;
|
||||||
|
|
||||||
/* Normalize the length */
|
/* Normalize the length */
|
||||||
Length = min(Length, sizeof(CapturedString));
|
Length = min(Length, sizeof(CapturedString));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue