[PATCH 3/5] wined3d: Use the device name stored in the adapter in wined3d_get_adapter_identifier().

Henri Verbeet hverbeet at codeweavers.com
Fri Jun 29 00:37:55 CDT 2012


---
 dlls/wined3d/directx.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 0da622a..a9e41ce 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -3186,17 +3186,12 @@ HRESULT CDECL wined3d_get_adapter_identifier(const struct wined3d *wined3d,
     /* Note that d3d8 doesn't supply a device name. */
     if (identifier->device_name_size)
     {
-        static const char *device_name = "\\\\.\\DISPLAY1"; /* FIXME: May depend on desktop? */
-
-        len = strlen(device_name);
-        if (len >= identifier->device_name_size)
+        if (!WideCharToMultiByte(CP_ACP, 0, adapter->DeviceName, -1, identifier->device_name,
+                identifier->device_name_size, NULL, NULL))
         {
-            ERR("Device name size too small.\n");
+            ERR("Failed to convert device name, last error %#x.\n", GetLastError());
             return WINED3DERR_INVALIDCALL;
         }
-
-        memcpy(identifier->device_name, device_name, len);
-        identifier->device_name[len] = '\0';
     }
 
     identifier->driver_version.u.HighPart = adapter->driver_info.version_high;
-- 
1.7.8.6




More information about the wine-patches mailing list