IDirectDraw2::EnumSurfaces

HRESULT EnumSurfaces(DWORD dwFlags, LPDDSURFACEDESC lpDDSD,

LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback);

Enumerates all of the existing or possible surfaces that meet the search criterion specified.

·Returns DD_OK if successful, or one of the following error values otherwise:

DDERR_INVALIDOBJECT

DDERR_INVALIDPARAMS

dwFlags

One of the following flags:

DDENUMSURFACES_ALL

Enumerates all of the surfaces that meet the search criterion.

DDENUMSURFACES_CANBECREATED

Enumerates the first surface that can be created and meets the search criterion.

DDENUMSURFACES_DOESEXIST

Enumerates the already existing surfaces that meet the search criterion.

DDENUMSURFACES_MATCH

Searches for any surface that matches the surface description.

DDENUMSURFACES_NOMATCH

Searches for any surface that does not match the surface description.

lpDDSD

Address of a DDSURFACEDESC structure that defines the surface of interest.

lpContext

Address of an application-defined structure that will be passed to each enumeration member.

lpEnumSurfacesCallback

Address of the EnumSurfacesCallback function the enumeration procedure will call every time a match is found.

If the DDENUMSURFACES_CANBECREATED flag is set, this method attempts to temporarily create a surface that meets the criterion. Note that as a surface is enumerated, its reference count is increased—if you are not going to use the surface, use IDirectDraw::Release to release the surface after each enumeration.

As part of the IDirectDraw interface, this method did not support any values other than zero for the dwFlags parameter.