DxgkCbMapMemory routine

The DxgkCbMapMemory function maps a range of translated physical addresses (associated with a memory resource assigned to a display adapter) into system space or the virtual address space of a user-mode process.

Syntax


DXGKCB_MAP_MEMORY DxgkCbMapMemory;

NTSTATUS DxgkCbMapMemory(
  _In_   HANDLE DeviceHandle,
  _In_   PHYSICAL_ADDRESS TranslatedAddress,
  _In_   ULONG Length,
  _In_   BOOLEAN InIoSpace,
  _In_   BOOLEAN MapToUserMode,
  _In_   MEMORY_CACHING_TYPE CacheType,
  _Out_  PVOID *VirtualAddress
)
{ ... }

Parameters

DeviceHandle [in]

A handle that represents a display adapter. The display miniport driver previously obtained this handle in the DeviceHandle member of the DXGKRNL_INTERFACE structure that was passed to DxgkDdiStartDevice.

TranslatedAddress [in]

The base translated physical address of the memory range to be mapped. The display miniport driver previously obtained this address by calling DxgkCbGetDeviceInformation.

Length [in]

The size, in bytes, of the range to be mapped.

InIoSpace [in]

A Boolean value that specifies whether the range is in I/O space (TRUE) or memory space (FALSE).

MapToUserMode [in]

A Boolean value that specifies whether the range is mapped into user-mode space or system space. If TRUE, the range is mapped into the (user-mode) virtual address space of the current process. If FALSE, the range is mapped into system space. If InIoSpace is TRUE, this parameter is ignored.

CacheType [in]

A MEMORY_CACHING_TYPE enumerator that specifies the caching behavior of the mapped range.

VirtualAddress [out]

A pointer to a variable that receives the address of the beginning of the mapped range. The way that the mapped range is accessed depends on the values of InIoSpace and MapToUserMode. The following table summarizes the different ways that the mapped range is accessed.

MapToUserMode is FALSEMapToUserMode is TRUE
InIoSpace is FALSEREAD_REGISTER_X WRITE_REGISTER_XUser-mode code performs ordinary memory access.
InIoSpace is TRUEREAD_PORT_X WRITE_PORT_XNot possible.

 

Return value

DxgkCbMapMemory returns STATUS_SUCCESS if it succeeds. Otherwise, it returns one of the error codes defined in Ntstatus.h.

Remarks

The PHYSICAL_ADDRESS data type is defined in Ntdef.h.

Requirements

Version

Available in Windows Vista and later versions of the Windows operating systems.

Header

Dispmprt.h (include Dispmprt.h)

IRQL

PASSIVE_LEVEL

See also

MEMORY_CACHING_TYPE

 

 

Send comments about this topic to Microsoft

표시:
© 2014 Microsoft