Henri Verbeet : wined3d: Use the device name stored in the adapter in wined3d_get_adapter_identifier ().

Alexandre Julliard julliard at winehq.org
Fri Jun 29 14:24:27 CDT 2012


Module: wine
Branch: master
Commit: 035b79ebcf6309752007c31eaa587717c88064e7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=035b79ebcf6309752007c31eaa587717c88064e7

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Fri Jun 29 07:37:55 2012 +0200

wined3d: Use the device name stored in the adapter in wined3d_get_adapter_identifier().

---

 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;




More information about the wine-cvs mailing list