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

DosDevConfig

This call gets information about attached devices.

Syntax

DosDevConfig (DeviceInfo, Item, Parm)

Parameters

Return Code

rc (USHORT) - return:Return code descriptions are:

Remarks

The system model (function 5) and submodel (function 4) information is obtained from BIOS.

In addition, the number of devices attached in a PS/2 environment reflect only devices that are “awake”. Devices that are “asleep” are not counted.

Bindings

C

  #define INCL_DOSDEVICES
 
  USHORT  rc = DosDevConfig(DeviceInfo, Item, Parm);
 
  PVOID   DeviceInfo;    /* Returned information */
  USHORT  Item;          /* Item number */
  USHORT  Parm;          /* Reserved */
 
  USHORT  rc;            /* return */

MASM

  EXTRN  DosDevConfig:FAR
  INCL_DOSDEVICES     EQU 1
 
  PUSH@  OTHER   DeviceInfo  ;Requested information (returned)
  PUSH   WORD    Item        ;Item number
  PUSH   WORD    Parm        ;Reserved (must be zero)
  CALL   DosDevConfig

Returns WORD

Example Code

This example gets information about model type, monitor and coprocessor and display it.

  #define INCL_DOSDEVICES
 
  #define MACHINE_MODEL 5
  #define DISPLAY_TYPE 6
  #define FIND_COPROCESSOR 3
  #define RESERVED 0L
 
  BYTE   DeviceInfo;
  USHORT rc;
 
     if(!DosDevConfig(&DeviceInfo,          /* Returned information */
                      MACHINE_MODEL,        /* Item number */
                      RESERVED))            /* Reserved */
        printf("Model Type %d ",DeviceInfo);
 
     if(!DosDevConfig(&DeviceInfo,          /* Returned information */
                      DISPLAY_TYPE,         /* Item number */
                      RESERVED))            /* Reserved */
        if (DeviceInfo)
           printf("Colour display ");
        else
           printf("Mono display ");
 
     if(!DosDevConfig(&DeviceInfo,          /* Returned information */
                      FIND_COPROCESSOR,     /* Item number */
                      RESERVED))            /* Reserved */
        if (DeviceInfo)
           printf("Coprocessor");
        else
           printf("No Coprocessor");

Note

Text based on http://www.edm2.com/index.php/DosDevConfig_(Legacy)