d3d11: add a stub for D3D11CreateDevice

Austin English austinenglish at gmail.com
Tue Feb 12 17:47:56 CST 2013


It's enough for EVE Online to run without disabling D3D11. Fixes
http://bugs.winehq.org/show_bug.cgi?id=32520

-- 
-Austin
-------------- next part --------------
From 9d34f40f63c1c484f6462348952c52f46a2afccc Mon Sep 17 00:00:00 2001
From: Austin English <austinenglish at gmail.com>
Date: Tue, 12 Feb 2013 15:44:15 -0800
Subject: [PATCH] d3d11: add stub D3D11CreateDevice

---
 dlls/d3d11/Makefile.in  |    3 ++
 dlls/d3d11/d3d11.spec   |    2 +-
 dlls/d3d11/d3d11_main.c |   71 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 75 insertions(+), 1 deletions(-)
 create mode 100644 dlls/d3d11/d3d11_main.c

diff --git a/dlls/d3d11/Makefile.in b/dlls/d3d11/Makefile.in
index ef3c5a0..da7bbe6 100644
--- a/dlls/d3d11/Makefile.in
+++ b/dlls/d3d11/Makefile.in
@@ -1,3 +1,6 @@
 MODULE    = d3d11.dll
 
+C_SRCS = \
+	d3d11_main.c
+
 @MAKE_DLL_RULES@
diff --git a/dlls/d3d11/d3d11.spec b/dlls/d3d11/d3d11.spec
index 0ff00d2..ffe0712 100644
--- a/dlls/d3d11/d3d11.spec
+++ b/dlls/d3d11/d3d11.spec
@@ -2,7 +2,7 @@
 @ stub D3D11CoreCreateLayeredDevice
 @ stub D3D11CoreGetLayeredDeviceSize
 @ stub D3D11CoreRegisterLayers
-@ stub D3D11CreateDevice
+@ stdcall D3D11CreateDevice(ptr long ptr long long long long ptr ptr ptr)
 @ stub D3D11CreateDeviceAndSwapChain
 @ stub D3DKMTCloseAdapter
 @ stub D3DKMTCreateAllocation
diff --git a/dlls/d3d11/d3d11_main.c b/dlls/d3d11/d3d11_main.c
new file mode 100644
index 0000000..298b4fc
--- /dev/null
+++ b/dlls/d3d11/d3d11_main.c
@@ -0,0 +1,71 @@
+/*
+ * Direct3D 11
+ *
+ * Copyright 2013 Austin English
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+
+#include <stdarg.h>
+
+#include "d3d11.h"
+
+#include "windef.h"
+#include "winbase.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(d3d11);
+
+/* At process attach */
+BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
+{
+    TRACE("fdwReason=%d\n", fdwReason);
+    switch(fdwReason)
+    {
+    case DLL_PROCESS_ATTACH:
+        DisableThreadLibraryCalls( hInstDLL );
+        break;
+    }
+    return TRUE;
+}
+
+#define WINE_D3D11_TO_STR(x) case x: return #x
+
+const char *debug_d3d_driver_type(D3D_DRIVER_TYPE driver_type)
+{
+    switch(driver_type)
+    {
+        WINE_D3D11_TO_STR(D3D_DRIVER_TYPE_UNKNOWN);
+        WINE_D3D11_TO_STR(D3D_DRIVER_TYPE_HARDWARE);
+        WINE_D3D11_TO_STR(D3D_DRIVER_TYPE_REFERENCE);
+        WINE_D3D11_TO_STR(D3D_DRIVER_TYPE_NULL);
+        WINE_D3D11_TO_STR(D3D_DRIVER_TYPE_SOFTWARE);
+        WINE_D3D11_TO_STR(D3D_DRIVER_TYPE_WARP);
+        default:
+            FIXME("Unrecognized D3D_DRIVER_TYPE %#x\n", driver_type);
+            return "unrecognized";
+    }
+}
+
+HRESULT WINAPI D3D11CreateDevice(IDXGIAdapter *adapter, D3D_DRIVER_TYPE driver_type, HMODULE swrast, UINT flags,
+                                 const D3D_FEATURE_LEVEL feature_levels, UINT levels, UINT sdk_version,
+                                 ID3D11Device **device, D3D_FEATURE_LEVEL *feature_level, ID3D11DeviceContext **context)
+{
+    FIXME("stub: adapter %p, driver_type %s, swrast %p, flags %#x, feature_levels %d, levels %#x, sdk_version %d, " \
+          "device %p, feature_level %p, context %p\n", adapter, debug_d3d_driver_type(driver_type), swrast, \
+	   flags, feature_levels, levels, sdk_version, device, feature_level, context);
+    return E_OUTOFMEMORY;
+}
-- 
1.7.8.6


More information about the wine-patches mailing list