Map_Lin_To_VM_Addr

include vmm.inc

mov     eax, LineAddr   ; linear address to convert
mov     ecx, Limit      ; segment limit in bytes
VMMCall Map_Lin_To_VM_Addr

jc      error           ; carry flag set if error
mov     [SegSel], cx    ; segment or selector
mov     [Offset], edx   ; address offset
 

Converts a 32-bit ring-0 linear address into an V86 or protected-mode address. This service converts the address for use with the current execution mode of the current virtual machine. Uses ECX, EDX, Flags.

LinAddr
Linear address to convert.
Limit
Zero-based segment limit (0 specifies a one-byte segment, 1 is a two-byte segment, and so on). This parameter is used only if the service creates an LDT selector.

If the virtual machine is running in V86 mode, the LineAddr parameter must specify a linear address that is within the 1 megabyte V86 address space of the current virtual machine. The service returns a segment:offset pair.

If the virtual machine is running a protected-mode application, the service returns a selector:offset pair. This service creates a new selector in the current virtual machine's LDT if the specified base and limit values do not match a selector the service previously allocated. The service returns an error if no LDT is available.

A virtual device must never free a selector that is returned by this service. For this reason, this service should be used sparingly.

See Also

Map_Flat