+ PreviousMode = ExGetPreviousMode();
+
+ /* Need the appropriate priviliege */
+ if (!SeSinglePrivilegeCheck(SeLoadDriverPrivilege, PreviousMode))
+ {
+ DPRINT1("No unload privilege!\n");
+ return STATUS_PRIVILEGE_NOT_HELD;
+ }
+
+ /* Capture the service name */
+ 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)
+ {
+ ReleaseCapturedUnicodeString(&CapturedServiceName, PreviousMode);
+ return STATUS_INVALID_PARAMETER;
+ }
+