[NTOS:IO] Minor formatting only.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 26 Dec 2020 23:31:54 +0000 (00:31 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 26 Dec 2020 23:51:59 +0000 (00:51 +0100)
Making IopLoadUnloadDriver() looking similar to IopUnloadDriver().

ntoskrnl/io/iomgr/driver.c

index 6b3949a..9f7d5ed 100644 (file)
@@ -1242,15 +1242,14 @@ IopUnloadDriver(PUNICODE_STRING DriverServiceName, BOOLEAN UnloadPnpDrivers)
     }
 
     /* Capture the service name */
-    Status = ProbeAndCaptureUnicodeString(&CapturedServiceName, PreviousMode, DriverServiceName);
+    Status = ProbeAndCaptureUnicodeString(&CapturedServiceName,
+                                          PreviousMode,
+                                          DriverServiceName);
     if (!NT_SUCCESS(Status))
-    {
         return Status;
-    }
 
     DPRINT("IopUnloadDriver('%wZ', %u)\n", &CapturedServiceName, UnloadPnpDrivers);
 
-
     /* We need a service name */
     if (CapturedServiceName.Length == 0)
     {
@@ -2137,7 +2136,7 @@ IopLoadUnloadDriver(
 NTSTATUS NTAPI
 NtLoadDriver(IN PUNICODE_STRING DriverServiceName)
 {
-    UNICODE_STRING CapturedDriverServiceName = { 0, 0, NULL };
+    UNICODE_STRING CapturedServiceName = { 0, 0, NULL };
     KPROCESSOR_MODE PreviousMode;
     PDRIVER_OBJECT DriverObject;
     NTSTATUS Status;
@@ -2146,32 +2145,27 @@ NtLoadDriver(IN PUNICODE_STRING DriverServiceName)
 
     PreviousMode = KeGetPreviousMode();
 
-    /*
-     * Check security privileges
-     */
+    /* Need the appropriate priviliege */
     if (!SeSinglePrivilegeCheck(SeLoadDriverPrivilege, PreviousMode))
     {
-        DPRINT("Privilege not held\n");
+        DPRINT1("No load privilege!\n");
         return STATUS_PRIVILEGE_NOT_HELD;
     }
 
-    Status = ProbeAndCaptureUnicodeString(&CapturedDriverServiceName,
+    /* Capture the service name */
+    Status = ProbeAndCaptureUnicodeString(&CapturedServiceName,
                                           PreviousMode,
                                           DriverServiceName);
     if (!NT_SUCCESS(Status))
-    {
         return Status;
-    }
 
-    DPRINT("NtLoadDriver('%wZ')\n", &CapturedDriverServiceName);
+    DPRINT("NtLoadDriver('%wZ')\n", &CapturedServiceName);
 
     /* Load driver and call its entry point */
     DriverObject = NULL;
-    Status = IopLoadUnloadDriver(&CapturedDriverServiceName, &DriverObject);
-
-    ReleaseCapturedUnicodeString(&CapturedDriverServiceName,
-                                 PreviousMode);
+    Status = IopLoadUnloadDriver(&CapturedServiceName, &DriverObject);
 
+    ReleaseCapturedUnicodeString(&CapturedServiceName, PreviousMode);
     return Status;
 }