======================================================================= APPLICATIONS THAT USE DPMI FUNCTIONS=======================================================================Windows version 3.0 running in 386 enhanced mode supports DPMI version0.9. Windows version 3.0 running in standard mode supports a subset ofDPMI that enables applications to call Terminate-and-Stay-Resident(TSR) programs and device drivers running in real (or virtual 8086)mode. All code that calls DPMI directly should reside in aDynamic-Link Library (DLL) to ease the porting of the application toother operating environments.Windows-based applications should only call the following AX values forDPMI version 0.9 functions: AX value Description -------- ----------- 0200H Get real mode interrupt vector 0201H Set real mode interrupt vector 0300H Simulate real mode interrupt 0301H Call real mode procedure with far return frame 0302H Call real mode procedure with Iret frame 0303H Allocate real mode call-back address 0304H Free real mode call-back addressNOTE: The table listed above differs from that in the printed copy ofthe "Windows 3.00 Developer's Notes" and reflects corrections.Windows-based applications should NOT use DPMI's MS-DOS memory managementfunctions. The Windows version 3.0 Kernel has two functions,GlobalDOSAlloc() and GlobalDOSFree(), that should be used by Windowsapplications and DLLs for allocating and freeing MS-DOS addressablememory.Other than those listed above, no DPMI functions are required forWindows-based applications because the Kernel provides functions forallocating memory, manipulating descriptors, and locking memory.Applications not based on Windows that are running in 386 enhanced mode canuse all the DPMI version 0.9 functions, since they are not restricted bythe Kernel.======================================================================= OTHER APPLICATION PROGRAMMING INTERFACES (APIs)=======================================================================In general, any software interrupt API that passes parameters in theEAX, EBX, ECX, EDX, ESI, EDI, and EBP registers will work as long asnone of the registers contains a selector value. In other words, if asoftware interrupt API is completely register-based without anypointers, segment registers, or stack parameters, that API should workunder Windows in protected mode.More complex software interrupt APIs require the calling function touse the DPMI translation functions.======================================================================= SUPPORT FOR MS-DOS INTERRUPTS UNDER WINDOWS IN PROTECTED MODE=======================================================================This section discusses support for MS-DOS interrupts and functionrequests made under Windows in protected mode. This discussion assumesMS-DOS version 3.x or later is being used.All the MS-DOS interrupts and function requests that are not mentionedin this section should work exactly as documented in "The MS-DOSEncyclopedia."UNSUPPORTED MS-DOS INTERRUPTS AND FUNCTION REQUESTS===================================================The following MS-DOS interrupts are not supported in protected modeand will fail if called. INT Description --- ----------- 20H Terminate program 25H Absolute disk read 26H Absolute disk write 27H Terminate and stay residentThe following MS-DOS INT 21H function requests are also not supportedin protected mode. Function Description -------- ----------- 00H Terminate process 0FH Open file with FCB 10H Close file with FCB 14H Sequential read 15H Sequential write 16H Create file with FCB 21H Random read 22H Random write 23H Get file size 24H Set relative record 27H Random block read 28H Random block write 67H SetHandleCountPARTIALLY SUPPORTED MS-DOS INT 21H FUNCTION REQUESTS====================================================The following MS-DOS INT 21H function requests behave differently inprotected mode than they do in real mode. To use these functionrequests, the application might require additional code.Functions 25H and 35H, Set/Get Interrupt Vector-----------------------------------------------These functions set and get the protected-mode interrupt vector. Theycan be used to hook hardware interrupts, such as the timer or keyboardinterrupt, as well as to hook software interrupts. Except for INT 23H,INT 24H, and INT 1CH, software interrupts that are issued in real modeare not reflected to protected-mode interrupt handlers. However, allhardware interrupts are reflected to protected-mode interrupt handlersbefore being reflected to real mode.Function 38H, Get Country Data------------------------------This function returns a 34-byte buffer containing a double word(DWORD) call address at offset 12H that is used for case mapping. TheDWORD contains a real-mode address. In order to call the case mappingfunction, the DPMI translation function to simulate a real-mode FARcall must be used. See the DPMI specification for more details.Function 44H, Subfunctions 02H, 03H, 04H, and 05H-------------------------------------------------These I/O control (IOCTL) subfunctions are used to receive data from adevice or send data to a device. Since it is not possible to break thetransfers automatically into small pieces, the caller should assumethat a transfer of greater than 4K will fail unless the address of thebuffer is in the low 1 megabyte range.Function 44H, Subfunction 0CH-----------------------------Only the minor function codes 45H (Get Iteration Count) and 65H (SetIteration Count) are supported from protected mode. The extensions ofthis IOCTL subfunction that are used for code-page switching (minorfunction codes 4AH, 4CH, 4DH, 6AH, and 6BH) are not supported forprotected-mode programs. The DPMI translation functions must be usedif it is necessary to use this IOCTL subfunction to switch code pages.Function 65H, Get Extended Country Information----------------------------------------------This function is supported for protected-mode programs. However, allthe DWORD parameters returned will contain real-mode addresses. Thismeans that the case-conversion procedure address and all the pointersto tables will contain real-mode segment:offset addresses. The DPMItranslation functions must be used to call the case-conversionprocedure in real mode.======================================================================= NETBIOS SUPPORT=======================================================================Windows supports standard NetBIOS calls in protected mode. All thenetwork control blocks and buffers must reside in fixed memory that ispage locked. All code that calls NetBIOS directly should reside in aDLL to ease the porting of the application to other operatingenvironments.Additional information on NetBIOS and DPMI support in Windows networkdrivers is available in Chapter 6, "Network Support," in the"Microsoft Windows Device Driver Adaptation Guide," which is part ofthe Microsoft Windows Device Development Kit (DDK). Additionalinformation can be found in the Windows developer's note titled"Developing Network Applications for Windows 3.00," available asarticle Q65125.
Article ID: 65128 - Last Review: 10/26/2013 06:38:00 - Revision: 4.0