Index: ntoskrnl/ex/init.c =================================================================== --- ntoskrnl/ex/init.c (révision 57329) +++ ntoskrnl/ex/init.c (copie de travail) @@ -211,7 +211,7 @@ PLIST_ENTRY ListHead, NextEntry; PMEMORY_ALLOCATION_DESCRIPTOR MdBlock; ULONG NlsTablesEncountered = 0; - SIZE_T NlsTableSizes[3]; /* 3 NLS tables */ + SIZE_T NlsTableSizes[3] = {0, 0, 0}; /* 3 NLS tables */ /* Check if this is boot-time phase 0 initialization */ if (!ExpInitializationPhase) @@ -405,12 +405,11 @@ if (!NT_SUCCESS(Status)) { /* Failed, display error */ - p = InitBuffer->DebugBuffer; - _snwprintf(p, - 256 * sizeof(WCHAR), + _snwprintf(InitBuffer->DebugBuffer, + sizeof(InitBuffer->DebugBuffer)/sizeof(WCHAR), L"INIT: Unable to allocate Process Parameters. 0x%lx", Status); - RtlInitUnicodeString(&DebugString, p); + RtlInitUnicodeString(&DebugString, InitBuffer->DebugBuffer); ZwDisplayString(&DebugString); /* Bugcheck the system */ @@ -434,12 +433,11 @@ if (!NT_SUCCESS(Status)) { /* Failed, display error */ - p = InitBuffer->DebugBuffer; - _snwprintf(p, - 256 * sizeof(WCHAR), + _snwprintf(InitBuffer->DebugBuffer, + sizeof(InitBuffer->DebugBuffer)/sizeof(WCHAR), L"INIT: Unable to allocate Process Environment. 0x%lx", Status); - RtlInitUnicodeString(&DebugString, p); + RtlInitUnicodeString(&DebugString, InitBuffer->DebugBuffer); ZwDisplayString(&DebugString); /* Bugcheck the system */ @@ -560,12 +558,11 @@ if (!NT_SUCCESS(Status)) { /* Failed, display error */ - p = InitBuffer->DebugBuffer; - _snwprintf(p, - 256 * sizeof(WCHAR), + _snwprintf(InitBuffer->DebugBuffer, + sizeof(InitBuffer->DebugBuffer)/sizeof(WCHAR), L"INIT: Unable to create Session Manager. 0x%lx", Status); - RtlInitUnicodeString(&DebugString, p); + RtlInitUnicodeString(&DebugString, InitBuffer->DebugBuffer); ZwDisplayString(&DebugString); /* Bugcheck the system */ @@ -577,12 +574,11 @@ if (!NT_SUCCESS(Status)) { /* Failed, display error */ - p = InitBuffer->DebugBuffer; - _snwprintf(p, - 256 * sizeof(WCHAR), + _snwprintf(InitBuffer->DebugBuffer, + sizeof(InitBuffer->DebugBuffer)/sizeof(WCHAR), L"INIT: Unable to resume Session Manager. 0x%lx", Status); - RtlInitUnicodeString(&DebugString, p); + RtlInitUnicodeString(&DebugString, InitBuffer->DebugBuffer); ZwDisplayString(&DebugString); /* Bugcheck the system */ Index: ntoskrnl/ex/sysinfo.c =================================================================== --- ntoskrnl/ex/sysinfo.c (révision 57329) +++ ntoskrnl/ex/sysinfo.c (copie de travail) @@ -150,7 +150,7 @@ Prcb = KeGetCurrentPrcb(); - ScaledIdle = Prcb->IdleThread->KernelTime * 100; + ScaledIdle = (ULONGLONG)Prcb->IdleThread->KernelTime * 100; TotalTime = Prcb->KernelTime + Prcb->UserTime; if (TotalTime != 0) *CpuUsage = (ULONG)(100 - (ScaledIdle / TotalTime)); @@ -785,7 +785,7 @@ } } } - if (!ImageNameLength && Process != PsIdleProcess && Process->ImageFileName) + if (!ImageNameLength && Process != PsIdleProcess && Process->ImageFileName[0] != 0) { ImageNameLength = (USHORT)strlen(Process->ImageFileName) * sizeof(WCHAR); } @@ -824,7 +824,7 @@ /* Release the memory allocated by SeLocateProcessImageName */ ExFreePool(ProcessImageName); } - else if (Process->ImageFileName) + else if (Process->ImageFileName[0] != 0) { RtlInitAnsiString(&ImageName, Process->ImageFileName); RtlAnsiStringToUnicodeString(&SpiCurrent->ImageName, &ImageName, FALSE);