mirror of
https://github.com/reactos/reactos.git
synced 2024-08-07 19:58:21 +00:00
- Calling NtLoadDriver on an already loaded driver should fail with STATUS_IMAGE_ALREADY_LOADED. Fixes one test for kmtest driver tests and a bugcheck when loading the driver a second time.
svn path=/trunk/; revision=42473
This commit is contained in:
parent
90ae79bfc0
commit
8b8078a0da
|
@ -1776,6 +1776,16 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams)
|
|||
/* Store its DriverSection, so that it could be unloaded */
|
||||
DriverObject->DriverSection = ModuleObject;
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT("DriverObject already exist in ObjectManager\n");
|
||||
/* IopGetDriverObject references the DriverObject, so dereference it. */
|
||||
ObDereferenceObject(DriverObject);
|
||||
IopFreeDeviceNode(DeviceNode);
|
||||
LoadParams->Status = STATUS_IMAGE_ALREADY_LOADED;
|
||||
(VOID)KeSetEvent(&LoadParams->Event, 0, FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
IopInitializeDevice(DeviceNode, DriverObject);
|
||||
LoadParams->Status = IopStartDevice(DeviceNode);
|
||||
|
|
Loading…
Reference in a new issue