DevHelp VirtToPhys
From EDM2
This service converts a selector:offset pair to a 32-bit physical address.
Contents
Syntax
C
USHORT APIENTRY DevHelp_VirtToPhys( PVOID SelOffset, PULONG PhysAddr)
Assembler
LDS SI,address ; Virtual address: ; selector:offset MOV DL,DevHlp_VirtToPhys CALL [Device_Help]
Parameters
C
- SelOffset (PVOID)
- Virtual address (selector:offset)
- PhysAddr (PULONG)
- Physical address to be returned.
Assembler
LDS SI,address ; Virtual address: ; selector:offset
Return Code
C
Success Indicator: 0
Returns 32-bit physical address.
Possible errors: None.
Assembler
'C' Clear if successful. AX:BX = Physical address: 32-bit number.
Remarks
If the segment is not already known to be locked, the virtual address should be locked using the DevHlp_Lock before this service is called. VirtToPhys is typically used to convert a virtual address. The virtual address is supplied to the physical device driver by a process (through a generic IOCtl), to a physical memory address so the memory can be accessed at interrupt time.
Example Code
C
#include "dhcalls.h" USHORT APIENTRY DevHelp_VirtToPhys( PVOID SelOffset, PULONG PhysAddr)