mirror of
https://github.com/reactos/reactos.git
synced 2024-06-02 02:31:45 +00:00
[ntoskrnl] Never suppose that buffer in UNICODE_STRING is null terminated. Fixes display artifacts on list of loaded drivers
svn path=/trunk/; revision=46193
This commit is contained in:
parent
c709d2abc9
commit
c39812d1b6
|
@ -158,35 +158,22 @@ IopGetDriverObject(
|
||||||
VOID
|
VOID
|
||||||
FASTCALL
|
FASTCALL
|
||||||
INIT_FUNCTION
|
INIT_FUNCTION
|
||||||
IopDisplayLoadingMessage(PVOID ServiceName,
|
IopDisplayLoadingMessage(PUNICODE_STRING ServiceName)
|
||||||
BOOLEAN Unicode)
|
|
||||||
{
|
{
|
||||||
CHAR TextBuffer[256];
|
CHAR TextBuffer[256];
|
||||||
PCHAR Extra = ".sys";
|
|
||||||
|
|
||||||
if (ExpInTextModeSetup) return;
|
if (ExpInTextModeSetup) return;
|
||||||
if (Unicode)
|
RtlUpcaseUnicodeString(ServiceName, ServiceName, FALSE);
|
||||||
{
|
snprintf(TextBuffer, sizeof(TextBuffer),
|
||||||
if (wcsstr(_wcsupr(ServiceName), L".SYS")) Extra = "";
|
"%s%s%s\\%wZ",
|
||||||
sprintf(TextBuffer,
|
KeLoaderBlock->ArcBootDeviceName,
|
||||||
"%s%s%s\\%S%s\n",
|
KeLoaderBlock->NtBootPathName,
|
||||||
KeLoaderBlock->ArcBootDeviceName,
|
"System32\\Drivers",
|
||||||
KeLoaderBlock->NtBootPathName,
|
ServiceName);
|
||||||
"System32\\Drivers",
|
if (!strstr(TextBuffer, ".sys"))
|
||||||
(PWCHAR)ServiceName,
|
strcat(TextBuffer, ".sys\n");
|
||||||
Extra);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
strcat(TextBuffer, "\n");
|
||||||
if (strstr(_strupr(ServiceName), ".SYS")) Extra = "";
|
|
||||||
sprintf(TextBuffer,
|
|
||||||
"%s%s%s\\%s%s\n",
|
|
||||||
KeLoaderBlock->ArcBootDeviceName,
|
|
||||||
KeLoaderBlock->NtBootPathName,
|
|
||||||
"System32\\Drivers",
|
|
||||||
(PCHAR)ServiceName,
|
|
||||||
Extra);
|
|
||||||
}
|
|
||||||
HalDisplayString(TextBuffer);
|
HalDisplayString(TextBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -788,7 +775,7 @@ IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY LdrEntry)
|
||||||
/*
|
/*
|
||||||
* Display 'Loading XXX...' message
|
* Display 'Loading XXX...' message
|
||||||
*/
|
*/
|
||||||
IopDisplayLoadingMessage(ModuleName->Buffer, TRUE);
|
IopDisplayLoadingMessage(ModuleName);
|
||||||
InbvIndicateProgress();
|
InbvIndicateProgress();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -48,8 +48,7 @@ extern BOOLEAN NoGuiBoot;
|
||||||
VOID
|
VOID
|
||||||
FASTCALL
|
FASTCALL
|
||||||
INIT_FUNCTION
|
INIT_FUNCTION
|
||||||
IopDisplayLoadingMessage(PVOID ServiceName,
|
IopDisplayLoadingMessage(PUNICODE_STRING ServiceName);
|
||||||
BOOLEAN Unicode);
|
|
||||||
|
|
||||||
/* PRIVATE FUNCTIONS **********************************************************/
|
/* PRIVATE FUNCTIONS **********************************************************/
|
||||||
|
|
||||||
|
@ -416,7 +415,7 @@ IopLoadDriver(PSERVICE Service)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = STATUS_UNSUCCESSFUL;
|
NTSTATUS Status = STATUS_UNSUCCESSFUL;
|
||||||
|
|
||||||
IopDisplayLoadingMessage(Service->ServiceName.Buffer, TRUE);
|
IopDisplayLoadingMessage(&Service->ServiceName);
|
||||||
Status = ZwLoadDriver(&Service->RegistryPath);
|
Status = ZwLoadDriver(&Service->RegistryPath);
|
||||||
IopBootLog(&Service->ImagePath, NT_SUCCESS(Status) ? TRUE : FALSE);
|
IopBootLog(&Service->ImagePath, NT_SUCCESS(Status) ? TRUE : FALSE);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
|
|
Loading…
Reference in a new issue