IDebugDataSpaces2::GetVirtualTranslationPhysicalOffsets method

The GetVirtualTranslationPhysicalOffsets method returns the physical addresses of the system paging structures at different levels of the paging hierarchy.


HRESULT GetVirtualTranslationPhysicalOffsets(
  [in]            ULONG64  Virtual,
  [out, optional] PULONG64 Offsets,
  [in]            ULONG    OffsetsSize,
  [out, optional] PULONG   Levels


Virtual [in]

Specifies the location in the target's virtual address space to translate.

Offsets [out, optional]

Receives the physical addresses for the system paging structures. If it is set to NULL, this information is not returned.

OffsetsSize [in]

Specifies the number of elements the array Offsets holds. This is the maximum number of addresses that will be returned.

Levels [out, optional]

Receives the number of levels in the paging hierarchy for the specified address. If this is NULL, this information is not returned.

Return value

This method can also return error values. See Return Values for more details.

Return codeDescription

The method was successful.


No physical page containing the specified address could be found.



This method is only available in kernel-mode debugging.

Translating a virtual address to a physical address requires Windows to walk down the paging hierarchy. At each level it reads paging information from physical memory. This method returns the offsets for these physical pages. The number of levels in the paging hierarchy may be different for different addresses.

The address at the last level of the hierarchy is the physical address corresponding to the specified virtual address. This is what VirtualToPhysical would return.

For details on how virtual addresses are translated into physical addresses, see Microsoft Windows Internals by David Solomon and Mark Russinovich.


Target platform



Dbgeng.h (include Dbgeng.h)



Send comments about this topic to Microsoft