IopCreateObjectTypes: Add a DeleteProcedure for Device Objects.
authorMichael Martin <michael.martin@reactos.org>
Tue, 2 Jun 2009 12:10:17 +0000 (12:10 +0000)
committerMichael Martin <michael.martin@reactos.org>
Tue, 2 Jun 2009 12:10:17 +0000 (12:10 +0000)
commit1760329b33b4c0f5c5ebc9b56dba8b8a8713a846
tree4ad1d1051b86bec998f6d5589fa38307283efc9d
parent3970cdddbc32fadc447e8eb0ee2e7ebe839a0de6
IopCreateObjectTypes: Add a DeleteProcedure for Device Objects.
IopUnloadDevice: After calling the drivers Unload routine, make the DriverObject temporary and dereference it.
IopUnloadDriver: Check that the driver is not already unloading before trying to call unload routine.
If any failure, dereference the DriverObject before returning STATUS code.
On an attempt to unload the driver, loop through each DeviceObject and set DOE_UNLOAD_PENDING in device extensions flags.
Before calling the driver's unload routine set DRVO_UNLOAD_INVOKED in DriverObject's flags.
Fixes Bugchecks when attempting to load driver a second time and when unloading a driver that has upper level device attached.

svn path=/trunk/; revision=41254
reactos/ntoskrnl/include/internal/io.h
reactos/ntoskrnl/io/iomgr/device.c
reactos/ntoskrnl/io/iomgr/driver.c
reactos/ntoskrnl/io/iomgr/iomgr.c