LRESULT CloseDriver(hdrvr, lParam1, lParam2) | |||||
HDRVR hdrvr; | /* handle of installable driver | */ | |||
LPARAM lParam1; | /* driver-specific data | */ | |||
LPARAM lParam2; | /* driver-specific data | */ |
The CloseDriver function closes an installable driver.
hdrvr
Identifies the installable driver to be closed. This parameter must have been obtained by a previous call to the OpenDriver function.
lParam1
Specifies driver-specific data.
lParam2
Specifies driver-specific data.
The return value is nonzero if the function is successful. Otherwise, it is zero.
When an application calls CloseDriver and the driver identified by hdrvr is the last instance of the driver, Windows calls the DriverProc function three times. On the first call, Windows sets the third DriverProc parameter, wMessage, to DRV_CLOSE; on the second call, Windows sets wMessage to DRV_DISABLE; and on the third call, Windows sets wMessage to DRV_FREE. When the driver identified by hdrvr is not the last instance of the driver, only DRV_CLOSE is sent. The values specified in the lParam1 and lParam2 parameters are passed to the lParam1 and lParam2 parameters of the DriverProc function.