Losing Surfaces

The surface memory associated with a DirectDrawSurface object may be freed, while the DirectDrawSurface objects representing these pieces of surface memory are not necessarily released. When a DirectDrawSurface object loses its surface memory, many of the methods return DDERR_SURFACELOST and perform no other action.

Surfaces can be lost because the display card mode was changed or because an application received exclusive access to the display card and freed all of the surface memory currently allocated on the card. The IDirectDrawSurface2::Restore method re-creates these lost surfaces and reconnects them to their DirectDrawSurface objects.

For more information, see Changing Modes and Exclusive Access.