Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
en:docs:fapi:dosgetmachinemode [2018/09/05 07:32] – [Note] prokushev | en:docs:fapi:dosgetmachinemode [2021/09/17 06:09] – prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{logos:os2.gif? | + | {{page>en:templates:fapiint}} |
====== DosGetMachineMode ====== | ====== DosGetMachineMode ====== | ||
Line 5: | Line 5: | ||
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 |
- | | + | <code c> |
+ | DosGetMachineMode (MachineMode) | ||
+ | </ | ||
+ | |||
+ | ===== 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: | ||
Line 15: | Line 18: | ||
*1 - OS/2 (protected) mode. | *1 - OS/2 (protected) mode. | ||
- | ==Return Code== | + | ===== Return Code ===== |
* rc (USHORT) - return | * rc (USHORT) - return | ||
Line 23: | Line 27: | ||
*0 NO_ERROR | *0 NO_ERROR | ||
- | ==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 (or real), the application is limited to a subset of dynamic link calls listed in the [[en: | If the MachineMode value indicates the program is in DOS mode (or real), the application is limited to a subset of dynamic link calls listed in the [[en: | ||
- | ==Example Code== | + | ===== Example Code ===== |
- | ===C Binding=== | + | ==== C Binding |
+ | <code c> | ||
#define INCL_DOSMISC | #define INCL_DOSMISC | ||
| | ||
Line 37: | Line 43: | ||
PBYTE | PBYTE | ||
USHORT | USHORT | ||
+ | </ | ||
- | ===MASM Binding=== | + | ==== MASM Binding |
+ | <code asm> | ||
EXTRN DosGetMachineMode: | EXTRN DosGetMachineMode: | ||
INCL_DOSMISC | INCL_DOSMISC | ||
Line 45: | Line 53: | ||
PUSH@ BYTE MachineMode | PUSH@ BYTE MachineMode | ||
CALL | CALL | ||
+ | </ | ||
Returns WORD | Returns WORD | ||
- | ====== Note ====== | + | ===== Note ===== |
Text based on [[http:// | Text based on [[http:// |