rewrite lite of Create_DirectDraw and add reenble options.

svn path=/trunk/; revision=27206
This commit is contained in:
Magnus Olsen 2007-06-16 18:18:04 +00:00
parent e0e7446ed1
commit 6eae3cd5e1
2 changed files with 36 additions and 4 deletions

View file

@ -53,7 +53,7 @@ DirectDrawCreate (LPGUID lpGUID,
}
else
{
retVal = Create_DirectDraw (lpGUID, (LPDIRECTDRAW*)lplpDD, &IID_IDirectDraw, TRUE);
retVal = Create_DirectDraw (lpGUID, (LPDIRECTDRAW*)lplpDD, &IID_IDirectDraw, FALSE);
}
}
_SEH_HANDLE
@ -97,7 +97,7 @@ DirectDrawCreateEx(LPGUID lpGUID,
}
else
{
retVal = Create_DirectDraw (lpGUID, (LPDIRECTDRAW*)lplpDD, id, TRUE);
retVal = Create_DirectDraw (lpGUID, (LPDIRECTDRAW*)lplpDD, id, FALSE);
}
/* Create our DirectDraw interface */

View file

@ -20,7 +20,7 @@ WNDCLASSW wnd_class;
HRESULT WINAPI
Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface,
REFIID id, BOOL ex)
REFIID id, BOOL reenable)
{
LPDDRAWI_DIRECTDRAW_INT This;
@ -101,7 +101,39 @@ Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface,
*pIface = (LPDIRECTDRAW)This;
/* Get right interface we whant */
if (Main_DirectDraw_QueryInterface((LPDIRECTDRAW7)This, id, (void**)&pIface) == DD_OK)
This->lpVtbl = 0;
if (IsEqualGUID(&IID_IDirectDraw7, id))
{
/* DirectDraw7 Vtable */
This->lpVtbl = &DirectDraw7_Vtable;
This->lpLcl->dwLocalFlags = This->lpLcl->dwLocalFlags + DDRAWILCL_DIRECTDRAW7;
*pIface = (LPDIRECTDRAW)&This->lpVtbl;
Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
}
else if (IsEqualGUID(&IID_IDirectDraw4, id))
{
/* DirectDraw4 Vtable */
This->lpVtbl = &DirectDraw4_Vtable;
*pIface = (LPDIRECTDRAW)&This->lpVtbl;
Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
}
else if (IsEqualGUID(&IID_IDirectDraw2, id))
{
/* DirectDraw2 Vtable */
This->lpVtbl = &DirectDraw2_Vtable;
*pIface = (LPDIRECTDRAW)&This->lpVtbl;
Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
}
else if (IsEqualGUID(&IID_IDirectDraw, id))
{
/* DirectDraw4 Vtable */
This->lpVtbl = &DirectDraw_Vtable;
*pIface = (LPDIRECTDRAW)&This->lpVtbl;
Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
}
if ( This->lpVtbl != 0)
{
DX_STUB_str("Got iface\n");