IDirectDrawSurface2::GetAttachedSurface

HRESULT GetAttachedSurface(LPDDSCAPS lpDDSCaps,

LPDIRECTDRAWSURFACE2 FAR * lplpDDAttachedSurface);

Obtains the attached surface that has the specified capabilities.

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

DDERR_INVALIDOBJECT

DDERR_INVALIDPARAMS

DDERR_NOTFOUND

DDERR_SURFACELOST

lpDDSCaps

Address of a DDSCAPS structure that contains the hardware capabilities of the surface.

lplpDDAttachedSurface

Address of a pointer to a DirectDraw surface that will be attached to the current DirectDraw surface specified by the lpDDSurface parameter in the EnumSurfacesCallback callback function, and that has capabilities that match those specified by the lpDDSCaps parameter.

Attachments are used to connect multiple DirectDrawSurface objects into complex structures, like the ones needed to support 3D page flipping with z-buffers. This method fails if more than one surface is attached that matches the capabilities requested. In this case, the application must use the IDirectDrawSurface2::EnumAttachedSurfaces method to obtain the attached surfaces.