RMDestroyDriver
From EDM2
This service is supported by both rminfo.dll and rmcalls.lib. It destroys a driver handle and releases a driver handle created by RMCreateDriver. If a driver determines it should fail its initialization (such as unload), the driver will issue this call if it had previously issued an RMCreateDriver request.
Issuing this call will delete all devices, adapters, and resource records created under this driver handle.
Syntax
RMDestroyDriver(hDriver);
Parameters
- hDriver (HDRIVER) - input
- Handle of the driver to be destroyed.
Return Code
- rc (APIRET) - returns
- On systems where the Resource Manager driver is not installed, the library interface code will return RMRC_SUCCESS.
- RMRC_IRQ_ENTRY_ILLEGAL
- A Resource Manager service was issued at interrupt time. The Resource Manager service request can be issued only at task time or INIT time.
- RMRC_BAD_DRIVERHANDLE
- The expected Resource Manager handles were not provided because the handle was not a valid Resource Manager handle or the handle did not point to the type of object the service required.
Remarks
Drivers that intend to unload must still issue the appropriate DevHelp calls to release IRQs and other kernel resources.
Example Code
C
#include <os2.h> #include <rmcalls.h> HDRIVER hDriver; APIRET rc; rc = RMDestroyDriver(hDriver);