Add D3D COM to ddraw (dx1)

svn path=/trunk/; revision=31191
This commit is contained in:
Magnus Olsen 2007-12-13 12:31:05 +00:00
parent 741e32d84d
commit 6cc6acf265
5 changed files with 140 additions and 3 deletions

View file

@ -145,7 +145,7 @@ Main_DDrawSurface_QueryInterface(LPDDRAWI_DDRAWSURFACE_INT This, REFIID riid, LP
}
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 @@ Main_DDrawSurface_QueryInterface(LPDDRAWI_DDRAWSURFACE_INT This, REFIID riid, LP
}
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 @@ Main_DDrawSurface_QueryInterface(LPDDRAWI_DDRAWSURFACE_INT This, REFIID riid, LP
}
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 @@ Main_DDrawSurface_QueryInterface(LPDDRAWI_DDRAWSURFACE_INT This, REFIID riid, LP
*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");

View file

@ -0,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
};

View file

@ -0,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;
}

View file

@ -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>

View file

@ -39,6 +39,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
* pGUID = guid hardware acclations or software acclation this can be NULL