### IDirectDrawSurface3::IsLost

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

HRESULT IsLost();

##### Return Values

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

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

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.

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

##### See Also

IDirectDrawSurface3::Restore