Author: hpoussin
Date: Sun Mar 14 00:19:05 2010
New Revision: 46193
URL:
http://svn.reactos.org/svn/reactos?rev=46193&view=rev
Log:
[ntoskrnl] Never suppose that buffer in UNICODE_STRING is null terminated. Fixes display
artifacts on list of loaded drivers
Modified:
trunk/reactos/ntoskrnl/io/iomgr/driver.c
trunk/reactos/ntoskrnl/io/iomgr/drvrlist.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] Sun Mar 14 00:19:05 2010
@@ -158,35 +158,22 @@
VOID
FASTCALL
INIT_FUNCTION
-IopDisplayLoadingMessage(PVOID ServiceName,
- BOOLEAN Unicode)
+IopDisplayLoadingMessage(PUNICODE_STRING ServiceName)
{
CHAR TextBuffer[256];
- PCHAR Extra = ".sys";
if (ExpInTextModeSetup) return;
- if (Unicode)
- {
- if (wcsstr(_wcsupr(ServiceName), L".SYS")) Extra = "";
- sprintf(TextBuffer,
- "%s%s%s\\%S%s\n",
- KeLoaderBlock->ArcBootDeviceName,
- KeLoaderBlock->NtBootPathName,
- "System32\\Drivers",
- (PWCHAR)ServiceName,
- Extra);
- }
+ RtlUpcaseUnicodeString(ServiceName, ServiceName, FALSE);
+ snprintf(TextBuffer, sizeof(TextBuffer),
+ "%s%s%s\\%wZ",
+ KeLoaderBlock->ArcBootDeviceName,
+ KeLoaderBlock->NtBootPathName,
+ "System32\\Drivers",
+ ServiceName);
+ if (!strstr(TextBuffer, ".sys"))
+ strcat(TextBuffer, ".sys\n");
else
- {
- if (strstr(_strupr(ServiceName), ".SYS")) Extra = "";
- sprintf(TextBuffer,
- "%s%s%s\\%s%s\n",
- KeLoaderBlock->ArcBootDeviceName,
- KeLoaderBlock->NtBootPathName,
- "System32\\Drivers",
- (PCHAR)ServiceName,
- Extra);
- }
+ strcat(TextBuffer, "\n");
HalDisplayString(TextBuffer);
}
@@ -788,7 +775,7 @@
/*
* Display 'Loading XXX...' message
*/
- IopDisplayLoadingMessage(ModuleName->Buffer, TRUE);
+ IopDisplayLoadingMessage(ModuleName);
InbvIndicateProgress();
/*
Modified: trunk/reactos/ntoskrnl/io/iomgr/drvrlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/drvrlist…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/drvrlist.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/drvrlist.c [iso-8859-1] Sun Mar 14 00:19:05 2010
@@ -48,8 +48,7 @@
VOID
FASTCALL
INIT_FUNCTION
-IopDisplayLoadingMessage(PVOID ServiceName,
- BOOLEAN Unicode);
+IopDisplayLoadingMessage(PUNICODE_STRING ServiceName);
/* PRIVATE FUNCTIONS **********************************************************/
@@ -416,7 +415,7 @@
{
NTSTATUS Status = STATUS_UNSUCCESSFUL;
- IopDisplayLoadingMessage(Service->ServiceName.Buffer, TRUE);
+ IopDisplayLoadingMessage(&Service->ServiceName);
Status = ZwLoadDriver(&Service->RegistryPath);
IopBootLog(&Service->ImagePath, NT_SUCCESS(Status) ? TRUE : FALSE);
if (!NT_SUCCESS(Status))