This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS

Note: This is legacy API call. It is recommended to use 32-bit equivalent

This call performs control functions on a device specified by an opened device handle.

Syntax

DosDevIOCtl2 (Data, DataLength, ParmList, ParmListLength,

Function, Category, DevHandle)

Parameters

;Data (PVOID) - input : Address of the data area. ;DataLength (USHORT) - input : Length of the data buffer. ;ParmList (PVOID) - input : Address of the command-specific argument list. ;ParmListLength (USHORT) - input : Length of the command-specific argument list. ;Function (USHORT) - input : Device-specific function code. ;Category (USHORT) - input : Device category. ;DevHandle (HFILE) - input : Device handle returned by DosOpen or a standard (open) device handle.

Return Code

;rc (USHORT) - return:Return code descriptions are: * 0 NO_ERROR * 1 ERROR_INVALID_FUNCTION * 6 ERROR_INVALID_HANDLE *15 ERROR_INVALID_DRIVE *31 ERROR_GEN_FAILURE *87 ERROR_INVALID_PARAMETER *115 ERROR_PROTECTION_VIOLATION *117 ERROR_INVALID_CATEGORY *119 ERROR_BAD_DRIVER_LEVEL *163 ERROR_UNCERTAIN_MEDIA *165 ERROR_MONITORS_NOT_SUPPORTED

Remarks

Values returned in the range hex FF00 through FFFF are user dependent error codes. Values returned in the range hex FE00 through FEFF are device driver dependent error codes.

Refer to the IBM Operating System/2 Version 1.2 I/O Subsystems And Device Support Volume 1 for a complete listing of control functions (DevHlp calls).

This function provides a generic, expandable IOCTL facility.

A null (zero) value for Data specifies that this parameter is not defined for the generic IOCTL function being specified. A null value for Data causes the value passed in DataLength to be ignored.

A null (zero) value for ParmList specifies that this parameter is not defined for the generic IOCTL function being specified. A null value for ParmList causes the value passed in ParmListLength to be ignored.

The kernel formats a generic IOCTL packet and call the device driver. Since V1.0 and V1.1 device drivers do not understand generic IOCTL packets with DataLength and ParmListLength, the kernel does not pass these fields to the device driver. Device drivers that are marked as being level 2 or higher must support receipt of the generic IOCTL packets with associated length fields.

Do not pass a non-null pointer with a zero length.

Bindings

C

<PRE> #define INCL_DOSDEVICES

USHORT rc = DosDevIOCtl2(Data, ParmList, Function, Category, DevHandle);

PVOID Data; /* Data area */ USHORT DataLength /* Data area length */ PVOID ParmList; /* Command arguments */ USHORT ParmListLength /* Command arguments list length */ USHORT Function; /* Device function */ USHORT Category; /* Device category */ HFILE DevHandle; /* Specifies the device */

USHORT rc; /* return code */ </PRE>

MASM

<PRE> EXTRN DosDevIOCtl2:FAR INCL_DOSDEVICES EQU 1

PUSH@ OTHER Data ;Data area PUSH WORD DataLength ;Data area length PUSH@ OTHER ParmList ;Command arguments PUSH WORD ParmListLength ;Command arguments list length PUSH WORD Function ;Device function PUSH WORD Category ;Device category PUSH WORD DevHandle ;Device handle CALL DosDevIOCtl2

Returns WORD </PRE>

Family API
DOS	Process Manager	DosBeep DosExit DosSleep DosExecPgm
File Manager	DosChDir DosChgFilePtr DosClose DosDelete DosDupHandle DosMkDir DosMove DosQCurDir DosQCurDisk DosSetFileMode DosOpen DosQFileInfo DosRead DosQFileMode DosQFSInfo DosQVerify DosRmDir DosSelectDisk DosFindClose DosFindFirst DosFindNext DosSetFileInfo DosSetVerify DosWrite DosFileLocks DosSetFHandState DosNewSize DosBufReset DosQFHandState DosSetFSinfo DosShutdown
Memory Manager	DosFreeSeg DosSubAlloc DosSubFree DosSubSet DosAllocHuge DosAllocSeg DosReallocHuge DosReallocSeg DosGetHugeShift DosCreateCSAlias
NLS	DosCaseMap DosGetCtryInfo DosGetDBCSEv DosSetCtryCode DosGetCollate DosGetMessage DosInsMessage DosPutMessage
Date and Time	DosSetDateTime DosGetDateTime
Devices	DosDevConfig DosDevIOCtl DosDevIOCtl2
Signals	DosHoldSignal DosSetSigHandler
Misc	BadDynLink DosGetEnv DosGetMachineMode DosGetVersion DosError DosErrClass DosSetVec
KBD	KbdCharIn KbdFlushBuffer KbdGetStatus KbdSetStatus KbdStringIn KbdPeek
VIO	VioGetBuf VioGetConfig VioGetCurPos VioGetCurType VioGetPhysBuf VioReadCellStr VioReadCharStr VioScrollUp VioScrollDn VioScrollLf VioScrollRt VioScrUnLock VioSetCurPos VioSetCurType VioSetMode VioGetMode VioShowBuf VioWrtCellStr VioWrtCharStr VioWrtCharStrAtt VioWrtNAttr VioWrtNCell VioWrtNChar VioWrtTTY VioScrLock VioPopUp
Tools	BIND
Modules	DOSCALLS.DLL VIOCALLS.DLL KBDCALLS.DLL MSG.DLL
Libraries	API.LIB OS2386.LIB FAPI.LIB DOSCALLS.LIB SUBCALLS.LIB