Windows Driver Kit: Kernel-Mode Driver Framework
EvtDriverUnload
A driver's EvtDriverUnload event callback function performs operations that must take place before the driver is unloaded.
EVT_WDF_DRIVER_UNLOAD EvtDriverUnload;
VOID
EvtDriverUnload (
IN WDFDRIVER Driver
)
{…}
You must declare the function by using the EVT_WDF_DRIVER_UNLOAD type. For more information, see the following Example section.
Parameters
- Driver
- A handle to a framework driver object.
Return Value
None
Comments
The EvtDriverUnload callback function must deallocate any non-device–specific system resources that the driver's DriverEntry routine allocated.
Example
To define an EvtDriverUnload callback function that is named MyDriverUnload, you must first provide a function declaration that SDV and other verification tools require, as follows:
EVT_WDF_DRIVER_UNLOAD MyDriverUnload;
Then, implement your callback function as follows:
VOID
MyDriverUnload (
IN WDFDRIVER Driver
)
{...}
Requirements
Versions: The EvtDriverUnload callback function is supported by version 1.0 and later versions of KMDF.
IRQL: PASSIVE_LEVEL
Headers: Defined in Wdfdriver.h, as follows:
typedef VOID
(EVT_WDF_DRIVER_UNLOAD)(
IN WDFDRIVER Driver
);
Include Wdf.h.
See Also
DriverEntry