If DirectDrawCreate gets passed a IDirectDraw{2,4,7} interface, get

this interface and do not use IDirectDraw.
This commit is contained in:
Marcus Meissner 2000-12-14 19:25:36 +00:00 committed by Alexandre Julliard
parent 8a5de1c92f
commit c9afc46efa
1 changed files with 13 additions and 0 deletions

View File

@ -315,6 +315,19 @@ HRESULT WINAPI DirectDrawCreate(
break; break;
ddraw_drivers[drvindex] = NULL; /* mark this one as unusable */ ddraw_drivers[drvindex] = NULL; /* mark this one as unusable */
} }
if (IsEqualGUID( &IID_IDirectDraw2, lpGUID ) ||
IsEqualGUID( &IID_IDirectDraw4, lpGUID ) ||
IsEqualGUID( &IID_IDirectDraw7, lpGUID )
) {
LPVOID x;
ret = IDirectDraw_QueryInterface(*lplpDD,lpGUID,&x);
IDirectDraw_Release(*lplpDD); /* either drop 1 refcount, or release */
if (!ret)
*lplpDD = x;
else
return ret;
}
wc.style = CS_GLOBALCLASS; wc.style = CS_GLOBALCLASS;
wc.lpfnWndProc = DDWndProc; wc.lpfnWndProc = DDWndProc;
wc.cbClsExtra = 0; wc.cbClsExtra = 0;