Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:docs:fapi:dosdevconfig [2018/08/31 08:17] – created prokushev | en:docs:fapi:dosdevconfig [2021/09/17 04:58] (current) – prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{page> | ||
+ | |||
+ | ====== DosDevConfig ====== | ||
This call gets information about attached devices. | This call gets information about attached devices. | ||
- | ==Syntax== | + | ===== Syntax ===== |
- | | + | |
- | ==Parameters== | + | <code c> |
- | ;DeviceInfo | + | DosDevConfig (DeviceInfo, Item, Parm) |
- | ;Item (USHORT) - input: Device information requested. | + | </ |
- | :0 - Number of printers attached | + | |
- | :1 - Number of RS232 ports | + | |
- | :2 - Number of diskette drives | + | |
- | :3 - Presence of math coprocessor (where 0 = not present, 1 = present) | + | |
- | :4 - PC Submodel Type (where the return is the system submodel byte) | + | |
- | :5 - PC Model Type (where the return is the system model byte) | + | |
- | :6 - Display adapter type (where 0 = monochrome mode compatible, 1 = other). | + | |
- | ;Parm (USHORT) - input: Reserved for future use and should be set to zero. | + | |
- | ==Return Code== | + | ===== Parameters ===== |
- | ;rc (USHORT) - return: | + | |
- | * 0 NO_ERROR | + | * DeviceInfo ([[PVOID]]) - output: Address of the byte-wide field containing the requested information. |
- | *87 ERROR_INVALID_PARAMETER | + | * Item ([[USHORT]]) - input: Device information requested. |
+ | * 0 - Number of printers attached | ||
+ | * 1 - Number of RS232 ports | ||
+ | * 2 - Number of diskette drives | ||
+ | * 3 - Presence of math coprocessor (where 0 = not present, 1 = present) | ||
+ | * 4 - PC Submodel Type (where the return is the system submodel byte) | ||
+ | * 5 - PC Model Type (where the return is the system model byte) | ||
+ | * 6 - Display adapter type (where 0 = monochrome mode compatible, 1 = other). | ||
+ | * Parm ([[USHORT]]) - input: Reserved for future use and should be set to zero. | ||
+ | |||
+ | ===== Return Code ===== | ||
+ | |||
+ | rc ([[USHORT]]) - return: | ||
+ | |||
+ | | ||
+ | *87 ERROR_INVALID_PARAMETER | ||
+ | |||
+ | ===== Remarks ===== | ||
- | ==Remarks== | ||
The system model (function 5) and submodel (function 4) information is obtained from BIOS. | 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 " | In addition, the number of devices attached in a PS/2 environment reflect only devices that are " | ||
- | ==Bindings== | + | ===== Bindings |
- | ===C=== | + | |
- | < | + | |
- | #define INCL_DOSDEVICES | + | |
- | USHORT | + | ==== C ==== |
- | PVOID | + | <code c> |
- | USHORT | + | #define INCL_DOSDEVICES |
- | USHORT | + | |
+ | USHORT | ||
+ | |||
+ | | ||
+ | USHORT | ||
+ | USHORT | ||
+ | |||
+ | USHORT | ||
+ | </ | ||
- | USHORT | + | ==== MASM ==== |
- | </ | + | |
- | ===MASM=== | + | <code asm> |
- | <PRE> | + | EXTRN DosDevConfig: |
- | EXTRN DosDevConfig: | + | INCL_DOSDEVICES |
- | INCL_DOSDEVICES | + | |
- | + | PUSH@ OTHER | |
- | PUSH@ OTHER | + | PUSH |
- | PUSH | + | PUSH |
- | PUSH | + | CALL |
- | CALL | + | </ |
Returns WORD | Returns WORD | ||
- | </ | ||
- | ==Example Code== | + | ==== Example Code ==== |
- | This example gets information about model type, monitor and coprocessor and display it. | + | |
- | < | + | |
- | #define INCL_DOSDEVICES | + | |
- | #define MACHINE_MODEL 5 | + | This example gets information about model type, monitor and coprocessor and display it. |
- | #define DISPLAY_TYPE 6 | + | |
- | #define FIND_COPROCESSOR 3 | + | |
- | #define RESERVED 0L | + | |
- | + | ||
- | BYTE | + | |
- | USHORT rc; | + | |
- | | + | <code c> |
- | MACHINE_MODEL, | + | |
- | RESERVED)) | + | |
- | printf(" | + | |
- | if(!DosDevConfig(& | + | #define INCL_DOSDEVICES |
- | DISPLAY_TYPE, | + | |
- | RESERVED)) | + | #define MACHINE_MODEL 5 |
- | if (DeviceInfo) | + | #define DISPLAY_TYPE 6 |
- | | + | #define FIND_COPROCESSOR 3 |
- | else | + | #define RESERVED 0L |
- | | + | |
+ | BYTE | ||
+ | USHORT rc; | ||
+ | |||
+ | if(!DosDevConfig(& | ||
+ | | ||
+ | RESERVED)) | ||
+ | printf(" | ||
+ | |||
+ | | ||
+ | | ||
+ | RESERVED)) | ||
+ | if (DeviceInfo) | ||
+ | | ||
+ | else | ||
+ | | ||
+ | |||
+ | | ||
+ | FIND_COPROCESSOR, | ||
+ | RESERVED)) | ||
+ | if (DeviceInfo) | ||
+ | | ||
+ | else | ||
+ | | ||
- | | ||
- | FIND_COPROCESSOR, | ||
- | RESERVED)) | ||
- | if (DeviceInfo) | ||
- | | ||
- | else | ||
- | | ||
- | </ | ||
+ | </ | ||
+ | ===== Note ===== | ||
- | ====== Note ====== | ||
Text based on [[http:// | Text based on [[http:// |