en:docs:fapi:dosgetmachinemode

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
en:docs:fapi:dosgetmachinemode [2018/08/31 08:23] – created prokusheven:docs:fapi:dosgetmachinemode [2018/09/05 07:32] – [Note] prokushev
Line 1: Line 1:
 +{{logos:os2.gif?35x35}} {{logos:dos.gif?35x35}}
 +
 +====== 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==
- DosGetMachineMode (MachineMode)+ 
 +  DosGetMachineMode (MachineMode)
  
 ==Parameters== ==Parameters==
-;MachineMode (PBYTE) - output: Address of the value to indicate the current processor mode. This value may be: + 
-::0 - DOS mode +  * MachineMode (PBYTE) - output: Address of the value to indicate the current processor mode. This value may be: 
-::1 - OS/2 mode.+    *0 - DOS (real) mode 
 +    *1 - OS/2 (protected) mode.
  
 ==Return Code== ==Return Code==
-;rc (USHORT) - return:Return code description is: + 
-*0 NO_ERROR+  * rc (USHORT) - return 
 + 
 +Return code description is: 
 + 
 +  *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, 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 (or real), the application is limited to a subset of dynamic link calls listed in the [[en:docs:fapi|Family API]].
  
 ==Example Code== ==Example Code==
 +
 ===C Binding=== ===C Binding===
-<PRE> 
-#define INCL_DOSQUEUES 
  
-USHORT  rc = DosGetMachineMode(MachineMode); +  #define INCL_DOSMISC 
-PBYTE   MachineMode;   /* Processor mode (returned) */ +   
-USHORT  rc;            /* return code /*/ +  USHORT  rc = DosGetMachineMode(MachineMode); 
-</PRE>+  PBYTE   MachineMode;   /* Processor mode (returned) */ 
 +  USHORT  rc;            /* return code /*/
  
 ===MASM Binding=== ===MASM Binding===
-<PRE> 
-EXTRN  DosGetMachineMode:FAR 
-INCL_DOSQUEUES      EQU 1 
  
-PUSH@  BYTE    MachineMode   ;Processor mode (returned) +  EXTRN  DosGetMachineMode:FAR 
-CALL   DosGetMachineMode+  INCL_DOSMISC      EQU 1 
 +   
 +  PUSH@  BYTE    MachineMode   ;Processor mode (returned) 
 +  CALL   DosGetMachineMode
  
 Returns WORD Returns WORD
-</PRE> 
- 
- 
  
 ====== Note ====== ====== Note ======
Line 46: Line 52:
 Text based on [[http://www.edm2.com/index.php/DosGetMachineMode]] Text based on [[http://www.edm2.com/index.php/DosGetMachineMode]]
  
 +{{page>en:templates:os2api}}
 {{page>en:templates:fapi}} {{page>en:templates:fapi}}
-