DrvUnloadKernelDriver

BOOL
DrvUnloadKernelDriver(
PREG_ACCESS
RegAccess
);

The DrvUnloadKernelDriver function unloads the kernel mode driver.

Parameters

RegAccess

Pointer to a globally-defined structure of type REG_ACCESS.

Return Value

Returns TRUE if the operation succeeds. Otherwise returns FALSE. To obtain an error code value, call GetLastError, which is described in the Win32 SDK.

Comments

The structure pointed to by RegAccess must be a single, globally-defined REG_ACCESS structure that the driver uses with all calls to drvlib.lib functions requiring a RegAccess parameter.

The function sets the kernel-mode driver service's start type to SERVICE_DEMAND_START, so it will not automatically reload when the system is restarted. (For more information, ChangeServiceConfig in the Win32 SDK.)

Drivers must call DrvCreateServicesNode before calling DrvUnLoadKernelDriver.

For additional information, see Installing and Configuring your Driver, Using drvlib.lib.