The RestorePrimary function attempts to restore the video memory allocated for the primary surface. This function will be invoked by a DirectX function returning DDERR_SURFACELOST due to a mode switch or full-screen DOS box invalidating video memory.
static HRESULT
RestorePrimary(void)
{
ASSERT(NULL != lpddPrimary);
return lpddPrimary->lpVtbl->Restore(lpddPrimary);
}