Instead of using D3D11CoreCreateDevice.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d3d10core/Makefile.in | 2 +- dlls/d3d10core/d3d10core_main.c | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/dlls/d3d10core/Makefile.in b/dlls/d3d10core/Makefile.in index cf7efb274189..e56e38c188c2 100644 --- a/dlls/d3d10core/Makefile.in +++ b/dlls/d3d10core/Makefile.in @@ -1,6 +1,6 @@ MODULE = d3d10core.dll IMPORTLIB = d3d10core -IMPORTS = d3d11 +IMPORTS = d3d11 dxgi
EXTRADLLFLAGS = -mno-cygwin
diff --git a/dlls/d3d10core/d3d10core_main.c b/dlls/d3d10core/d3d10core_main.c index 5a9a4a211c15..ce3cf7860657 100644 --- a/dlls/d3d10core/d3d10core_main.c +++ b/dlls/d3d10core/d3d10core_main.c @@ -22,12 +22,12 @@ #include "initguid.h"
#define COBJMACROS -#include "d3d11.h" +#include "d3d10.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3d10core);
-HRESULT WINAPI D3D11CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, unsigned int flags, - const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count, ID3D11Device **device); +HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, IDXGIAdapter *adapter, + unsigned int flags, const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count, void **device);
HRESULT WINAPI D3D11CoreRegisterLayers(void);
@@ -41,20 +41,26 @@ HRESULT WINAPI D3D10CoreRegisterLayers(void) HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, unsigned int flags, D3D_FEATURE_LEVEL feature_level, ID3D10Device **device) { - ID3D11Device *device11; + IUnknown *dxgi_device; + HMODULE d3d10core; HRESULT hr;
TRACE("factory %p, adapter %p, flags %#x, feature_level %#x, device %p.\n", factory, adapter, flags, feature_level, device);
- if (FAILED(hr = D3D11CoreCreateDevice(factory, adapter, flags, &feature_level, 1, &device11))) + d3d10core = GetModuleHandleA("d3d10core.dll"); + hr = DXGID3D10CreateDevice(d3d10core, factory, adapter, flags, &feature_level, 1, (void **)&dxgi_device); + if (FAILED(hr)) + { + WARN("Failed to create device, returning %#x.\n", hr); return hr; + }
- hr = ID3D11Device_QueryInterface(device11, &IID_ID3D10Device, (void **)device); - ID3D11Device_Release(device11); + hr = IUnknown_QueryInterface(dxgi_device, &IID_ID3D10Device, (void **)device); + IUnknown_Release(dxgi_device); if (FAILED(hr)) { - ERR("Device should implement ID3D10Device, returning E_FAIL.\n"); + ERR("Failed to query ID3D10Device interface, returning E_FAIL.\n"); return E_FAIL; }