DXGKARGCB_MAP_PHYSICAL_MEMORY structure (d3dkmddi.h)

The DXGKARGCB_MAP_PHYSICAL_MEMORY structure contains the information used by the DXGKCB_MAPPHYSICALMEMORY callback function to map a CPU-visible virtual address to the underlying physical memory.

Syntax

typedef struct _DXGKARGCB_MAP_PHYSICAL_MEMORY {
  [in]     HANDLE           hPhysicalMemoryObject;
  [in]     DXGK_ACCESS_MODE AccessMode;
  [in/out] SIZE_T           Offset;
  [in]     SIZE_T           Size;
  [out]    void             *pMappedAddress;
} DXGKARGCB_MAP_PHYSICAL_MEMORY;

Members

[in] hPhysicalMemoryObject

The physical memory object that describes the underlying physical pages to be mapped. This object was created in a prior call to DXGKCB_CREATEPHYSICALMEMORYOBJECT.

[in] AccessMode

A DXGK_ACCESS_MODE enum value that describes the access mode (user mode or kernel mode) for which the mapping should be made.

[in/out] Offset

As an input, specifies the offset from the start of the physical memory object, in bytes. As an output, specifies the offset from the start of the mapped base address where the requested data resides, in bytes. See Remarks for more information.

[in] Size

As an input, specifies the requested size of the mapped region, in bytes. As an output, specifies the actual mapped size, in bytes. See Remarks for more information.

[out] pMappedAddress

On a successful call to DXGKCB_MAPPHYSICALMEMORY, this is a pointer to the underlying physical memory mapping. The start of the mapped memory range might not be exactly equal to the offset requested by the driver if rounding or alignment was required. As a result, the output value of Offset refers to the offset from the base address to the data requested by the driver. That is, ActualAddress = BaseAddress + Offset.

Remarks

Offset and Size are both input and output parameters. As an input, these describe the region of physical memory that is requested by the caller. On output, these describe the actual mapped view. This is because the address that is mapped to the corresponding physical memory may not be exactly at the requested offset. The actual data requested by the caller will be equal to pMappedAddress + Offset. The size of the virtual address range that was mapped will be the output value of Size, which may be larger than the requested size.

See IOMMU DMA remapping for more information.

Requirements

Requirement Value
Minimum supported server Windows Server 2022 (WDDM 2.9)
Header d3dkmddi.h

See also

DXGK_ACCESS_MODE

DXGKCB_MAPPHYSICALMEMORY