_SetDescriptor

include vmm.inc

VMMcall _SetDescriptor, <Selector, VM, DescDWORD1, DescDWORD2, flags>

or eax, eax ; nonzero if set, zero if error

jz not_set


The _SetDescriptor service sets (changes) the descriptor of the given selector.

Parameters

Selector

Specifies the GDT or LDT selector to set.

VM

Specifies a handle identifying the virtual machine to which the specified LDT selector belongs. The service ignores this parameter if Selector is a GDT selector. Otherwise, the handle must be valid for LDT selectors.

DescDWORD1

Specifies the high doubleword of the descriptor for the selector. This parameter contains the high 16 bits of the base address, the high 4 bits of the limit, and the status and type bits.

DescDWORD2

Specifies the low doubleword of the descriptor for the selector. This parameter contains the low 16 bits of the base address and limit.

flags

Specifies the operation flags. This parameter must be set to 0.

Return Value

The EAX register contains a nonzero value if the service is successful. Otherwise, EAX contains zero to indicate an error, such as an invalid selector or an invalid virtual machine handle.

Comments

This service ignores the high 16-bits of the Selector parameter; the 80386 CPU often sets these bits to random values when doubleword operations are performed on segment registers.

The service ignores the RPL bits of the selector.

Uses

EAX

See Also

_GetDescriptor