https://git.reactos.org/?p=reactos.git;a=commitdiff;h=44511f0809aa57051e1c927f3090111ec663aaa6
commit 44511f0809aa57051e1c927f3090111ec663aaa6 Author: Hermès Bélusca-Maïto <[email protected]> AuthorDate: Sun Dec 27 00:31:54 2020 +0100 Commit: Hermès Bélusca-Maïto <[email protected]> CommitDate: Sun Dec 27 00:51:59 2020 +0100 [NTOS:IO] Minor formatting only. Making IopLoadUnloadDriver() looking similar to IopUnloadDriver(). --- ntoskrnl/io/iomgr/driver.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/ntoskrnl/io/iomgr/driver.c b/ntoskrnl/io/iomgr/driver.c index 6b3949a5189..9f7d5ed5aba 100644 --- a/ntoskrnl/io/iomgr/driver.c +++ b/ntoskrnl/io/iomgr/driver.c @@ -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; }
