DosCLIAccess: Difference between revisions
Appearance
mNo edit summary |
mNo edit summary |
||
Line 16: | Line 16: | ||
Applications that use IN/OUT instructions to I/O ports must request I/O privilege with [[DosPortAccess]]. Request for port access also grants CLI/STI privilege from the operating system. | Applications that use IN/OUT instructions to I/O ports must request I/O privilege with [[DosPortAccess]]. Request for port access also grants CLI/STI privilege from the operating system. | ||
== | ==Bindings== | ||
===C | ===C=== | ||
<PRE> | <PRE> | ||
#define INCL_DOSDEVICES | #define INCL_DOSDEVICES | ||
USHORT rc = DosCLIAccess(VOID); | USHORT rc = DosCLIAccess(VOID); | ||
USHORT rc; /* return code */ | |||
</PRE> | |||
===MASM=== | |||
<PRE> | |||
EXTRN DosCLIAccess:FAR | |||
INCL_DOSDEVICES EQU 1 | |||
CALL DosCLIAccess | |||
Returns WORD | |||
</PRE> | </PRE> | ||
==Example== | |||
This example requests I/O privilege for disabling and enabling interrupts. | This example requests I/O privilege for disabling and enabling interrupts. | ||
<PRE> | <PRE> | ||
Line 34: | Line 43: | ||
rc = DosCLIAccess(); /* Request I/O privilege */ | rc = DosCLIAccess(); /* Request I/O privilege */ | ||
</PRE> | </PRE> | ||
Revision as of 02:39, 31 December 2019
This call requests I/O privilege for disabling and enabling interrupts. Access to ports must be granted with DosPortAccess.
Syntax
DosCLIAccess ()
Parameters
none
Return Code
- rc (USHORT) - return
- Return code descriptions are:
- 0 NO_ERROR
Remarks
Applications that only use CLI/STI in IOPL segments must request CLI/STI privilege from the operating system.
Applications that use IN/OUT instructions to I/O ports must request I/O privilege with DosPortAccess. Request for port access also grants CLI/STI privilege from the operating system.
Bindings
C
#define INCL_DOSDEVICES USHORT rc = DosCLIAccess(VOID); USHORT rc; /* return code */
MASM
EXTRN DosCLIAccess:FAR INCL_DOSDEVICES EQU 1 CALL DosCLIAccess Returns WORD
Example
This example requests I/O privilege for disabling and enabling interrupts.
#define INCL_DOSDEVICES USHORT rc; rc = DosCLIAccess(); /* Request I/O privilege */