Author: greatlrd
Date: Sat Jun 16 22:18:04 2007
New Revision: 27206
URL:
http://svn.reactos.org/svn/reactos?rev=27206&view=rev
Log:
rewrite lite of Create_DirectDraw and add reenble options.
Modified:
trunk/reactos/dll/directx/ddraw/main.c
trunk/reactos/dll/directx/ddraw/startup.c
Modified: trunk/reactos/dll/directx/ddraw/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/main.c?r…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main.c Sat Jun 16 22:18:04 2007
@@ -53,7 +53,7 @@
}
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 @@
}
else
{
- retVal = Create_DirectDraw (lpGUID, (LPDIRECTDRAW*)lplpDD, id, TRUE);
+ retVal = Create_DirectDraw (lpGUID, (LPDIRECTDRAW*)lplpDD, id, FALSE);
}
/* Create our DirectDraw interface */
Modified: trunk/reactos/dll/directx/ddraw/startup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/startup.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/startup.c (original)
+++ trunk/reactos/dll/directx/ddraw/startup.c Sat Jun 16 22:18:04 2007
@@ -20,7 +20,7 @@
HRESULT WINAPI
Create_DirectDraw (LPGUID pGUID, LPDIRECTDRAW* pIface,
- REFIID id, BOOL ex)
+ REFIID id, BOOL reenable)
{
LPDDRAWI_DIRECTDRAW_INT This;
@@ -101,7 +101,39 @@
*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");