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. Windows in Standard Mode provides DPMI services only for Windows Applications, not DOS sessions.
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=01H, AL=02H
Version
0.9
Brief
Resize DOS Memory Block
Input
AX = 0102H BX = new block size in (16-byte) paragraphs DX = selector of block to modify
Return
if function successful Carry flag = clear if function unsuccessful Carry flag = set AX = error code 0007H memory control blocks damaged (also returned by DPMI 0.9 hosts). 0008H insufficient memory (also returned by DPMI 0.9 hosts). 0009H incorrect memory segment specified (also returned by DPMI 0.9 hosts). 8011H descriptor unavailable 8022H invalid selector BX = maximum possible block size (paragraphs)
Notes
Changes the size of a memory block that was previously al located with the Allocate DOS Memory Block function (Int 31H Function 0100H).
Requests to increase the size of an existing DOS memory block may fail due to subsequent DOS memory block allocations causing fragmentation of DOS memory, or insufficient remaining DOS memory. In addition, the function will fail if the block is growing past a 64 KB boundary and the next descriptor in the LDT is not available.
A request to decrease the size of a DOS memory block may cause some descriptors that were previously allocated to the block to be freed and the limit of the new last descriptor for the block to be changed.
Under a DPMI 1.0 host, any segment registers which contain a selector being modified are reloaded by this function and any segment registers which contain a selector being freed are zeroed by this function.
Client programs should never modify or free any descriptors allocated by this function. The Free DOS Memory Block function (Int 31H Function 0101H) will deallocate the descriptors automatically.
Refer to the rules for descriptor usage in Appendix D.
See also
Note
Text based on http://www.delorie.com/djgpp/doc/dpmi/