Windows 3.1 Device Drivers (ddag31qh.hlp) (Table of Contents; Topic list)
Interrupt 2Fh Function 1602h
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
mov  ax, 1602h            ; Get Enhanced-Mode Windows Entry Point
int  2Fh                  ; multiplex interrupt
 
mov  word ptr [WinAddr], di
mov  word ptr [WinAddr+2], es ; es:di contains entry-point address
 
 
Get Enhanced-Mode Windows Entry Point (Interrupt 2Fh Function 1602h) returns
the address of the 386 enhanced-mode Windows entry-point procedure.
Applications can call this procedure to direct Windows/386 version 2.x to
carry out specific actions.
 
This function applies to Windows/386 version 2.x only. It is provided under
Windows version 3.x for compatibility reasons.
 
Return Value
 
The return value contains the Windows entry-point address in the ES:DI
registers.
 
Comments
 
Although the Windows entry-point address is the same for every virtual
machine, an application can call this function any number of times.
 
To direct Windows to carry out a specific action, the application sets the
AX register to 0000h. This function retrieves the current VM identifier and
copies the identifier to the BX register.
 
Additionally, the application must place a return address in the ES:DI
register pair and use the jmp instruction to transfer control to the Windows
entry point.
 
Example
 
The following example shows how to obtain the current VM identifier:
 
    mov     di, cs
    mov     es, di
    mov     di, OFFSET Win_Return
    xor     ax, ax          ; Get Current VM Identifier
    jmp     [WinAddr]
Win_Return:
    mov     [VM_Id], bx     ; bx contains the current VM identifier
 
 
                                      ♦