Commit f99a5481 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

dxgi: Update to IDXGIFactory2.

parent e0c7d903
...@@ -69,7 +69,7 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IDXGIAdapter1 *iface) ...@@ -69,7 +69,7 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IDXGIAdapter1 *iface)
if (!refcount) if (!refcount)
{ {
wined3d_private_store_cleanup(&adapter->private_store); wined3d_private_store_cleanup(&adapter->private_store);
IDXGIFactory1_Release(&adapter->factory->IDXGIFactory1_iface); IDXGIFactory2_Release(&adapter->factory->IDXGIFactory2_iface);
HeapFree(GetProcessHeap(), 0, adapter); HeapFree(GetProcessHeap(), 0, adapter);
} }
...@@ -112,7 +112,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IDXGIAdapter1 *iface, RE ...@@ -112,7 +112,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IDXGIAdapter1 *iface, RE
TRACE("iface %p, iid %s, parent %p.\n", iface, debugstr_guid(iid), parent); TRACE("iface %p, iid %s, parent %p.\n", iface, debugstr_guid(iid), parent);
return IDXGIFactory1_QueryInterface(&adapter->factory->IDXGIFactory1_iface, iid, parent); return IDXGIFactory2_QueryInterface(&adapter->factory->IDXGIFactory2_iface, iid, parent);
} }
static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IDXGIAdapter1 *iface, static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IDXGIAdapter1 *iface,
...@@ -273,7 +273,7 @@ static void dxgi_adapter_init(struct dxgi_adapter *adapter, struct dxgi_factory ...@@ -273,7 +273,7 @@ static void dxgi_adapter_init(struct dxgi_adapter *adapter, struct dxgi_factory
wined3d_private_store_init(&adapter->private_store); wined3d_private_store_init(&adapter->private_store);
adapter->ordinal = ordinal; adapter->ordinal = ordinal;
adapter->factory = factory; adapter->factory = factory;
IDXGIFactory1_AddRef(&adapter->factory->IDXGIFactory1_iface); IDXGIFactory2_AddRef(&adapter->factory->IDXGIFactory2_iface);
} }
HRESULT dxgi_adapter_create(struct dxgi_factory *factory, UINT ordinal, struct dxgi_adapter **adapter) HRESULT dxgi_adapter_create(struct dxgi_factory *factory, UINT ordinal, struct dxgi_adapter **adapter)
......
...@@ -374,7 +374,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l ...@@ -374,7 +374,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
void *layer_base; void *layer_base;
HRESULT hr; HRESULT hr;
if (!(dxgi_factory = unsafe_impl_from_IDXGIFactory1((IDXGIFactory1 *)factory))) if (!(dxgi_factory = unsafe_impl_from_IDXGIFactory2((IDXGIFactory2 *)factory)))
{ {
WARN("This is not the factory we're looking for.\n"); WARN("This is not the factory we're looking for.\n");
return E_FAIL; return E_FAIL;
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#ifdef DXGI_INIT_GUID #ifdef DXGI_INIT_GUID
#include "initguid.h" #include "initguid.h"
#endif #endif
#include "dxgi1_6.h"
#include "wine/wined3d.h" #include "wine/wined3d.h"
#include "wine/winedxgi.h" #include "wine/winedxgi.h"
...@@ -103,7 +104,7 @@ HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store, ...@@ -103,7 +104,7 @@ HRESULT dxgi_set_private_data_interface(struct wined3d_private_store *store,
/* IDXGIFactory */ /* IDXGIFactory */
struct dxgi_factory struct dxgi_factory
{ {
IDXGIFactory1 IDXGIFactory1_iface; IDXGIFactory2 IDXGIFactory2_iface;
LONG refcount; LONG refcount;
struct wined3d_private_store private_store; struct wined3d_private_store private_store;
struct wined3d *wined3d; struct wined3d *wined3d;
...@@ -113,7 +114,7 @@ struct dxgi_factory ...@@ -113,7 +114,7 @@ struct dxgi_factory
HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended) DECLSPEC_HIDDEN; HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended) DECLSPEC_HIDDEN;
HWND dxgi_factory_get_device_window(struct dxgi_factory *factory) DECLSPEC_HIDDEN; HWND dxgi_factory_get_device_window(struct dxgi_factory *factory) DECLSPEC_HIDDEN;
struct dxgi_factory *unsafe_impl_from_IDXGIFactory1(IDXGIFactory1 *iface) DECLSPEC_HIDDEN; struct dxgi_factory *unsafe_impl_from_IDXGIFactory2(IDXGIFactory2 *iface) DECLSPEC_HIDDEN;
/* IDXGIDevice */ /* IDXGIDevice */
struct dxgi_device struct dxgi_device
......
...@@ -24,18 +24,19 @@ ...@@ -24,18 +24,19 @@
WINE_DEFAULT_DEBUG_CHANNEL(dxgi); WINE_DEFAULT_DEBUG_CHANNEL(dxgi);
static inline struct dxgi_factory *impl_from_IDXGIFactory1(IDXGIFactory1 *iface) static inline struct dxgi_factory *impl_from_IDXGIFactory2(IDXGIFactory2 *iface)
{ {
return CONTAINING_RECORD(iface, struct dxgi_factory, IDXGIFactory1_iface); return CONTAINING_RECORD(iface, struct dxgi_factory, IDXGIFactory2_iface);
} }
static HRESULT STDMETHODCALLTYPE dxgi_factory_QueryInterface(IDXGIFactory1 *iface, REFIID iid, void **out) static HRESULT STDMETHODCALLTYPE dxgi_factory_QueryInterface(IDXGIFactory2 *iface, REFIID iid, void **out)
{ {
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface); struct dxgi_factory *factory = impl_from_IDXGIFactory2(iface);
TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
if ((factory->extended && IsEqualGUID(iid, &IID_IDXGIFactory1)) if (IsEqualGUID(iid, &IID_IDXGIFactory2)
|| (factory->extended && IsEqualGUID(iid, &IID_IDXGIFactory1))
|| IsEqualGUID(iid, &IID_IDXGIFactory) || IsEqualGUID(iid, &IID_IDXGIFactory)
|| IsEqualGUID(iid, &IID_IDXGIObject) || IsEqualGUID(iid, &IID_IDXGIObject)
|| IsEqualGUID(iid, &IID_IUnknown)) || IsEqualGUID(iid, &IID_IUnknown))
...@@ -51,9 +52,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_QueryInterface(IDXGIFactory1 *ifac ...@@ -51,9 +52,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_QueryInterface(IDXGIFactory1 *ifac
return E_NOINTERFACE; return E_NOINTERFACE;
} }
static ULONG STDMETHODCALLTYPE dxgi_factory_AddRef(IDXGIFactory1 *iface) static ULONG STDMETHODCALLTYPE dxgi_factory_AddRef(IDXGIFactory2 *iface)
{ {
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface); struct dxgi_factory *factory = impl_from_IDXGIFactory2(iface);
ULONG refcount = InterlockedIncrement(&factory->refcount); ULONG refcount = InterlockedIncrement(&factory->refcount);
TRACE("%p increasing refcount to %u.\n", iface, refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount);
...@@ -61,9 +62,9 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_AddRef(IDXGIFactory1 *iface) ...@@ -61,9 +62,9 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_AddRef(IDXGIFactory1 *iface)
return refcount; return refcount;
} }
static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IDXGIFactory1 *iface) static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IDXGIFactory2 *iface)
{ {
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface); struct dxgi_factory *factory = impl_from_IDXGIFactory2(iface);
ULONG refcount = InterlockedDecrement(&factory->refcount); ULONG refcount = InterlockedDecrement(&factory->refcount);
TRACE("%p decreasing refcount to %u.\n", iface, refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount);
...@@ -83,37 +84,37 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IDXGIFactory1 *iface) ...@@ -83,37 +84,37 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IDXGIFactory1 *iface)
return refcount; return refcount;
} }
static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateData(IDXGIFactory1 *iface, static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateData(IDXGIFactory2 *iface,
REFGUID guid, UINT data_size, const void *data) REFGUID guid, UINT data_size, const void *data)
{ {
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface); struct dxgi_factory *factory = impl_from_IDXGIFactory2(iface);
TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data);
return dxgi_set_private_data(&factory->private_store, guid, data_size, data); return dxgi_set_private_data(&factory->private_store, guid, data_size, data);
} }
static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateDataInterface(IDXGIFactory1 *iface, static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateDataInterface(IDXGIFactory2 *iface,
REFGUID guid, const IUnknown *object) REFGUID guid, const IUnknown *object)
{ {
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface); struct dxgi_factory *factory = impl_from_IDXGIFactory2(iface);
TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object); TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object);
return dxgi_set_private_data_interface(&factory->private_store, guid, object); return dxgi_set_private_data_interface(&factory->private_store, guid, object);
} }
static HRESULT STDMETHODCALLTYPE dxgi_factory_GetPrivateData(IDXGIFactory1 *iface, static HRESULT STDMETHODCALLTYPE dxgi_factory_GetPrivateData(IDXGIFactory2 *iface,
REFGUID guid, UINT *data_size, void *data) REFGUID guid, UINT *data_size, void *data)
{ {
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface); struct dxgi_factory *factory = impl_from_IDXGIFactory2(iface);
TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data);
return dxgi_get_private_data(&factory->private_store, guid, data_size, data); return dxgi_get_private_data(&factory->private_store, guid, data_size, data);
} }
static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IDXGIFactory1 *iface, REFIID iid, void **parent) static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IDXGIFactory2 *iface, REFIID iid, void **parent)
{ {
WARN("iface %p, iid %s, parent %p.\n", iface, debugstr_guid(iid), parent); WARN("iface %p, iid %s, parent %p.\n", iface, debugstr_guid(iid), parent);
...@@ -122,10 +123,10 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IDXGIFactory1 *iface, RE ...@@ -122,10 +123,10 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IDXGIFactory1 *iface, RE
return E_NOINTERFACE; return E_NOINTERFACE;
} }
static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters1(IDXGIFactory1 *iface, static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters1(IDXGIFactory2 *iface,
UINT adapter_idx, IDXGIAdapter1 **adapter) UINT adapter_idx, IDXGIAdapter1 **adapter)
{ {
struct dxgi_factory *factory = impl_from_IDXGIFactory1(iface); struct dxgi_factory *factory = impl_from_IDXGIFactory2(iface);
struct dxgi_adapter *adapter_object; struct dxgi_adapter *adapter_object;
UINT adapter_count; UINT adapter_count;
HRESULT hr; HRESULT hr;
...@@ -158,7 +159,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters1(IDXGIFactory1 *iface ...@@ -158,7 +159,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters1(IDXGIFactory1 *iface
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IDXGIFactory1 *iface, static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IDXGIFactory2 *iface,
UINT adapter_idx, IDXGIAdapter **adapter) UINT adapter_idx, IDXGIAdapter **adapter)
{ {
TRACE("iface %p, adapter_idx %u, adapter %p.\n", iface, adapter_idx, adapter); TRACE("iface %p, adapter_idx %u, adapter %p.\n", iface, adapter_idx, adapter);
...@@ -166,21 +167,21 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IDXGIFactory1 *iface, ...@@ -166,21 +167,21 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IDXGIFactory1 *iface,
return dxgi_factory_EnumAdapters1(iface, adapter_idx, (IDXGIAdapter1 **)adapter); return dxgi_factory_EnumAdapters1(iface, adapter_idx, (IDXGIAdapter1 **)adapter);
} }
static HRESULT STDMETHODCALLTYPE dxgi_factory_MakeWindowAssociation(IDXGIFactory1 *iface, HWND window, UINT flags) static HRESULT STDMETHODCALLTYPE dxgi_factory_MakeWindowAssociation(IDXGIFactory2 *iface, HWND window, UINT flags)
{ {
FIXME("iface %p, window %p, flags %#x stub!\n", iface, window, flags); FIXME("iface %p, window %p, flags %#x stub!\n", iface, window, flags);
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE dxgi_factory_GetWindowAssociation(IDXGIFactory1 *iface, HWND *window) static HRESULT STDMETHODCALLTYPE dxgi_factory_GetWindowAssociation(IDXGIFactory2 *iface, HWND *window)
{ {
FIXME("iface %p, window %p stub!\n", iface, window); FIXME("iface %p, window %p stub!\n", iface, window);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IDXGIFactory1 *iface, static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IDXGIFactory2 *iface,
IUnknown *device, DXGI_SWAP_CHAIN_DESC *desc, IDXGISwapChain **swapchain) IUnknown *device, DXGI_SWAP_CHAIN_DESC *desc, IDXGISwapChain **swapchain)
{ {
struct wined3d_swapchain *wined3d_swapchain; struct wined3d_swapchain *wined3d_swapchain;
...@@ -258,7 +259,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IDXGIFactory1 *ifa ...@@ -258,7 +259,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IDXGIFactory1 *ifa
return S_OK; return S_OK;
} }
static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSoftwareAdapter(IDXGIFactory1 *iface, static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSoftwareAdapter(IDXGIFactory2 *iface,
HMODULE swrast, IDXGIAdapter **adapter) HMODULE swrast, IDXGIAdapter **adapter)
{ {
FIXME("iface %p, swrast %p, adapter %p stub!\n", iface, swrast, adapter); FIXME("iface %p, swrast %p, adapter %p stub!\n", iface, swrast, adapter);
...@@ -266,14 +267,104 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSoftwareAdapter(IDXGIFactory ...@@ -266,14 +267,104 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSoftwareAdapter(IDXGIFactory
return E_NOTIMPL; return E_NOTIMPL;
} }
static BOOL STDMETHODCALLTYPE dxgi_factory_IsCurrent(IDXGIFactory1 *iface) static BOOL STDMETHODCALLTYPE dxgi_factory_IsCurrent(IDXGIFactory2 *iface)
{ {
FIXME("iface %p stub!\n", iface); FIXME("iface %p stub!\n", iface);
return TRUE; return TRUE;
} }
static const struct IDXGIFactory1Vtbl dxgi_factory_vtbl = static BOOL STDMETHODCALLTYPE dxgi_factory_IsWindowedStereoEnabled(IDXGIFactory2 *iface)
{
FIXME("iface %p stub!\n", iface);
return FALSE;
}
static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChainForHwnd(IDXGIFactory2 *iface,
IUnknown *device, HWND window, const DXGI_SWAP_CHAIN_DESC1 *swapchain_desc,
const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *fullscreen_desc,
IDXGIOutput *output, IDXGISwapChain1 **swapchain)
{
FIXME("iface %p, device %p, window %p, swapchain_desc %p, fullscreen_desc %p, "
"output %p, swapchain %p stub!\n",
iface, device, window, swapchain_desc, fullscreen_desc, output, swapchain);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChainForCoreWindow(IDXGIFactory2 *iface,
IUnknown *device, IUnknown *window, const DXGI_SWAP_CHAIN_DESC1 *desc,
IDXGIOutput *output, IDXGISwapChain1 **swapchain)
{
FIXME("iface %p, device %p, window %p, desc %p, output %p, swapchain %p stub!\n",
iface, device, window, desc, output, swapchain);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE dxgi_factory_GetSharedResourceAdapterLuid(IDXGIFactory2 *iface,
HANDLE resource, LUID *luid)
{
FIXME("iface %p, resource %p, luid %p stub!\n", iface, resource, luid);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE dxgi_factory_RegisterOcclusionStatusWindow(IDXGIFactory2 *iface,
HWND window, UINT message, DWORD *cookie)
{
FIXME("iface %p, window %p, message %#x, cookie %p stub!\n",
iface, window, message, cookie);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE dxgi_factory_RegisterStereoStatusEvent(IDXGIFactory2 *iface,
HANDLE event, DWORD *cookie)
{
FIXME("iface %p, event %p, cookie %p stub!\n", iface, event, cookie);
return E_NOTIMPL;
}
static void STDMETHODCALLTYPE dxgi_factory_UnregisterStereoStatus(IDXGIFactory2 *iface, DWORD cookie)
{
FIXME("iface %p, cookie %#x stub!n", iface, cookie);
}
static HRESULT STDMETHODCALLTYPE dxgi_factory_RegisterStereoStatusWindow(IDXGIFactory2 *iface,
HWND window, UINT message, DWORD *cookie)
{
FIXME("iface %p, window %p, message %#x, cookie %p stub!\n",
iface, window, message, cookie);
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE dxgi_factory_RegisterOcclusionStatusEvent(IDXGIFactory2 *iface,
HANDLE event, DWORD *cookie)
{
FIXME("iface %p, event %p, cookie %p stub!\n", iface, event, cookie);
return E_NOTIMPL;
}
static void STDMETHODCALLTYPE dxgi_factory_UnregisterOcclusionStatus(IDXGIFactory2 *iface, DWORD cookie)
{
FIXME("iface %p, cookie %#x stub!\n", iface, cookie);
}
static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChainForComposition(IDXGIFactory2 *iface,
IUnknown *device, const DXGI_SWAP_CHAIN_DESC1 *desc, IDXGIOutput *output, IDXGISwapChain1 **swapchain)
{
FIXME("iface %p, device %p, desc %p, output %p, swapchain %p stub!\n",
iface, device, desc, output, swapchain);
return E_NOTIMPL;
}
static const struct IDXGIFactory2Vtbl dxgi_factory_vtbl =
{ {
dxgi_factory_QueryInterface, dxgi_factory_QueryInterface,
dxgi_factory_AddRef, dxgi_factory_AddRef,
...@@ -287,21 +378,34 @@ static const struct IDXGIFactory1Vtbl dxgi_factory_vtbl = ...@@ -287,21 +378,34 @@ static const struct IDXGIFactory1Vtbl dxgi_factory_vtbl =
dxgi_factory_GetWindowAssociation, dxgi_factory_GetWindowAssociation,
dxgi_factory_CreateSwapChain, dxgi_factory_CreateSwapChain,
dxgi_factory_CreateSoftwareAdapter, dxgi_factory_CreateSoftwareAdapter,
/* IDXGIFactory1 methods */
dxgi_factory_EnumAdapters1, dxgi_factory_EnumAdapters1,
dxgi_factory_IsCurrent, dxgi_factory_IsCurrent,
/* IDXGIFactory2 methods */
dxgi_factory_IsWindowedStereoEnabled,
dxgi_factory_CreateSwapChainForHwnd,
dxgi_factory_CreateSwapChainForCoreWindow,
dxgi_factory_GetSharedResourceAdapterLuid,
dxgi_factory_RegisterOcclusionStatusWindow,
dxgi_factory_RegisterStereoStatusEvent,
dxgi_factory_UnregisterStereoStatus,
dxgi_factory_RegisterStereoStatusWindow,
dxgi_factory_RegisterOcclusionStatusEvent,
dxgi_factory_UnregisterOcclusionStatus,
dxgi_factory_CreateSwapChainForComposition,
}; };
struct dxgi_factory *unsafe_impl_from_IDXGIFactory1(IDXGIFactory1 *iface) struct dxgi_factory *unsafe_impl_from_IDXGIFactory2(IDXGIFactory2 *iface)
{ {
if (!iface) if (!iface)
return NULL; return NULL;
assert(iface->lpVtbl == &dxgi_factory_vtbl); assert(iface->lpVtbl == &dxgi_factory_vtbl);
return CONTAINING_RECORD(iface, struct dxgi_factory, IDXGIFactory1_iface); return CONTAINING_RECORD(iface, struct dxgi_factory, IDXGIFactory2_iface);
} }
static HRESULT dxgi_factory_init(struct dxgi_factory *factory, BOOL extended) static HRESULT dxgi_factory_init(struct dxgi_factory *factory, BOOL extended)
{ {
factory->IDXGIFactory1_iface.lpVtbl = &dxgi_factory_vtbl; factory->IDXGIFactory2_iface.lpVtbl = &dxgi_factory_vtbl;
factory->refcount = 1; factory->refcount = 1;
wined3d_private_store_init(&factory->private_store); wined3d_private_store_init(&factory->private_store);
...@@ -336,9 +440,8 @@ HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended) ...@@ -336,9 +440,8 @@ HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended)
TRACE("Created factory %p.\n", object); TRACE("Created factory %p.\n", object);
hr = IDXGIFactory1_QueryInterface(&object->IDXGIFactory1_iface, riid, factory); hr = IDXGIFactory2_QueryInterface(&object->IDXGIFactory2_iface, riid, factory);
IDXGIFactory1_Release(&object->IDXGIFactory1_iface); IDXGIFactory2_Release(&object->IDXGIFactory2_iface);
return hr; return hr;
} }
......
...@@ -2337,7 +2337,6 @@ static void test_create_factory(void) ...@@ -2337,7 +2337,6 @@ static void test_create_factory(void)
iface = NULL; iface = NULL;
hr = CreateDXGIFactory(&IID_IDXGIFactory2, (void **)&iface); hr = CreateDXGIFactory(&IID_IDXGIFactory2, (void **)&iface);
todo_wine
ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
"Got unexpected hr %#x.\n", hr); "Got unexpected hr %#x.\n", hr);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
...@@ -2378,7 +2377,6 @@ static void test_create_factory(void) ...@@ -2378,7 +2377,6 @@ static void test_create_factory(void)
iface = NULL; iface = NULL;
hr = pCreateDXGIFactory1(&IID_IDXGIFactory2, (void **)&iface); hr = pCreateDXGIFactory1(&IID_IDXGIFactory2, (void **)&iface);
todo_wine
ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
"Got unexpected hr %#x.\n", hr); "Got unexpected hr %#x.\n", hr);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment