PDD_MAPMEMORY callback function (ddrawint.h)

The DdMapMemory callback function maps application-modifiable portions of the frame buffer into the user-mode address space of the specified process, or unmaps memory.

Syntax

PDD_MAPMEMORY PddMapmemory;

DWORD PddMapmemory(
  PDD_MAPMEMORYDATA unnamedParam1
)
{...}

Parameters

unnamedParam1

Points to a DD_MAPMEMORYDATA structure that contains details for the memory mapping or unmapping operation.

Return value

DdMapMemory returns one of the following callback codes:

Remarks

DdMapMemory is called to perform memory mapping before the first call to DdLock. The handle returned by the driver in the fpProcess member of the DD_MAPMEMORYDATA structure at lpMapMemory will be passed to every DdLock call made on the driver.

DdMapMemory is also called to unmap memory after the last DdUnlock call is made.

To prevent driver crashes, the driver must not map any portion of the frame buffer that must not be modified by an application.

The display driver must call upon the video miniport driver to perform the memory mapping or unmapping. To send a synchronous request to the video miniport driver to map the memory, the display driver calls the EngDeviceIoControl GDI function with IOCTL_VIDEO_SHARE_VIDEO_MEMORY or IOCTL_VIDEO_MAP_VIDEO_MEMORY. The display driver sends IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY or IOCTL_VIDEO_UNMAP_VIDEO_MEMORY to the video miniport driver to unmap the memory. For more information, see Communicating IOCTLs to the Video Miniport Driver.

DdMapMemory can only be called with a disabled PDEV to unmap memory. A PDEV is disabled or enabled by calling the display driver's DrvAssertMode function. See Managing PDEVs for more information.

Requirements

Requirement Value
Target Platform Desktop
Header ddrawint.h (include Winddi.h)

See also

DD_MAPMEMORYDATA

DdLock

DdUnlock

EngDeviceIoControl

IOCTL_VIDEO_MAP_VIDEO_MEMORY

IOCTL_VIDEO_SHARE_VIDEO_MEMORY

IOCTL_VIDEO_UNMAP_VIDEO_MEMORY

IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY