Jump to content

RMDestroyAdapter

From EDM2
Revision as of 17:45, 5 April 2025 by Ak120 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This rmcall service destroys an adapter handle and releases an adapter handle created by RMCreateAdapter.

Syntax

RMDestroyAdapter(hDriver, hAdapter)

Parameters

hDriver (HDRIVER) - input
Handle of the driver supplied when the adapter is created.
hAdapter (HADAPTER) - input
Handle of the adapter 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_ADAPTERHANDLE : 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.
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

Although normal driver execution results in adapter-node creation, there are also environments where adapter node destruction is needed. PCMCIA and docking stations are two environments where the adapter-node destruction service is useful.

Destroying an adapter also destroys any child devices associated with the adapter. Any resource handles allocated to the adapter or child devices are released, as well.

Example Code

C
<os2.h>
<rmcalls.h>

HDRIVER     hDriver;
HADAPTER    hAdapter;
APIRET      rc;

rc = RMDestroyAdapter(hDriver, hAdapter);