mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:53:06 +00:00
[NTOS:IO] Minor formatting only.
Making IopLoadUnloadDriver() looking similar to IopUnloadDriver().
This commit is contained in:
parent
8be5f73255
commit
44511f0809
1 changed files with 11 additions and 17 deletions
|
@ -1242,15 +1242,14 @@ IopUnloadDriver(PUNICODE_STRING DriverServiceName, BOOLEAN UnloadPnpDrivers)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Capture the service name */
|
/* Capture the service name */
|
||||||
Status = ProbeAndCaptureUnicodeString(&CapturedServiceName, PreviousMode, DriverServiceName);
|
Status = ProbeAndCaptureUnicodeString(&CapturedServiceName,
|
||||||
|
PreviousMode,
|
||||||
|
DriverServiceName);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
|
||||||
|
|
||||||
DPRINT("IopUnloadDriver('%wZ', %u)\n", &CapturedServiceName, UnloadPnpDrivers);
|
DPRINT("IopUnloadDriver('%wZ', %u)\n", &CapturedServiceName, UnloadPnpDrivers);
|
||||||
|
|
||||||
|
|
||||||
/* We need a service name */
|
/* We need a service name */
|
||||||
if (CapturedServiceName.Length == 0)
|
if (CapturedServiceName.Length == 0)
|
||||||
{
|
{
|
||||||
|
@ -2137,7 +2136,7 @@ IopLoadUnloadDriver(
|
||||||
NTSTATUS NTAPI
|
NTSTATUS NTAPI
|
||||||
NtLoadDriver(IN PUNICODE_STRING DriverServiceName)
|
NtLoadDriver(IN PUNICODE_STRING DriverServiceName)
|
||||||
{
|
{
|
||||||
UNICODE_STRING CapturedDriverServiceName = { 0, 0, NULL };
|
UNICODE_STRING CapturedServiceName = { 0, 0, NULL };
|
||||||
KPROCESSOR_MODE PreviousMode;
|
KPROCESSOR_MODE PreviousMode;
|
||||||
PDRIVER_OBJECT DriverObject;
|
PDRIVER_OBJECT DriverObject;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
@ -2146,32 +2145,27 @@ NtLoadDriver(IN PUNICODE_STRING DriverServiceName)
|
||||||
|
|
||||||
PreviousMode = KeGetPreviousMode();
|
PreviousMode = KeGetPreviousMode();
|
||||||
|
|
||||||
/*
|
/* Need the appropriate priviliege */
|
||||||
* Check security privileges
|
|
||||||
*/
|
|
||||||
if (!SeSinglePrivilegeCheck(SeLoadDriverPrivilege, PreviousMode))
|
if (!SeSinglePrivilegeCheck(SeLoadDriverPrivilege, PreviousMode))
|
||||||
{
|
{
|
||||||
DPRINT("Privilege not held\n");
|
DPRINT1("No load privilege!\n");
|
||||||
return STATUS_PRIVILEGE_NOT_HELD;
|
return STATUS_PRIVILEGE_NOT_HELD;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = ProbeAndCaptureUnicodeString(&CapturedDriverServiceName,
|
/* Capture the service name */
|
||||||
|
Status = ProbeAndCaptureUnicodeString(&CapturedServiceName,
|
||||||
PreviousMode,
|
PreviousMode,
|
||||||
DriverServiceName);
|
DriverServiceName);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
|
||||||
|
|
||||||
DPRINT("NtLoadDriver('%wZ')\n", &CapturedDriverServiceName);
|
DPRINT("NtLoadDriver('%wZ')\n", &CapturedServiceName);
|
||||||
|
|
||||||
/* Load driver and call its entry point */
|
/* Load driver and call its entry point */
|
||||||
DriverObject = NULL;
|
DriverObject = NULL;
|
||||||
Status = IopLoadUnloadDriver(&CapturedDriverServiceName, &DriverObject);
|
Status = IopLoadUnloadDriver(&CapturedServiceName, &DriverObject);
|
||||||
|
|
||||||
ReleaseCapturedUnicodeString(&CapturedDriverServiceName,
|
|
||||||
PreviousMode);
|
|
||||||
|
|
||||||
|
ReleaseCapturedUnicodeString(&CapturedServiceName, PreviousMode);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue