Note: This API calls are shared between DOS and Win16 personality.
DPMI is a shared interface for DOS applications to access Intel 80286+ CPUs services. DOS DMPI host provides core services for protected mode applications. Multitasking OS with DOS support also provides DMPI in most cases. Windows standard and extended mode kernel is a DPMI client app. Standard and extended mode kernel differs minimally and shares common codebase. Standard Windows kernel works under DOSX extender. DOSX is a specialized version of 16-bit DPMI Extender (but it is standard DPMI host). Standard mode is just DPMI client, exnhanced mode is DPMI client running under Virtual Machime Manager (really, multitasker which allow to run many DOS sessions). Both modes shares DPMI interface for kernel communication. The OS/2 virtual DOS Protected Mode Interface (VDPMI) device driver provides Version 0.9 DPMI support for virtual DOS machines. Win16 (up to Windows ME) provides Version 0.9 DPMI support.
DPMI host often merged with DPMI extender. Usually DPMI extender provide DPMI host standard services and DOS translation or True DPMI services.
Int 31H, AH=04H, AL=01H
Get DPMI Capabilities
AX = 0401H ES:(E)DI = selector:offset of 128-byte buffer
if function successful Carry flag = clear (this function always succeeds in DPMI 1.0) AX = capabilities flags
|0||0 = PAGED ACCESSED/DIRTY capability not supported 1 = PAGED ACCESSED/DIRTY capability supported|
|1||0 = EXCEPTIONS RESTARTABILITY capability not supported 1 = EXCEPTIONS RESTARTABILITY capability supported|
|2||0 = DEVICE MAPPING capability not supported 1 = DEVICE MAPPING capability supported|
|3||0 = CONVENTIONAL MEMORY MAPPING capability not supported 1 = CONVENTIONAL MEMORY MAPPING capability supported|
|4||0 = DEMAND ZERO-FILL capability not supported 1 = DEMAND ZERO-FILL capability supported|
|5||0 = WRITE-PROTECT CLIENT capability not supported 1 = WRITE-PROTECT CLIENT capability supported|
|6||0 = WRITE-PROTECT HOST capability not supported 1 = WRITE-PROTECT HOST capability supported|
CX = reserved, must be 0 DX = reserved, must be 0 ES:(E)DI = selector:offset of 128-byte buffer filled in by host with information as follows:
|0||1||Host major version number as a decimal number|
|1||1||Host minor version number as a decimal number|
|2||1-126||ASCIIZ (null-terminated) string identifying the DPMI host vendor|
if function unsuccessful Carry flag = set (this function always fails in DPMI 0.9)
Returns information about the capabilities of the DPMI host, including its support or lack of support for optional features in the DPMI Specification. Clients can use this information to optimize their use of system resources in the current environment.
PAGE ACCESSED/DIRTY capability means the DPMI host maintains page dirty and accessed bits that can be read and written with the Get and Set Page Attributes functions (Int 31H Functions 0506H and 0507H). This capability must be supported, and must read and write the hardware-level dirty and accessed bits, if the DPMI host does not provide demand-paged virtual memory. If the DPMI host does support virtual memory, this capability is optional, and if present gives the client the ability to read and write virtual page dirty and accessed bits maintained by the host.
EXCEPTION RESTARTABILITY capability means that a faulting instruction inside the host kernel can always be restarted if the client's exception handler corrects the reason for the exception and returns. Exception restartability allows a client to provide virtual memory under a DPMI host without virtual memory, or to support memory-mapped files under any DPMI host.
DEVICE MAPPING capability means that the DPMI host supports the optional Map Device function (Int 31H Function 0508H).
CONVENTIONAL MEMORY MAPPING capability means that the DPMI host supports the optional Map Conventional Memory function (Int 31H Function 0509H).
DEMAND ZERO-FILL capability means the DPMI host guarantees that all committed pages are initialized to zero when they are created. If this capability is not supported, the contents of newly committed pages are undefined.
WRITE-PROTECT CLIENT capability means the DPMI host guarantees that the client is running at a privilege level such that write protection of pages is effective for the client's accesses and will geneate page faults.
WRITE-PROTECT HOST capability means the DPMI host guarantees that the host has configured the system such that write protection of pages is effective for the host's accesses and will generate page faults.
The host major and minor version numbers are OEM-specific and are not the DPMI version numbers.
Text based on http://www.delorie.com/djgpp/doc/dpmi/