Author: greatlrd
Date: Thu Dec 13 15:31:05 2007
New Revision: 31191
URL:
http://svn.reactos.org/svn/reactos?rev=31191&view=rev
Log:
Add D3D COM to ddraw (dx1)
Added:
trunk/reactos/dll/directx/ddraw/Vtable/DirectD3D_Vtable.c (with props)
trunk/reactos/dll/directx/ddraw/d3d/
trunk/reactos/dll/directx/ddraw/d3d/DirectD3D_main.c (with props)
Modified:
trunk/reactos/dll/directx/ddraw/Surface/surface_main.c
trunk/reactos/dll/directx/ddraw/ddraw.rbuild
trunk/reactos/dll/directx/ddraw/rosdraw.h
Modified: trunk/reactos/dll/directx/ddraw/Surface/surface_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Surface/…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Surface/surface_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/Surface/surface_main.c Thu Dec 13 15:31:05 2007
@@ -145,7 +145,7 @@
}
else if (IsEqualGUID(&IID_IDirectDrawColorControl, riid))
{
- if (This->lpVtbl != &DirectDrawSurface_Vtable)
+ if (This->lpVtbl != &DirectDrawColorControl_Vtable)
{
This = internal_directdrawsurface_int_alloc(This);
if (!This)
@@ -160,7 +160,7 @@
}
else if (IsEqualGUID(&IID_IDirectDrawGammaControl, riid))
{
- if (This->lpVtbl != &DirectDrawSurface_Vtable)
+ if (This->lpVtbl != &DirectDrawGammaControl_Vtable)
{
This = internal_directdrawsurface_int_alloc(This);
if (!This)
@@ -175,7 +175,7 @@
}
else if (IsEqualGUID(&IID_IDirectDrawSurfaceKernel, riid))
{
- if (This->lpVtbl != &DirectDrawSurface_Vtable)
+ if (This->lpVtbl != &DirectDrawSurfaceKernel_Vtable)
{
This = internal_directdrawsurface_int_alloc(This);
if (!This)
@@ -188,6 +188,22 @@
*ppObj = This;
Main_DDrawSurface_AddRef(This);
}
+ else if (IsEqualGUID(&IID_IDirect3D, riid))
+ {
+ if (This->lpVtbl != &IDirect3D_Vtbl)
+ {
+ This = internal_directdrawsurface_int_alloc(This);
+ if (!This)
+ {
+ retVal = DDERR_OUTOFVIDEOMEMORY;
+ _SEH_LEAVE;
+ }
+ }
+ This->lpVtbl = &IDirect3D_Vtbl;
+ *ppObj = This;
+ Main_DDrawSurface_AddRef(This);
+ }
+
else
{
DX_STUB_str("E_NOINTERFACE");
Added: trunk/reactos/dll/directx/ddraw/Vtable/DirectD3D_Vtable.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Vtable/D…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Vtable/DirectD3D_Vtable.c (added)
+++ trunk/reactos/dll/directx/ddraw/Vtable/DirectD3D_Vtable.c Thu Dec 13 15:31:05 2007
@@ -1,0 +1,40 @@
+#include <windows.h>
+#include <stdio.h>
+#include <ddraw.h>
+#include <ddrawi.h>
+#include <d3dhal.h>
+#include <ddrawgdi.h>
+
+#if defined(_WIN32) && !defined(_NO_COM )
+#define COM_NO_WINDOWS_H
+#include <objbase.h>
+#else
+#define IUnknown void
+#if !defined(NT_BUILD_ENVIRONMENT) && !defined(WINNT)
+ #define CO_E_NOTINITIALIZED 0x800401F0
+#endif
+#endif
+
+HRESULT WINAPI Main_D3D_QueryInterface(LPDIRECT3D iface, REFIID riid, LPVOID * ppvObj);
+ULONG WINAPI Main_D3D_AddRef(LPDIRECT3D iface);
+ULONG WINAPI Main_D3D_Release(LPDIRECT3D iface);
+HRESULT WINAPI Main_D3D_Initialize(LPDIRECT3D iface, REFIID refiid);
+HRESULT WINAPI Main_D3D_EnumDevices(LPDIRECT3D iface, LPD3DENUMDEVICESCALLBACK Callback,
LPVOID Context);
+HRESULT WINAPI Main_D3D_CreateLight(LPDIRECT3D iface, LPDIRECT3DLIGHT* Light,IUnknown*
pUnkOuter);
+HRESULT WINAPI Main_D3D_CreateMaterial(LPDIRECT3D iface,LPDIRECT3DMATERIAL*
Direct3DLight,IUnknown* pUnkOuter);
+HRESULT WINAPI Main_D3D_CreateViewport(LPDIRECT3D iface, LPDIRECT3DVIEWPORT*
Viewport,IUnknown* pUnkOuter);
+HRESULT WINAPI Main_D3D_FindDevice(LPDIRECT3D iface, LPD3DFINDDEVICESEARCH D3DDFS,
LPD3DFINDDEVICERESULT D3DFDR);
+
+IDirect3DVtbl IDirect3D_Vtbl =
+{
+ Main_D3D_QueryInterface,
+ Main_D3D_AddRef,
+ Main_D3D_Release,
+ Main_D3D_Initialize,
+ Main_D3D_EnumDevices,
+ Main_D3D_CreateLight,
+ Main_D3D_CreateMaterial,
+ Main_D3D_CreateViewport,
+ Main_D3D_FindDevice
+};
+
Propchange: trunk/reactos/dll/directx/ddraw/Vtable/DirectD3D_Vtable.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/directx/ddraw/d3d/DirectD3D_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/d3d/Dire…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/d3d/DirectD3D_main.c (added)
+++ trunk/reactos/dll/directx/ddraw/d3d/DirectD3D_main.c Thu Dec 13 15:31:05 2007
@@ -1,0 +1,70 @@
+#include "rosdraw.h"
+
+#include <string.h>
+
+/* PSEH for SEH Support */
+#include <pseh/pseh.h>
+
+HRESULT WINAPI
+Main_D3D_QueryInterface(LPDIRECT3D iface, REFIID riid, LPVOID * ppvObj)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+ULONG WINAPI
+Main_D3D_AddRef(LPDIRECT3D iface)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+ULONG WINAPI
+Main_D3D_Release(LPDIRECT3D iface)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+HRESULT WINAPI
+Main_D3D_Initialize(LPDIRECT3D iface, REFIID refiid)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+HRESULT WINAPI
+Main_D3D_EnumDevices(LPDIRECT3D iface, LPD3DENUMDEVICESCALLBACK Callback, LPVOID
Context)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+HRESULT WINAPI
+Main_D3D_CreateLight(LPDIRECT3D iface, LPDIRECT3DLIGHT* Light,IUnknown* pUnkOuter)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+HRESULT WINAPI
+Main_D3D_CreateMaterial(LPDIRECT3D iface,LPDIRECT3DMATERIAL* Direct3DLight,IUnknown*
pUnkOuter)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+HRESULT WINAPI
+Main_D3D_CreateViewport(LPDIRECT3D iface, LPDIRECT3DVIEWPORT* Viewport,IUnknown*
pUnkOuter)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
+HRESULT WINAPI
+Main_D3D_FindDevice(LPDIRECT3D iface, LPD3DFINDDEVICESEARCH D3DDFS, LPD3DFINDDEVICERESULT
D3DFDR)
+{
+ DX_WINDBG_trace();
+ DX_STUB;
+}
+
Propchange: trunk/reactos/dll/directx/ddraw/d3d/DirectD3D_main.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/directx/ddraw/ddraw.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/ddraw.rb…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/ddraw.rbuild (original)
+++ trunk/reactos/dll/directx/ddraw/ddraw.rbuild Thu Dec 13 15:31:05 2007
@@ -45,6 +45,9 @@
<directory name="Color">
<file>color_stubs.c</file>
</directory>
+ <directory name="d3d">
+ <file>DirectD3D_main.c</file>
+ </directory>
<directory name="Gamma">
<file>gamma_stubs.c</file>
</directory>
@@ -67,5 +70,6 @@
<file>DirectDrawSurface3_Vtable.c</file>
<file>DirectDrawSurface2_Vtable.c</file>
<file>DirectDrawSurface_Vtable.c</file>
+ <file>DirectD3D_Vtable.c</file>
</directory>
</module>
Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/rosdraw.h (original)
+++ trunk/reactos/dll/directx/ddraw/rosdraw.h Thu Dec 13 15:31:05 2007
@@ -38,6 +38,13 @@
extern IDirectDrawGammaControlVtbl DirectDrawGammaControl_Vtable;
extern IDirectDrawKernelVtbl DirectDrawKernel_Vtable;
extern IDirectDrawSurfaceKernelVtbl DirectDrawSurfaceKernel_Vtable;
+
+extern IDirect3DVtbl IDirect3D_Vtbl;
+/*
+extern IDirect3D2Vtbl IDirect3D2_Vtbl;
+extern IDirect3D3Vtbl IDirect3D3_Vtbl;
+extern IDirect3D7Vtbl IDirect3D7_Vtbl;
+*/
/* Start up direct hal or hel
* iface = a pointer to the com object