Previous Next

Unload

The Unload routine performs any operations that are necessary before the system unloads the driver.

VOID 
  XxxUnload( 
    IN PDRIVER_OBJECT  DriverObject 
    ); 

Parameters

DriverObject
Caller-supplied pointer to a DRIVER_OBJECT structure. This is the driver's driver object.

Return Value

None

Comments

A driver's Unload routine executes in a system thread context at IRQL = PASSIVE_LEVEL.

The Unload routine is optional. A driver's Unload routine, if supplied, should be named XxxUnload, where Xxx is a driver-specific prefix. The driver's DriverEntry routine must store the Unload routine's address in DriverObject->DriverUnload. (If no routine is supplied, this pointer must be NULL.)

For detailed information about implementing a driver's Unload routine, see Writing an Unload Routine.