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

DosPortAccess

This call requests or releases access to ports for I/O privilege.

Syntax

DosPortAccess (Reserved, TypeOfAccess, FirstPort, LastPort)

Parameters

Reserved (USHORT) - input : Must be set to zero.

TypeOfAccess (USHORT) - input : A request for or release of access to a port.

0 - Request access

1 - Release access.

FirstPort (USHORT) - input : Starting (low) number in a contiguous range or a single port.

LastPort (USHORT) - input : Ending (high) number in a contiguous range or a single port. If only one port is being used, FirstPort and LastPort should both be set to this port.

Return Code

rc (USHORT) - return:Return code descriptions are:

0 NO_ERROR

5 ERROR_ACCESS_DENIED

Remarks

Note that CLI/STI privilege is also granted automatically. There is no need to make an additional call to DosCLIAccess.

Applications that perform I/O to port(s) in IOPL segments must request port access from the operating system.

An application with no IOPL segments that accesses a device through a device driver or by an interface package such as VIO, does not need to issue this call. The device driver or interface package is responsible for obtaining the necessary I/O access.

Bindings

C

#define INCL_DOSDEVICES USHORT rc = DosPortAccess(Reserved, TypeOfAccess, FirstPort, LastPort); USHORT 0; /* 0 */ USHORT TypeOfAccess; /* Request or release */ USHORT FirstPort; /* First port number */ USHORT LastPort; /* Last port number */ USHORT rc; /* return code */

MASM

EXTRN DosPortAccess:FAR INCL_DOSDEVICES EQU 1 PUSH WORD 0 ;Reserved (must be zero) PUSH WORD TypeOfAccess ;Request or release PUSH WORD FirstPort ;First port number PUSH WORD LastPort ;Last port number CALL DosPortAccess Returns WORD
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