mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[NTOS:IO] Don't uppercase the ServiceName in IopDisplayLoadingMessage().
Problematic behaviour was added in commita97f262ed
(r26067), and commitc39812d1b
(r46193) converted to RtlUpcaseUnicodeString() call. This was modifying the caller's given string. This is not really a good practice to do so just to make display fancier. For example, IopInitializeBuiltinDriver(), that calls the display function, also uses the passed ServiceName later after. Because IopDisplayLoadingMessage() executes only in SOS mode, uppercasing the ServiceName in one case but not the other would implicitly modify the observable OS behaviour. IopSuffixUnicodeString() is adapted to be similar to RtlPrefixUnicodeString().
This commit is contained in:
parent
3b60f4fa13
commit
475098c8b1
1 changed files with 24 additions and 7 deletions
|
@ -279,7 +279,8 @@ Cleanup:
|
|||
static BOOLEAN
|
||||
IopSuffixUnicodeString(
|
||||
_In_ PCUNICODE_STRING String1,
|
||||
_In_ PCUNICODE_STRING String2)
|
||||
_In_ PCUNICODE_STRING String2,
|
||||
_In_ BOOLEAN CaseInSensitive)
|
||||
{
|
||||
PWCHAR pc1, pc2;
|
||||
ULONG NumChars;
|
||||
|
@ -293,13 +294,29 @@ IopSuffixUnicodeString(
|
|||
|
||||
if (pc1 && pc2)
|
||||
{
|
||||
while (NumChars--)
|
||||
if (CaseInSensitive)
|
||||
{
|
||||
if (*pc1++ != *pc2++)
|
||||
return FALSE;
|
||||
while (NumChars--)
|
||||
{
|
||||
if (RtlUpcaseUnicodeChar(*pc1++) !=
|
||||
RtlUpcaseUnicodeChar(*pc2++))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (NumChars--)
|
||||
{
|
||||
if (*pc1++ != *pc2++)
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -309,7 +326,7 @@ IopSuffixUnicodeString(
|
|||
static VOID
|
||||
FASTCALL
|
||||
IopDisplayLoadingMessage(
|
||||
_In_ PUNICODE_STRING ServiceName)
|
||||
_In_ PCUNICODE_STRING ServiceName)
|
||||
{
|
||||
extern BOOLEAN SosEnabled; // See ex/init.c
|
||||
static const UNICODE_STRING DotSys = RTL_CONSTANT_STRING(L".SYS");
|
||||
|
@ -317,13 +334,13 @@ IopDisplayLoadingMessage(
|
|||
|
||||
if (!SosEnabled) return;
|
||||
if (!KeLoaderBlock) return;
|
||||
RtlUpcaseUnicodeString(ServiceName, ServiceName, FALSE);
|
||||
RtlStringCbPrintfA(TextBuffer, sizeof(TextBuffer),
|
||||
"%s%sSystem32\\Drivers\\%wZ%s\r\n",
|
||||
KeLoaderBlock->ArcBootDeviceName,
|
||||
KeLoaderBlock->NtBootPathName,
|
||||
ServiceName,
|
||||
IopSuffixUnicodeString(&DotSys, ServiceName) ? "" : ".SYS");
|
||||
IopSuffixUnicodeString(&DotSys, ServiceName, TRUE)
|
||||
? "" : ".SYS");
|
||||
HalDisplayString(TextBuffer);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue