d3drm: Change signature of d3drm_device_create.

This commit is contained in:
Aaryaman Vasishta 2015-08-07 03:17:51 +05:30 committed by Alexandre Julliard
parent 4335c464c3
commit f421e78bc5
3 changed files with 136 additions and 22 deletions

View File

@ -231,37 +231,69 @@ static HRESULT WINAPI d3drm1_CreateMaterial(IDirect3DRM *iface,
static HRESULT WINAPI d3drm1_CreateDevice(IDirect3DRM *iface,
DWORD width, DWORD height, IDirect3DRMDevice **device)
{
struct d3drm_device *object;
HRESULT hr;
FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface, width, height, device);
return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown **)device);
hr = d3drm_device_create(&object);
if (FAILED(hr))
return hr;
*device = IDirect3DRMDevice_from_impl(object);
return D3DRM_OK;
}
static HRESULT WINAPI d3drm1_CreateDeviceFromSurface(IDirect3DRM *iface, GUID *guid,
IDirectDraw *ddraw, IDirectDrawSurface *backbuffer, IDirect3DRMDevice **device)
{
struct d3drm_device *object;
HRESULT hr;
FIXME("iface %p, guid %s, ddraw %p, backbuffer %p, device %p partial stub.\n",
iface, debugstr_guid(guid), ddraw, backbuffer, device);
return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown **)device);
hr = d3drm_device_create(&object);
if (FAILED(hr))
return hr;
*device = IDirect3DRMDevice_from_impl(object);
return D3DRM_OK;
}
static HRESULT WINAPI d3drm1_CreateDeviceFromD3D(IDirect3DRM *iface,
IDirect3D *d3d, IDirect3DDevice *d3d_device, IDirect3DRMDevice **device)
{
struct d3drm_device *object;
HRESULT hr;
FIXME("iface %p, d3d %p, d3d_device %p, device %p partial stub.\n",
iface, d3d, d3d_device, device);
return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown **)device);
hr = d3drm_device_create(&object);
if (FAILED(hr))
return hr;
*device = IDirect3DRMDevice_from_impl(object);
return D3DRM_OK;
}
static HRESULT WINAPI d3drm1_CreateDeviceFromClipper(IDirect3DRM *iface,
IDirectDrawClipper *clipper, GUID *guid, int width, int height,
IDirect3DRMDevice **device)
{
struct d3drm_device *object;
HRESULT hr;
FIXME("iface %p, clipper %p, guid %s, width %d, height %d, device %p.\n",
iface, clipper, debugstr_guid(guid), width, height, device);
return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown **)device);
hr = d3drm_device_create(&object);
if (FAILED(hr))
return hr;
*device = IDirect3DRMDevice_from_impl(object);
return D3DRM_OK;
}
static HRESULT WINAPI d3drm1_CreateTextureFromSurface(IDirect3DRM *iface,
@ -583,37 +615,69 @@ static HRESULT WINAPI d3drm2_CreateMaterial(IDirect3DRM2 *iface,
static HRESULT WINAPI d3drm2_CreateDevice(IDirect3DRM2 *iface,
DWORD width, DWORD height, IDirect3DRMDevice2 **device)
{
FIXME("iface %p, width %u, height %u, device %p.\n", iface, width, height, device);
struct d3drm_device *object;
HRESULT hr;
FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface, width, height, device);
return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown **)device);
hr = d3drm_device_create(&object);
if (FAILED(hr))
return hr;
*device = IDirect3DRMDevice2_from_impl(object);
return D3DRM_OK;
}
static HRESULT WINAPI d3drm2_CreateDeviceFromSurface(IDirect3DRM2 *iface, GUID *guid,
IDirectDraw *ddraw, IDirectDrawSurface *backbuffer, IDirect3DRMDevice2 **device)
{
struct d3drm_device *object;
HRESULT hr;
FIXME("iface %p, guid %s, ddraw %p, backbuffer %p, device %p partial stub.\n",
iface, debugstr_guid(guid), ddraw, backbuffer, device);
return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown **)device);
hr = d3drm_device_create(&object);
if (FAILED(hr))
return hr;
*device = IDirect3DRMDevice2_from_impl(object);
return D3DRM_OK;
}
static HRESULT WINAPI d3drm2_CreateDeviceFromD3D(IDirect3DRM2 *iface,
IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device, IDirect3DRMDevice2 **device)
{
struct d3drm_device *object;
HRESULT hr;
FIXME("iface %p, d3d %p, d3d_device %p, device %p partial stub.\n",
iface, d3d, d3d_device, device);
return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown **)device);
hr = d3drm_device_create(&object);
if (FAILED(hr))
return hr;
*device = IDirect3DRMDevice2_from_impl(object);
return D3DRM_OK;
}
static HRESULT WINAPI d3drm2_CreateDeviceFromClipper(IDirect3DRM2 *iface,
IDirectDrawClipper *clipper, GUID *guid, int width, int height,
IDirect3DRMDevice2 **device)
{
FIXME("iface %p, clipper %p, guid %s, width %d, height %d, device %p partial stub.\n",
struct d3drm_device *object;
HRESULT hr;
FIXME("iface %p, clipper %p, guid %s, width %d, height %d, device %p.\n",
iface, clipper, debugstr_guid(guid), width, height, device);
return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown **)device);
hr = d3drm_device_create(&object);
if (FAILED(hr))
return hr;
*device = IDirect3DRMDevice2_from_impl(object);
return D3DRM_OK;
}
static HRESULT WINAPI d3drm2_CreateTextureFromSurface(IDirect3DRM2 *iface,
@ -957,37 +1021,69 @@ static HRESULT WINAPI d3drm3_CreateMaterial(IDirect3DRM3 *iface,
static HRESULT WINAPI d3drm3_CreateDevice(IDirect3DRM3 *iface,
DWORD width, DWORD height, IDirect3DRMDevice3 **device)
{
struct d3drm_device *object;
HRESULT hr;
FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface, width, height, device);
return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown **)device);
hr = d3drm_device_create(&object);
if (FAILED(hr))
return hr;
*device = IDirect3DRMDevice3_from_impl(object);
return D3DRM_OK;
}
static HRESULT WINAPI d3drm3_CreateDeviceFromSurface(IDirect3DRM3 *iface, GUID *guid,
IDirectDraw *ddraw, IDirectDrawSurface *backbuffer, DWORD flags, IDirect3DRMDevice3 **device)
{
struct d3drm_device *object;
HRESULT hr;
FIXME("iface %p, guid %s, ddraw %p, backbuffer %p, flags %#x, device %p partial stub.\n",
iface, debugstr_guid(guid), ddraw, backbuffer, flags, device);
return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown **)device);
hr = d3drm_device_create(&object);
if (FAILED(hr))
return hr;
*device = IDirect3DRMDevice3_from_impl(object);
return D3DRM_OK;
}
static HRESULT WINAPI d3drm3_CreateDeviceFromD3D(IDirect3DRM3 *iface,
IDirect3D2 *d3d, IDirect3DDevice2 *d3d_device, IDirect3DRMDevice3 **device)
{
struct d3drm_device *object;
HRESULT hr;
FIXME("iface %p, d3d %p, d3d_device %p, device %p partial stub.\n",
iface, d3d, d3d_device, device);
return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown **)device);
hr = d3drm_device_create(&object);
if (FAILED(hr))
return hr;
*device = IDirect3DRMDevice3_from_impl(object);
return D3DRM_OK;
}
static HRESULT WINAPI d3drm3_CreateDeviceFromClipper(IDirect3DRM3 *iface,
IDirectDrawClipper *clipper, GUID *guid, int width, int height,
IDirect3DRMDevice3 **device)
{
FIXME("iface %p, clipper %p, guid %s, width %d, height %d, device %p partial stub.\n",
struct d3drm_device *object;
HRESULT hr;
FIXME("iface %p, clipper %p, guid %s, width %d, height %d, device %p.\n",
iface, clipper, debugstr_guid(guid), width, height, device);
return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown **)device);
hr = d3drm_device_create(&object);
if (FAILED(hr))
return hr;
*device = IDirect3DRMDevice3_from_impl(object);
return D3DRM_OK;
}
static HRESULT WINAPI d3drm3_CreateShadow(IDirect3DRM3 *iface, IUnknown *object, IDirect3DRMLight *light,

View File

@ -24,7 +24,12 @@
#include "d3drm.h"
#include "dxfile.h"
HRESULT Direct3DRMDevice_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN;
struct d3drm_device;
HRESULT d3drm_device_create(struct d3drm_device **out) DECLSPEC_HIDDEN;
IDirect3DRMDevice *IDirect3DRMDevice_from_impl(struct d3drm_device *device) DECLSPEC_HIDDEN;
IDirect3DRMDevice2 *IDirect3DRMDevice2_from_impl(struct d3drm_device *device) DECLSPEC_HIDDEN;
IDirect3DRMDevice3 *IDirect3DRMDevice3_from_impl(struct d3drm_device *device) DECLSPEC_HIDDEN;
HRESULT Direct3DRMFace_create(REFIID riid, IUnknown** ret_iface) DECLSPEC_HIDDEN;
HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown* parent_frame, IUnknown** ret_iface) DECLSPEC_HIDDEN;
HRESULT Direct3DRMLight_create(IUnknown** ppObj) DECLSPEC_HIDDEN;

View File

@ -60,6 +60,21 @@ static inline struct d3drm_device *impl_from_IDirect3DRMDevice3(IDirect3DRMDevic
return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMDevice3_iface);
}
IDirect3DRMDevice *IDirect3DRMDevice_from_impl(struct d3drm_device *device)
{
return &device->IDirect3DRMDevice_iface;
}
IDirect3DRMDevice2 *IDirect3DRMDevice2_from_impl(struct d3drm_device *device)
{
return &device->IDirect3DRMDevice2_iface;
}
IDirect3DRMDevice3 *IDirect3DRMDevice3_from_impl(struct d3drm_device *device)
{
return &device->IDirect3DRMDevice3_iface;
}
static inline struct d3drm_device *impl_from_IDirect3DRMWinDevice(IDirect3DRMWinDevice *iface)
{
return CONTAINING_RECORD(iface, struct d3drm_device, IDirect3DRMWinDevice_iface);
@ -1381,12 +1396,11 @@ static const struct IDirect3DRMWinDeviceVtbl d3drm_device_win_vtbl =
d3drm_device_win_HandleActivate,
};
HRESULT Direct3DRMDevice_create(REFIID riid, IUnknown **out)
HRESULT d3drm_device_create(struct d3drm_device **out)
{
struct d3drm_device *object;
HRESULT hr;
TRACE("riid %s, out %p.\n", debugstr_guid(riid), out);
TRACE("out %p.\n", out);
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
return E_OUTOFMEMORY;
@ -1397,8 +1411,7 @@ HRESULT Direct3DRMDevice_create(REFIID riid, IUnknown **out)
object->IDirect3DRMWinDevice_iface.lpVtbl = &d3drm_device_win_vtbl;
object->ref = 1;
hr = IDirect3DRMDevice_QueryInterface(&object->IDirect3DRMDevice3_iface, riid, (void **)out);
IDirect3DRMDevice3_Release(&object->IDirect3DRMDevice3_iface);
*out = object;
return hr;
return D3DRM_OK;
}