[NTOSKRNL] Add missing \n to DPRINT() calls (#6012)

Improve debug logs.
- Add missing \n to DPRINT() calls
- And demote/promote some DPRINT()/DPRINT1().
This commit is contained in:
Serge Gautherie 2025-03-26 10:23:15 +01:00 committed by GitHub
parent c1b8c4f96f
commit 35ca454cab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 19 deletions

View file

@ -33,6 +33,7 @@
/* INCLUDES ******************************************************************/
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
@ -385,7 +386,7 @@ CcRosFlushDirtyPages (
Locked = SharedCacheMap->Callbacks->AcquireForLazyWrite(SharedCacheMap->LazyWriteContext, Wait);
if (!Locked)
{
DPRINT("Not locked!");
DPRINT("Not locked\n");
ASSERT(!Wait);
CcRosVacbDecRefCount(current);
OldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);
@ -1038,7 +1039,7 @@ CcRosRequestVacb (
if (FileOffset % VACB_MAPPING_GRANULARITY != 0)
{
DPRINT1("Bad fileoffset %I64x should be multiple of %x",
DPRINT1("Bad FileOffset %I64x: should be multiple of %x\n",
FileOffset, VACB_MAPPING_GRANULARITY);
KeBugCheck(CACHE_MANAGER);
}

View file

@ -189,7 +189,8 @@ IopConnectInterruptExFullySpecific(
Parameters->FullySpecified.ShareVector,
Parameters->FullySpecified.ProcessorEnableMask,
Parameters->FullySpecified.FloatingSave);
DPRINT("IopConnectInterruptEx_FullySpecific: has failed with status %X", Status);
if (!NT_SUCCESS(Status))
DPRINT1("IopConnectInterruptExFullySpecific() failed: 0x%lx\n", Status);
return Status;
}

View file

@ -12,6 +12,7 @@
#include <ntoskrnl.h>
#include <x86x64/Cpuid.h>
#include <x86x64/Msr.h>
#define NDEBUG
#include <debug.h>
@ -358,9 +359,9 @@ KiReportCpuFeatures(IN PKPRCB Prcb)
CpuFeatures = CpuInfo.Edx;
}
DPRINT1("Supported CPU features: ");
DPRINT1("Supported CPU features:");
#define print_kf_bit(kf_value) if (Prcb->FeatureBits & kf_value) DbgPrint(#kf_value " ")
#define print_kf_bit(kf_value) if (Prcb->FeatureBits & kf_value) DbgPrint(" " #kf_value)
print_kf_bit(KF_SMEP);
print_kf_bit(KF_RDTSC);
print_kf_bit(KF_CR4);
@ -405,7 +406,7 @@ KiReportCpuFeatures(IN PKPRCB Prcb)
print_kf_bit(KF_SSE4_2);
#undef print_kf_bit
#define print_cf(cpu_flag) if (CpuFeatures & cpu_flag) DbgPrint(#cpu_flag " ")
#define print_cf(cpu_flag) if (CpuFeatures & cpu_flag) DbgPrint(" " #cpu_flag)
print_cf(X86_FEATURE_PAE);
print_cf(X86_FEATURE_HT);
#undef print_cf

View file

@ -9,11 +9,11 @@
/* INCLUDES *****************************************************************/
#include <ntoskrnl.h>
#include <xmmintrin.h>
#define NDEBUG
#include <debug.h>
#include <xmmintrin.h>
/* GLOBALS *******************************************************************/
/* The TSS to use for Double Fault Traps (INT 0x9) */
@ -451,9 +451,9 @@ KiReportCpuFeatures(VOID)
CpuFeatures = CpuInfo.Edx;
}
DPRINT1("Supported CPU features: ");
DPRINT1("Supported CPU features:");
#define print_kf_bit(kf_value) if (KeFeatureBits & kf_value) DbgPrint(#kf_value " ")
#define print_kf_bit(kf_value) if (KeFeatureBits & kf_value) DbgPrint(" " #kf_value)
print_kf_bit(KF_V86_VIS);
print_kf_bit(KF_RDTSC);
print_kf_bit(KF_CR4);
@ -477,7 +477,7 @@ KiReportCpuFeatures(VOID)
print_kf_bit(KF_NX_ENABLED);
#undef print_kf_bit
#define print_cf(cpu_flag) if (CpuFeatures & cpu_flag) DbgPrint(#cpu_flag " ")
#define print_cf(cpu_flag) if (CpuFeatures & cpu_flag) DbgPrint(" " #cpu_flag)
print_cf(X86_FEATURE_PAE);
print_cf(X86_FEATURE_APIC);
print_cf(X86_FEATURE_HT);

View file

@ -10,6 +10,7 @@
/* INCLUDES *******************************************************************/
#include <ntoskrnl.h>
#define NDEBUG
#include <debug.h>
@ -225,7 +226,7 @@ SeRmInitPhase1(VOID)
2 * PAGE_SIZE);
if (!NT_SUCCESS(Status))
{
DPRINT1("Security: Rm Create Command Port failed 0x%lx\n", Status);
DPRINT1("Security: Rm Command Port creation failed: 0x%lx\n", Status);
return FALSE;
}
@ -239,7 +240,7 @@ SeRmInitPhase1(VOID)
FALSE);
if (!NT_VERIFY((NT_SUCCESS(Status))))
{
DPRINT1("Security: LSA init event creation failed.0x%xl\n", Status);
DPRINT1("Security: LSA Init Event creation failed: 0x%lx\n", Status);
return FALSE;
}
@ -253,7 +254,7 @@ SeRmInitPhase1(VOID)
NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("Security: Rm Server Thread creation failed 0x%lx\n", Status);
DPRINT1("Security: Rm Command Server Thread creation failed: 0x%lx\n", Status);
return FALSE;
}
@ -297,8 +298,7 @@ SepAdtInitializeBounds(VOID)
(ListBounds.MinLength < 16) ||
(ListBounds.MaxLength - ListBounds.MinLength < 16))
{
DPRINT1("ListBounds are invalid: %u, %u\n",
ListBounds.MinLength, ListBounds.MaxLength);
DPRINT1("ListBounds invalid: %lu, %lu\n", ListBounds.MinLength, ListBounds.MaxLength);
return;
}
@ -1149,7 +1149,7 @@ SepRmCommandServerThreadInit(VOID)
NULL);
if (!NT_SUCCESS(Status))
{
DPRINT1("Security Rm Init: Create Memory Section for LSA port failed: %X\n", Status);
DPRINT1("Security Rm Init: Create Memory Section for LSA port failed: 0x%lx\n", Status);
goto Cleanup;
}
@ -1251,7 +1251,7 @@ SepRmCommandServerThread(
&Message.Header);
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to get message: 0x%lx", Status);
DPRINT1("Failed to get message: 0x%lx\n", Status);
ReplyMessage = NULL;
continue;
}
@ -1283,7 +1283,7 @@ SepRmCommandServerThread(
/* Check if this is an actual request */
if (Message.Header.u2.s2.Type != LPC_REQUEST)
{
DPRINT1("SepRmCommandServerThread: unexpected message type: 0x%lx\n",
DPRINT1("SepRmCommandServerThread: unexpected message type: 0x%x\n",
Message.Header.u2.s2.Type);
/* Restart without replying */