Jump to content

RMDestroyAdapter: Difference between revisions

From EDM2
Created page with "This rmcall service destroys an adapter handle and releases an adapter handle created by RMCreateAdapter. ==Syntax== RMDestroyAdapter(hDriver, hAdapter); ==Parameters== ;..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This rmcall service destroys an adapter handle and releases an adapter handle created by RMCreateAdapter.  
This rmcall service destroys an adapter handle and releases an adapter handle created by RMCreateAdapter.


==Syntax==
==Syntax==
  RMDestroyAdapter(hDriver, hAdapter);
  RMDestroyAdapter(hDriver, hAdapter)


==Parameters==
==Parameters==
; hDriver (HDRIVER) - input : Handle of the driver supplied when the adapter is created.  
;hDriver (HDRIVER) - input : Handle of the driver supplied when the adapter is created.
;hAdapter (HADAPTER) - input : Handle of the adapter to be destroyed.


; hAdapter (HADAPTER) - input : Handle of the adapter to be destroyed.
==Return Code==
==Return Code==
; rc (APIRET) - returns : On systems where the Resource Manager driver is not installed, the library interface code will return RMRC_SUCCESS.
;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_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.
; 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==
==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.
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.  
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==
==Example Code==
===C===
;C
<PRE>
<PRE>
<os2.h>
<os2.h>

Latest revision as of 17:45, 5 April 2025

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);