IDirectDrawSurface2::IsLost

HRESULT IsLost();

Determines if the surface memory associated with a DirectDrawSurface object has been freed.

·Returns DD_OK if the memory has not been freed, or one of the following error values otherwise:

DDERR_INVALIDOBJECT

DDERR_INVALIDPARAMS

DDERR_SURFACELOST

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

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 of the surface memory currently allocated on the display card.