Platform SDK: DirectX

IDirectDrawSurface7::IsLost

The IDirectDrawSurface7::IsLost method determines whether the surface memory associated with a DirectDrawSurface object has been freed.

HRESULT IsLost();

Parameters

None.

Return Values

If the method succeeds, the return value is DD_OK because the memory has not been freed.

If it fails, the method can return one of the following error values:

DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_SURFACELOST

You can use this method to determine when you need to reallocate surface memory. When a DirectDrawSurface object loses its surface memory, most methods return DDERR_SURFACELOST and perform no other action.

Remarks

Surfaces can lose their memory when the mode of the display card is changed or when an application receives exclusive access to the display card and frees all surface memory currently allocated on the display card.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 98.
  Header: Declared in ddraw.h.

See Also

IDirectDrawSurface7::Restore, Losing and Restoring Surfaces