The ReleasePrimary function releases the primary surface and its attached clipper and palette.
static HRESULT
ReleasePrimary(void)
{
if (NULL != lpddPalette)
{
lpddPalette->lpVtbl->Release(lpddPalette);
lpddPalette = NULL;
}
if (NULL != lpddPrimary)
{
lpddPrimary->lpVtbl->Release(lpddPrimary);
lpddPrimary = NULL;
}
return DD_OK;
}