Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com>
---
dlls/ddraw/ddraw.c | 6 +++---
dlls/ddraw/ddraw_private.h | 3 ++-
dlls/ddraw/device.c | 12 +++++++-----
dlls/ddraw/surface.c | 2 +-
4 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index fde757b12ac..045d79b59c8 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -4358,7 +4358,7 @@ static HRESULT WINAPI d3d7_CreateDevice(IDirect3D7 *iface, REFCLSID riid,
TRACE("iface %p, riid %s, surface %p, device %p.\n", iface, debugstr_guid(riid), surface, device);
wined3d_mutex_lock();
- if (SUCCEEDED(hr = d3d_device_create(ddraw, target, (IUnknown *)surface, 7, &object, NULL)))
+ if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, target, (IUnknown *)surface, 7, &object, NULL)))
{
*device = &object->IDirect3DDevice7_iface;
}
@@ -4387,7 +4387,7 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid,
return CLASS_E_NOAGGREGATION;
wined3d_mutex_lock();
- if (SUCCEEDED(hr = d3d_device_create(ddraw, surface_impl, (IUnknown *)surface, 3, &device_impl, NULL)))
+ if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, surface_impl, (IUnknown *)surface, 3, &device_impl, NULL)))
{
*device = &device_impl->IDirect3DDevice3_iface;
}
@@ -4413,7 +4413,7 @@ static HRESULT WINAPI d3d2_CreateDevice(IDirect3D2 *iface, REFCLSID riid,
iface, debugstr_guid(riid), surface, device);
wined3d_mutex_lock();
- if (SUCCEEDED(hr = d3d_device_create(ddraw, surface_impl, (IUnknown *)surface, 2, &device_impl, NULL)))
+ if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, surface_impl, (IUnknown *)surface, 2, &device_impl, NULL)))
{
*device = &device_impl->IDirect3DDevice2_iface;
}
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
index e4ce918b189..f01468ce614 100644
--- a/dlls/ddraw/ddraw_private.h
+++ b/dlls/ddraw/ddraw_private.h
@@ -317,6 +317,7 @@ struct d3d_device
IUnknown IUnknown_inner;
LONG ref;
UINT version;
+ BOOL hardware_device;
IUnknown *outer_unknown;
struct wined3d_device *wined3d_device;
@@ -369,7 +370,7 @@ struct d3d_device
const struct wined3d_stateblock_state *stateblock_state;
};
-HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUnknown *rt_iface,
+HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface,
UINT version, struct d3d_device **device, IUnknown *outer_unknown) DECLSPEC_HIDDEN;
enum wined3d_depth_buffer_type d3d_device_update_depth_stencil(struct d3d_device *device) DECLSPEC_HIDDEN;
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 8c7004bd96e..f91404c89f6 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -6935,7 +6935,7 @@ static void ddraw_reset_viewport_state(struct ddraw *ddraw)
wined3d_stateblock_set_scissor_rect(ddraw->state, &rect);
}
-static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
+static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, const GUID *guid,
struct ddraw_surface *target, IUnknown *rt_iface, UINT version, IUnknown *outer_unknown)
{
static const struct wined3d_matrix ident =
@@ -6958,6 +6958,8 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
device->IUnknown_inner.lpVtbl = &d3d_device_inner_vtbl;
device->ref = 1;
device->version = version;
+ device->hardware_device = IsEqualGUID(&IID_IDirect3DTnLHalDevice, guid)
+ || IsEqualGUID(&IID_IDirect3DHALDevice, guid);
if (outer_unknown)
device->outer_unknown = outer_unknown;
@@ -7016,14 +7018,14 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw,
return D3D_OK;
}
-HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUnknown *rt_iface,
+HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface,
UINT version, struct d3d_device **device, IUnknown *outer_unknown)
{
struct d3d_device *object;
HRESULT hr;
- TRACE("ddraw %p, target %p, version %u, device %p, outer_unknown %p.\n",
- ddraw, target, version, device, outer_unknown);
+ TRACE("ddraw %p, guid %s, target %p, version %u, device %p, outer_unknown %p.\n",
+ ddraw, debugstr_guid(guid), target, version, device, outer_unknown);
if (!(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_3DDEVICE)
|| (target->surface_desc.ddsCaps.dwCaps & DDSCAPS_ZBUFFER))
@@ -7064,7 +7066,7 @@ HRESULT d3d_device_create(struct ddraw *ddraw, struct ddraw_surface *target, IUn
return DDERR_OUTOFMEMORY;
}
- if (FAILED(hr = d3d_device_init(object, ddraw, target, rt_iface, version, outer_unknown)))
+ if (FAILED(hr = d3d_device_init(object, ddraw, guid, target, rt_iface, version, outer_unknown)))
{
WARN("Failed to initialize device, hr %#x.\n", hr);
heap_free(object);
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 0ca19d4f8a5..b910fb6817e 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -256,7 +256,7 @@ static HRESULT WINAPI ddraw_surface7_QueryInterface(IDirectDrawSurface7 *iface,
{
HRESULT hr;
- if (FAILED(hr = d3d_device_create(This->ddraw, This, (IUnknown *)&This->IDirectDrawSurface_iface,
+ if (FAILED(hr = d3d_device_create(This->ddraw, riid, This, (IUnknown *)&This->IDirectDrawSurface_iface,
1, &This->device1, (IUnknown *)&This->IDirectDrawSurface_iface)))
{
This->device1 = NULL;
--
2.29.2