Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:docs:fapi:dosgetmachinemode [2018/08/31 08:23] – created prokushev | en:docs:fapi:dosgetmachinemode [2021/12/05 09:59] (current) – prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{page> | ||
+ | |||
+ | ====== DosGetMachineMode ====== | ||
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 ===== |
- | | + | |
- | ==Parameters== | + | <code c> |
- | ;MachineMode | + | DosGetMachineMode (MachineMode) |
- | ::0 - DOS mode | + | </code> |
- | ::1 - OS/2 mode. | + | |
- | ==Return Code== | + | ===== Parameters ===== |
- | ;rc (USHORT) - return: | + | |
- | *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 | + | * MachineMode |
+ | *0 - DOS (real) mode | ||
+ | *1 - OS/2 (protected) mode. | ||
- | ==Example Code== | + | ===== Return Code ===== |
- | ===C Binding=== | + | |
- | < | + | |
- | #define INCL_DOSQUEUES | + | |
- | USHORT | + | rc ([[USHORT]]) - return |
- | PBYTE | + | |
- | USHORT | + | |
- | </ | + | |
- | ===MASM Binding=== | + | Return code description is: |
- | < | + | |
- | EXTRN DosGetMachineMode:FAR | + | |
- | INCL_DOSQUEUES | + | |
- | PUSH@ BYTE MachineMode | + | |
- | CALL | + | |
- | Returns WORD | + | ===== 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 (or real), the application is limited to a subset of dynamic link calls listed in the [[en: | ||
- | ====== | + | ===== Example Code ===== |
+ | |||
+ | ==== C Binding ==== | ||
+ | |||
+ | <code c> | ||
+ | #define INCL_DOSMISC | ||
+ | |||
+ | USHORT | ||
+ | PBYTE | ||
+ | USHORT | ||
+ | </ | ||
+ | |||
+ | ==== MASM Binding ==== | ||
+ | |||
+ | <code asm> | ||
+ | EXTRN DosGetMachineMode: | ||
+ | INCL_DOSMISC | ||
+ | |||
+ | PUSH@ BYTE MachineMode | ||
+ | CALL | ||
+ | </ | ||
+ | |||
+ | Returns WORD | ||
+ | |||
+ | ===== Note ===== | ||
Text based on [[http:// | Text based on [[http:// | ||
+ | {{page> | ||
{{page> | {{page> | ||
- | |||