次の方法で共有


IDirectDraw::GetAvailableVidMem (Windows Embedded CE 6.0)

1/6/2010

This method retrieves the total amount of display memory available and the amount of display memory currently free for a given type of surface.

Syntax

HRESULT GetAvailableVidMem( 
  LPDDSCAPS lpDDSCaps, 
  LPDWORD lpdwTotal, 
  LPDWORD lpdwFree
);

Parameters

  • lpDDSCaps
    Address of a DDSCAPS structure that indicates the hardware capabilities of the proposed surface.
  • lpdwTotal
    Address of a variable that will be filled with the total amount of display memory available, in bytes. The value retrieved reflects the total video memory, less the video memory required for the primary surface and any private caches the display driver reserves.
  • lpdwFree
    Address of a variable that will be filled with the amount of display memory currently free that can be allocated for a surface that matches the capabilities specified by the structure at lpDDSCaps.

Return Value

If the method succeeds, the return value is DD_OK.

If the method fails, the return value may be one of the following error values:

DDERR_INVALIDCAPS

DDERR_INVALIDOBJECT

DDERR_INVALIDPARAMS

DDERR_UNSUPPORTED

For more information on these error codes see DirectDraw Return Values.

Remarks

If NULL is passed to either lpdwTotal or lpdwFree, the value for that parameter is not returned.

This method provides only a snapshot of the current display-memory state.

The amount of free display memory is subject to change as surfaces are created and released. Therefore, use the free memory value only as an approximation.

In addition, a particular display adapter card may make no distinction between two different memory types.

This method might not be supported on some drivers. In this case, the method will return DDERR_UNSUPPORTED.

Requirements

Header ddraw.h
Library ddraw.lib
Windows Embedded CE Windows Embedded CE 6.0 and later

See Also

Reference

IDirectDraw