示例#1
0
void call_dd_restore(snapshot_status *psnap) {
    uint8_t item_lock_type = ITEM_LOCK_GRANULAR;
    void   *orig_lock_type = pthread_getspecific(item_lock_type_key);

    pthread_setspecific(item_lock_type_key, &item_lock_type);
    dd_restore(psnap); /* actual restore */
    pthread_setspecific(item_lock_type_key, orig_lock_type);
}
示例#2
0
static 	u8 *screen_lock(u32 *pitch)
{
	HRESULT ret;
	DDSURFACEDESC ddsc;

	dd_restore();
	ddsc.dwSize = sizeof(ddsc);
	ret = lpDDSPrimary->Lock(&screenrect, &ddsc, DDLOCK_WAIT, 0);
	if (ret != DD_OK)
	{
		module_logger(&win32DirectDrawVideo, _L|LOG_ERROR|LOG_USER, _("error in Lock with %8X\n"),ret);
		return NULL;
	}

	/* locked */
	//log("lpSurface = %p\n", ddsc.lpSurface);

	*pitch = ddsc.lPitch;
	return (u8 *)ddsc.lpSurface;
}