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

This commit is contained in:
Henri Verbeet 2012-06-29 07:37:55 +02:00 committed by Alexandre Julliard
parent d843447580
commit 035b79ebcf
1 changed files with 3 additions and 8 deletions

View File

@ -3186,17 +3186,12 @@ HRESULT CDECL wined3d_get_adapter_identifier(const struct wined3d *wined3d,
/* Note that d3d8 doesn't supply a device name. */ /* Note that d3d8 doesn't supply a device name. */
if (identifier->device_name_size) if (identifier->device_name_size)
{ {
static const char *device_name = "\\\\.\\DISPLAY1"; /* FIXME: May depend on desktop? */ if (!WideCharToMultiByte(CP_ACP, 0, adapter->DeviceName, -1, identifier->device_name,
identifier->device_name_size, NULL, NULL))
len = strlen(device_name);
if (len >= identifier->device_name_size)
{ {
ERR("Device name size too small.\n"); ERR("Failed to convert device name, last error %#x.\n", GetLastError());
return WINED3DERR_INVALIDCALL; 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; identifier->driver_version.u.HighPart = adapter->driver_info.version_high;