DosGetMachineMode: Difference between revisions
Appearance
m Ak120 moved page OS2 API:CPI:LEGACY:DosGetMachineMode to DosGetMachineMode |
mNo edit summary |
||
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 function has been eliminated since OS/2 2.0 [https://books.google.com.ec/books?id=u7WbsmbttwYC&pg=PT372&lpg=PT372&dq#v=onepage&q&f=false] | This function has been eliminated since OS/2 2.0 [https://books.google.com.ec/books?id=u7WbsmbttwYC&pg=PT372&lpg=PT372&dq#v=onepage&q&f=false] | ||
==Syntax== | ==Syntax== | ||
DosGetMachineMode (MachineMode) | |||
DosGetMachineMode | |||
==Parameters== | ==Parameters== | ||
; | ;MachineMode (PBYTE) - output : Address of the value to indicate the current processor mode. This value may be: | ||
'''Value Definition''' | '''Value Definition''' | ||
0 DOS mode | 0 DOS mode | ||
Line 20: | Line 14: | ||
==Return Code== | ==Return Code== | ||
rc (USHORT) - return | rc (USHORT) - return | ||
Return code description is: | Return code description is: | ||
* 0 NO_ERROR | * 0 NO_ERROR | ||
Line 55: | Line 47: | ||
* | * | ||
[[Category: | [[Category:Dos]] |
Revision as of 12:09, 14 February 2017
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 function has been eliminated since OS/2 2.0 [1]
Syntax
DosGetMachineMode (MachineMode)
Parameters
- MachineMode (PBYTE) - output
- Address of the value to indicate the current processor mode. This value may be:
Value Definition 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.
Example Code
C Binding
#define INCL_DOSQUEUES USHORT rc = DosGetMachineMode(MachineMode); PBYTE MachineMode; /* Processor mode (returned) */ USHORT rc; /* return code /*/
MASM Binding
EXTRN DosGetMachineMode:FAR INCL_DOSQUEUES EQU 1 PUSH@ BYTE MachineMode ;Processor mode (returned) CALL DosGetMachineMode Returns WORD