RMCreateLDev
From EDM2
Syntax
RMCreateLDev(hDriver, hLDev, hAssocDevice, LDevStruct);
Parameters
- hDriver (HDRIVER) - input
- Driver handle of the device driver creating this adapter.
- hLDev (PHLDEV) - output
- Pointer to variable to receive the returned logical device handle.
- hAssocDevice (HDEVICE) - input
- Handle of the physical device or adapter that this logical device is aliasing.
- Note
- This field can also contain an adapter handle that was coerced to an HDEVICE type.
- LDevStruct (PLDEVSTRUCT) - output
- Pointer to the LDEVSTRUCT structure.
Return Code
- rc (APIRET) - returns
- On systems where the Resource Manager driver is not installed, the library interface code will return RMRC_SUCCESS and a logical device handle of -1L.
- 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.
- RMRC_NULL_POINTER: A Resource Manager service received a NULL value for a pointer that was expected to contain a valid 16:16 address.
- RMRC_INVALID_PARM_VALUE: A nonhandle or nonpointer variable contains an invalid or out-of-range value because:
- An invalid decode width was specified when allocating an I/O Port range.
- A handle search is being performed with cMaxHandles set to 0.
- RMRC_BAD_DEVICEHANDLE: 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_OUT_OF_MEMORY: The Resource Manager is out of memory.
- RMRC_RES_ALREADY_CLAIMED: The requested resource is allocated exclusively to another driver, or the requested sharing mode conflicts with the sharing mode of other owners of the resource.
Remarks
None.
Example Code
C
#include <os2.h> #include <rmcalls.h> HDRIVER hDriver; PHLDEV hLDev; HDEVICE hAssocDevice; PLDEVSTRUCT LDevStruct; APIRET rc; rc = RMCreateLDev(hDriver, hLDev, hAssocDevice, LDevStruct);