RMADDToHDevice: Difference between revisions
Appearance
mNo edit summary |
|||
Line 1: | Line 1: | ||
This rmcall service maps an ADD/DM handle to a Resource Manager device handle and converts an ADD/DM ADD Handle and ADD/DM UnitHandle to a corresponding Resource Manager device handle. This is done by searching the Resource Manager physical device tree for a node that contains an ADJ_ADD_UNIT adjunct, which matches the supplied ADD Handle and ADD UnitHandle. | This rmcall service maps an ADD/DM handle to a Resource Manager device handle and converts an ADD/DM ADD Handle and ADD/DM UnitHandle to a corresponding Resource Manager device handle. This is done by searching the Resource Manager physical device tree for a node that contains an ADJ_ADD_UNIT adjunct, which matches the supplied ADD Handle and ADD UnitHandle. | ||
==Syntax== | ==Syntax== | ||
Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
; hDevice (PHDEVICE) - output : Pointer to variable to receive device handle of device with a matching ADDHandle and UnitHandle. | ;hDevice (PHDEVICE) - output: Pointer to variable to receive device handle of device with a matching ADDHandle and UnitHandle. | ||
;ADDHandle (USHORT) - input: Handle of the ADD driver assigned by DevHelp_RegisterDeviceClass. | |||
; ADDHandle (USHORT) - input : Handle of the ADD driver assigned by DevHelp_RegisterDeviceClass. | ;UnitHandle (USHORT) - input: UnitHandle the ADD driver assigned to this device. | ||
; UnitHandle (USHORT) - input : UnitHandle the ADD driver assigned to this device. | |||
==Return Code== | ==Return Code== | ||
;rc (APIRET) - returns:On systems where the Resource Manager driver is not installed, the library interface code will return | ;rc (APIRET) - returns:On systems where the Resource Manager driver is not installed, the library interface code will return: | ||
::RMRC_NOT_INSTALLED and will set hDevice to -1L. | ::RMRC_NOT_INSTALLED and will set hDevice to -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_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. | ||
Line 18: | Line 16: | ||
==Remarks== | ==Remarks== | ||
Use RMAdjToHandleList rather than this service to maintain compatibility with future Resource Manager releases. This service will be removed in a future Resource Manager release. | Use [[RMAdjToHandleList]] rather than this service to maintain compatibility with future Resource Manager releases. This service will be removed in a future Resource Manager release. | ||
Refer to the Storage Device Driver Reference for additional information on ADD/DM architecture. | Refer to the Storage Device Driver Reference for additional information on ADD/DM architecture. | ||
==Example Code== | ==Example Code== | ||
Line 35: | Line 33: | ||
rc = RMADDToHDevice(hDevice, ADDHandle, UnitHandle); | rc = RMADDToHDevice(hDevice, ADDHandle, UnitHandle); | ||
</PRE> | </PRE> | ||
[[Category:DevHlps]] | [[Category:DevHlps]] |
Latest revision as of 12:46, 7 June 2021
This rmcall service maps an ADD/DM handle to a Resource Manager device handle and converts an ADD/DM ADD Handle and ADD/DM UnitHandle to a corresponding Resource Manager device handle. This is done by searching the Resource Manager physical device tree for a node that contains an ADJ_ADD_UNIT adjunct, which matches the supplied ADD Handle and ADD UnitHandle.
Syntax
rc = RMADDToHDevice(hDevice, ADDHandle, UnitHandle);
Parameters
- hDevice (PHDEVICE) - output
- Pointer to variable to receive device handle of device with a matching ADDHandle and UnitHandle.
- ADDHandle (USHORT) - input
- Handle of the ADD driver assigned by DevHelp_RegisterDeviceClass.
- UnitHandle (USHORT) - input
- UnitHandle the ADD driver assigned to this device.
Return Code
- rc (APIRET) - returns
- On systems where the Resource Manager driver is not installed, the library interface code will return:
- RMRC_NOT_INSTALLED and will set hDevice to -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_NULL_POINTER - A Resource Manager service received a NULL value for a pointer that was expected to contain a valid 16:16 address.
Remarks
Use RMAdjToHandleList rather than this service to maintain compatibility with future Resource Manager releases. This service will be removed in a future Resource Manager release.
Refer to the Storage Device Driver Reference for additional information on ADD/DM architecture.
Example Code
C
#include <os2.h> #include <rmcalls.h> PHDEVICE hDevice; USHORT ADDHandle; USHORT UnitHandle; APIRET rc; rc = RMADDToHDevice(hDevice, ADDHandle, UnitHandle);