From 522bff38d261a682e25ad42d36cbc4dff19e7275 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 2 Oct 2017 05:27:55 +0200
Subject: nvcuda: Add semi stub for cuD3D10GetDevice.

---
 dlls/nvcuda/nvcuda.c    | 8 ++++++++
 dlls/nvcuda/nvcuda.spec | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/dlls/nvcuda/nvcuda.c b/dlls/nvcuda/nvcuda.c
index 99fcacf561e..219567abe1f 100644
--- a/dlls/nvcuda/nvcuda.c
+++ b/dlls/nvcuda/nvcuda.c
@@ -37,6 +37,7 @@
 #include "cuda.h"
 #include "nvcuda.h"
 #include "d3d9.h"
+#include "dxgi.h"
 
 #if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
 #define DEV_PTR "%llu"
@@ -2958,6 +2959,13 @@ CUresult WINAPI wine_cuD3D9GetDevice(CUdevice *pCudaDevice, const char *pszAdapt
     return pcuDeviceGet(pCudaDevice, 0);
 }
 
+CUresult WINAPI wine_cuD3D10GetDevice(CUdevice *pCudaDevice, IDXGIAdapter *pAdapter)
+{
+    FIXME("(%p, %p) - semi-stub\n", pCudaDevice, pAdapter);
+    /* DXGI adapters don't have an OpenGL context assigned yet, otherwise we could use cuGLGetDevices */
+    return pcuDeviceGet(pCudaDevice, 0);
+}
+
 BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
 {
     TRACE("(%p, %u, %p)\n", instance, reason, reserved);
diff --git a/dlls/nvcuda/nvcuda.spec b/dlls/nvcuda/nvcuda.spec
index 492d6c129c1..4a06881f0b5 100644
--- a/dlls/nvcuda/nvcuda.spec
+++ b/dlls/nvcuda/nvcuda.spec
@@ -34,7 +34,7 @@
 @ stub cuD3D10CtxCreate
 @ stub cuD3D10CtxCreateOnDevice
 @ stub cuD3D10CtxCreate_v2
-@ stub cuD3D10GetDevice
+@ stdcall cuD3D10GetDevice(ptr ptr) wine_cuD3D10GetDevice
 @ stub cuD3D10GetDevices
 @ stub cuD3D10GetDirect3DDevice
 @ stub cuD3D10MapResources
-- 
2.14.1

