Losing and Restoring Surfaces
Starting with Windows CE 5.01, DirectDraw surfaces may be lost by changing the rotation angle (through ChangeDisplaySettingsEx) or by switching DirectDraw into excusive mode. When a DirectDraw surface is lost, many methods will return DDERR_SURFACELOST, and perform no other function. A IDirectDrawSurface::Restore should be called to reallocate surface memory and reattach it to the DirectDrawSurface object.
A single call to IDirectDrawSurface::Restore will restore a DirectDrawSurface's associated implicit surfaces. An attempt to restore an implicitly created surface will result in an error.
Note After restoring a surface, the surface's description can change (especially lPitch and lXPitch). Applications should be sure to always use the surface description returned by a call to IDirectDrawSurface::Lock instead of keeping a copy that is used across different calls to Lock.
Send Feedback on this topic to the authors