DevHelp LinToGDTSelector
Appearance
This service converts a linear address to a virtual (selector:offset) address by mapping the given Global Descriptor Table (GDT) selector to the memory region referred to by the given linear address and range. The size of the range mapped must be less than or equal to 64KB.
Syntax
C
USHORT APIENTRY DevHelp_LinToGDTSelector (SEL Selector, LIN LinearAddr, ULONG Size)
Assembler
MOV AX,Selector ; GDT selector to map (allocated using ; AllocateGDTSelector) MOV EBX,Linear_Address ; FLAT address of the memory region to be ; mapped; must be on a page boundary MOV ECX,Size ; Size of the range to be mapped, in bytes; ; must be less than or equal to 64 KB MOV DL,DevHlp_LinToGDTSelector CALL [Device_Help]
Parameters
C
- Selector (SEL)
- GDT selector to map (allocated using AllocateGDTSelector)
- LinearAddr (LIN)
- Flat address of the memory region to be mapped; must be on a page boundary.
- Size (ULONG)
- Size of the range to be mapped, in bytes; must be less than or equal to 64KB.
Assembler
MOV AX,Selector ; GDT selector to map (allocated using AllocateGDTSelector) MOV EBX,Linear_Address ; FLAT address of the memory region to be mapped; must be on a page boundary MOV ECX,Size ; Size of the range to be mapped, in bytes must be less than or equal to 64 KB MOV DL,DevHlp_LinToGDTSelector CALL [Device_Help]
Return Code
C
Success Indicator: 0
Possible errors: ERROR_INVALID_PARAMETER (87)
Assembler
'C' Clear if successful. 'C' Set if error. EAX = Error code. Possible errors: ERROR_INVALID_PARAMETER (87)
Remarks
The memory that is being mapped must be fixed or locked prior to a call to this function. After this function is issued for a particular selector, the addressability remains valid, until the physical device driver changes its content with a subsequent call to the DevHlp services, PageListToGDTSelector, PhysToGDTSel, PhysToGDTSelector, or LinToGDTSelector.
Example Code
C
#include "dhcalls.h" USHORT APIENTRY DevHelp_LinToGDTSelector (SEL Selector, LIN LinearAddr, ULONG Size)