Table of Contents

This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS

Note: This is legacy API call. It is recommended to use 32-bit equivalent

2021/09/17 04:47 · prokushev · 0 Comments
2021/08/20 03:18 · prokushev · 0 Comments

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.

Syntax

DosGetMachineMode (MachineMode)

Parameters

Return Code

rc (USHORT) - return

Return code description is:

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 Family API.

Example Code

C Binding

  #define INCL_DOSMISC
 
  USHORT  rc = DosGetMachineMode(MachineMode);
  PBYTE   MachineMode;   /* Processor mode (returned) */
  USHORT  rc;            /* return code /*/

MASM Binding

  EXTRN  DosGetMachineMode:FAR
  INCL_DOSMISC      EQU 1
 
  PUSH@  BYTE    MachineMode   ;Processor mode (returned)
  CALL   DosGetMachineMode

Returns WORD

Note

Text based on http://www.edm2.com/index.php/DosGetMachineMode

2018/09/05 06:19 · prokushev · 0 Comments