Expand Minimize

HeapVidMemAllocAligned function

The HeapVidMemAllocAligned function allocates off_screen_memory for a display driver by using the DirectDraw video memory heap manager.

Syntax


FLATPTR HeapVidMemAllocAligned(
  _In_   LPVIDMEM lpVidMem,
  _In_   DWORD dwWidth,
  _In_   DWORD dwHeight,
  _In_   LPSURFACEALIGNMENT lpAlignment,
  _Out_  LPLONG lpNewPitch
);

Parameters

lpVidMem [in]

Pointer to a VIDEOMEMORY structure that represents the DirectDraw heap from which to allocate the surface.

dwWidth [in]

Is the width in bytes of the requested surface.

dwHeight [in]

Is the height in scan lines of the requested surface.

lpAlignment [in]

Pointer to a SURFACEALIGNMENT structure that describes the alignment restrictions for the surface.

lpNewPitch [out]

Is the location in which the resulting pitch value is written. This information is relevant only to linear (nonrectangular) off-screen heaps.

Return value

HeapVidMemAllocAligned returns the FLATPTR offset of the resulting allocation upon success. Otherwise, it returns zero.

Remarks

The driver should use the array of VIDEOMEMORY structures its DrvGetDirectDrawInfo function receives to determine the value of lpVidMem with which to call HeapVidMemAllocAligned. The driver receives this array in the pvmList parameter during the second call to DrvGetDirectDrawInfo. It is possible that DrvGetDirectDrawInfo might not be called when low memory conditions exist on the system. Consequently, the driver should always check to ensure that it has a non-NULL pointer in pvmList.

Requirements

Version

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

Header

Dmemmgr.h (include Winddi.h)

Library

Win32k.lib

DLL

Win32k.sys

See also

DrvGetDirectDrawInfo
SURFACEALIGNMENT
VIDEOMEMORY
VidMemFree

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft