Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
DosPortAccess (1.2)
◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_DOSDEVICES
USHORT DosPortAccess(usReserved, fRelease, usFirstPort, usLastPort)
USHORT usReserved; /* must be zero */
USHORT fRelease; /* request/release indicator */
USHORT usFirstPort; /* first port number */
USHORT usLastPort; /* last port number */
The DosPortAccess function requests or releases access to a port, or ports,
for input/output privilege.
Parameter Description
────────────────────────────────────────────────────────────────────────────
usReserved Specifies a reserved value; must be zero.
fRelease Specifies the type of access request. If this parameter is
FALSE, the function requests access to a port. If it is TRUE,
the function releases access to a port.
usFirstPort Specifies either a single port or the starting port number
(start-of-range) in a contiguous range.
usLastPort Specifies either a single port or the ending port number
(end-of-range) in a contiguous range. If only one port is being
used, the usFirstPort and usLastPort parameters must be the
same.
Return Value
The return value is zero if the function is successful. Otherwise, it is an
error value.
Comments
Programs that perform input or output (I/O) to a port, or ports, in IOPL
segments must request port access from the operating system.
Granting port access automatically grants cli and sti privileges from the
operating system. Therefore, there is no need to make an additional call to
the DosCLIAccess function.
See Also
DosCLIAccess
♦