The IOCC_UNIT_CONTROL CommandCode consists of all the CommandModifiers responsible for controlling the ownership of a unit. The following table describes the CommandModifiers.
┌────────────────────────┬────────────────────────────────────┐ │CommandModifier │Description │ ├────────────────────────┼────────────────────────────────────┤ │IOCM_ALLOCATE_UNIT │Assigns ownership of the specified │ │ │unit to the caller. A unit must be │ │ │allocated prior to accepting any │ │ │other direct call commands. Once │ │ │allocated, a unit cannot be assigned│ │ │to another owner until that unit is │ │ │deallocated. It is the │ │ │responsibility of the owner to │ │ │coordinate sharing of a unit. │ ├────────────────────────┼────────────────────────────────────┤ │IOCM_DEALLOCATE_UNIT │Removes the caller's ownership of │ │ │the specified unit. Once │ │ │deallocated, a unit can be assigned │ │ │to another owner. │ ├────────────────────────┼────────────────────────────────────┤ │IOCM_CHANGE_UNITINFO │Modifies the specified unit's │ │ │UNITINFO portion of the DEVICETABLE │ │ │structure with the information │ │ │passed by the caller. │ └────────────────────────┴────────────────────────────────────┘Remarks
Support:
Format of IORB
IORB_UNIT_CONTROL Description
This section defines the IORB_UNIT_CONTROL control block. (See the table below.)
┌─────────────────┬─────────────────┬─────────┬─────────────────┐│Field Name │C Type │Length │Description │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │iorbh │IORBH │DB(68) │IORB header │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │Flags │USHORT │DW │Flags │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │pUnitInfo │PUNITINFO │DD │Pointer to │ │ │ │ │UnitInfo │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │UnitInfoLen │USHORT │DW │Length of │ │ │ │ │UnitInfo │ └─────────────────┴─────────────────┴─────────┴─────────────────┘
On entry to the driver:
iorbh
See IORB General Format.
Flags
contains a 0.
pUnitInfo
contains a far pointer to a buffer containing modified unit characteristics,
in the format defined by the UNITINFO structure. The adapter device driver
uses this information to update the unit's UNITINFO structure in the DEVICETABLE.
This field is valid only for the IOCM_CHANGE_UNITINFO CommandModifier.
Note: A device driver can access the UNITINFO structure provided by the IOCM_CHANGE_UNITINFO IORB at any time. The caller, therefore, must not invalidate or release the passed UNITINFO structure on successful completion of this IORB request.
UnitInfoLen
contains the length, in bytes, of the UNITINFO buffer (pUnitInfo)
passed to the driver. This field is valid only for the IOCM_CHANGE_UNITINFO
CommandModifier.
On exit, the driver sets the Status and ErrorCode fields of the IORBH to reflect the results of the IOCC_UNIT_CONTROL request.
Return Codes
Following is a list of the IOCC_UNIT_CONTROL error codes:
IOERR_CMD_SYNTAX
IOERR_CMD_SW_RESOURCE
IOERR_UNIT_ALLOCATED
IOERR_UNIT_NOT_ALLOCATED
For a detailed description of all the return codes, see Error Handling.