DosGetMachineMode: Difference between revisions
Appearance
mNo edit summary |
mNo edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
This call returns the current mode of the processor, whether the processor is running in the DOS mode or the OS/2 mode. This allows an application to determine whether a dynamic link call is valid or not. | This call returns the current mode of the processor, whether the processor is running in the DOS mode or the OS/2 mode. This allows an application to determine whether a dynamic link call is valid or not. | ||
==Syntax== | ==Syntax== | ||
Line 7: | Line 5: | ||
==Parameters== | ==Parameters== | ||
;MachineMode (PBYTE) - output : Address of the value to indicate the current processor mode. This value may be: | ;MachineMode (PBYTE) - output: Address of the value to indicate the current processor mode. This value may be: | ||
::0 - DOS mode | |||
::1 - OS/2 mode. | |||
==Return Code== | ==Return Code== | ||
;rc (USHORT) - return:Return code description is: | |||
Return code description is: | *0 NO_ERROR | ||
* 0 | |||
==Remarks== | ==Remarks== | ||
All dynamic link calls are available to an application if the MachineMode value indicates the program is in OS/2 mode. This method provides a self-tailoring application that allows the application to adapt to the execution environment by limiting or enhancing the functions it provides. | All dynamic link calls are available to an application if the MachineMode value indicates the program is in OS/2 mode. This method provides a self-tailoring application that allows the application to adapt to the execution environment by limiting or enhancing the functions it provides. | ||
If the MachineMode value indicates the program is in DOS mode, the application is limited to a subset of dynamic link calls listed in the Family API. | If the MachineMode value indicates the program is in DOS mode, the application is limited to a subset of dynamic link calls listed in the [[Family API]]. | ||
== | ==Bindings== | ||
===C | ===C=== | ||
<PRE> | <PRE> | ||
#define INCL_DOSQUEUES | #define INCL_DOSQUEUES | ||
USHORT rc = DosGetMachineMode(MachineMode); | USHORT rc = DosGetMachineMode(MachineMode); | ||
PBYTE MachineMode; /* Processor mode (returned) */ | |||
PBYTE | USHORT rc; /* return code /*/ | ||
USHORT | |||
</PRE> | </PRE> | ||
===MASM | ===MASM=== | ||
<PRE> | <PRE> | ||
EXTRN DosGetMachineMode:FAR | EXTRN DosGetMachineMode:FAR | ||
Line 44: | Line 38: | ||
Returns WORD | Returns WORD | ||
</PRE> | </PRE> | ||
[[Category: | [[Category:Dos16]] |
Latest revision as of 04:17, 26 January 2020
This call returns the current mode of the processor, whether the processor is running in the DOS mode or the OS/2 mode. This allows an application to determine whether a dynamic link call is valid or not.
Syntax
DosGetMachineMode (MachineMode)
Parameters
- MachineMode (PBYTE) - output
- Address of the value to indicate the current processor mode. This value may be:
- 0 - DOS mode
- 1 - OS/2 mode.
Return Code
- rc (USHORT) - return
- Return code description is:
- 0 NO_ERROR
Remarks
All dynamic link calls are available to an application if the MachineMode value indicates the program is in OS/2 mode. This method provides a self-tailoring application that allows the application to adapt to the execution environment by limiting or enhancing the functions it provides.
If the MachineMode value indicates the program is in DOS mode, the application is limited to a subset of dynamic link calls listed in the Family API.
Bindings
C
#define INCL_DOSQUEUES USHORT rc = DosGetMachineMode(MachineMode); PBYTE MachineMode; /* Processor mode (returned) */ USHORT rc; /* return code /*/
MASM
EXTRN DosGetMachineMode:FAR INCL_DOSQUEUES EQU 1 PUSH@ BYTE MachineMode ;Processor mode (returned) CALL DosGetMachineMode Returns WORD