Protected-mode API Elements

Before calling any protected-mode API functions, an application must retrieve VXDLDR's protected-mode API address by using Interrupt 2Fh function 1684h (Get Device API Entry Point Address).


xor     di, di
mov     es, di                           ;es:di = 0 on entry
mov     ax, 1684h                        ;function number
mov     bx, VXDLDR_Device_ID             ;device ID
int     2Fh                              ;get protected-mode API address
mov     ax, es                           ;if es:di=0:0, VXDLDR
or      ax, di                           ;   was not loaded (by default,
jz      vxdldr_not_there                 ;   it is loaded under Windows 95)
mov     word ptr [_VXDLDRCallAddr], di   ;segment in high-order word
mov     word ptr [_VXDLDRCallAddr+2], es ;offset in low-order word

This example stores the selector:offset address used to call VXDLDR in a doubleword variable called _VXDLDRCallAddr. To call protected-mode API functions, an application calls this address after placing the command code in AX. The function names corresponding to these command codes are Get VXDLDR Version, Load Device, and Unload Device.