[ros-diffs] [hpoussin] 46200: [ntoskrnl] Better fix for correct display of loaded drivers

hpoussin at svn.reactos.org hpoussin at svn.reactos.org
Sun Mar 14 20:21:38 CET 2010


Author: hpoussin
Date: Sun Mar 14 20:21:38 2010
New Revision: 46200

URL: http://svn.reactos.org/svn/reactos?rev=46200&view=rev
Log:
[ntoskrnl] Better fix for correct display of loaded drivers

Modified:
    trunk/reactos/ntoskrnl/io/iomgr/driver.c

Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c?rev=46200&r1=46199&r2=46200&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/driver.c [iso-8859-1] Sun Mar 14 20:21:38 2010
@@ -150,6 +150,39 @@
 }
 
 /*
+ * RETURNS
+ *  TRUE if String2 contains String1 as a suffix.
+ */
+BOOLEAN
+NTAPI
+IopSuffixUnicodeString(
+    IN PCUNICODE_STRING String1,
+    IN PCUNICODE_STRING String2)
+{
+    PWCHAR pc1;
+    PWCHAR pc2;
+    ULONG Length;
+
+    if (String2->Length < String1->Length)
+        return FALSE;
+
+    Length = String1->Length / 2;
+    pc1 = String1->Buffer;
+    pc2 = &String2->Buffer[String2->Length / sizeof(WCHAR) - Length];
+
+    if (pc1 && pc2)
+    {
+        while (Length--)
+        {
+            if( *pc1++ != *pc2++ )
+                return FALSE;
+        }
+        return TRUE;
+    }
+    return FALSE;
+}
+
+/*
  * IopDisplayLoadingMessage
  *
  * Display 'Loading XXX...' message.
@@ -161,19 +194,16 @@
 IopDisplayLoadingMessage(PUNICODE_STRING ServiceName)
 {
     CHAR TextBuffer[256];
+    UNICODE_STRING DotSys = RTL_CONSTANT_STRING(L".SYS");
 
     if (ExpInTextModeSetup) return;
     RtlUpcaseUnicodeString(ServiceName, ServiceName, FALSE);
     snprintf(TextBuffer, sizeof(TextBuffer),
-            "%s%s%s\\%wZ",
+            "%s%sSystem32\\Drivers\\%wZ%s\n",
             KeLoaderBlock->ArcBootDeviceName,
             KeLoaderBlock->NtBootPathName,
-            "System32\\Drivers",
-            ServiceName);
-    if (!strstr(TextBuffer, ".sys"))
-        strcat(TextBuffer, ".sys\n");
-    else
-        strcat(TextBuffer, "\n");
+            ServiceName,
+            IopSuffixUnicodeString(&DotSys, ServiceName) ? "" : ".SYS");
     HalDisplayString(TextBuffer);
 }
 




More information about the Ros-diffs mailing list