static HRESULT STDMETHODCALLTYPE dxgi_output_GetDesc(IDXGIOutput4 *iface, DXGI_OUTPUT_DESC *desc) { struct dxgi_output *output = impl_from_IDXGIOutput4(iface); struct wined3d_output_desc wined3d_desc; HRESULT hr; TRACE("iface %p, desc %p.\n", iface, desc); if (!desc) return E_INVALIDARG; wined3d_mutex_lock(); hr = wined3d_get_output_desc(output->adapter->factory->wined3d, output->adapter->ordinal, &wined3d_desc); wined3d_mutex_unlock(); if (FAILED(hr)) { WARN("Failed to get output desc, hr %#x.\n", hr); return hr; } memcpy(desc->DeviceName, wined3d_desc.device_name, sizeof(desc->DeviceName)); desc->DesktopCoordinates = wined3d_desc.desktop_rect; desc->AttachedToDesktop = wined3d_desc.attached_to_desktop; desc->Rotation = wined3d_desc.rotation; desc->Monitor = wined3d_desc.monitor; return S_OK; }
static void ddraw_enumerate_secondary_devices(struct wined3d *wined3d, LPDDENUMCALLBACKEXA callback, void *context) { struct wined3d_adapter_identifier adapter_id; struct wined3d_output_desc output_desc; BOOL cont_enum = TRUE; HRESULT hr = S_OK; UINT adapter = 0; for (adapter = 0; SUCCEEDED(hr) && cont_enum; adapter++) { char DriverName[512] = "", DriverDescription[512] = ""; /* The Battle.net System Checker expects the GetAdapterIdentifier DeviceName to match the * Driver Name, so obtain the DeviceName and GUID from D3D. */ memset(&adapter_id, 0x0, sizeof(adapter_id)); adapter_id.device_name = DriverName; adapter_id.device_name_size = sizeof(DriverName); adapter_id.description = DriverDescription; adapter_id.description_size = sizeof(DriverDescription); wined3d_mutex_lock(); if (SUCCEEDED(hr = wined3d_get_adapter_identifier(wined3d, adapter, 0x0, &adapter_id))) hr = wined3d_get_output_desc(wined3d, adapter, &output_desc); wined3d_mutex_unlock(); if (SUCCEEDED(hr)) { TRACE("Interface %d: %s\n", adapter, wine_dbgstr_guid(&adapter_id.device_identifier)); cont_enum = callback(&adapter_id.device_identifier, adapter_id.description, adapter_id.device_name, context, output_desc.monitor); } } }
static HMONITOR WINAPI d3d8_GetAdapterMonitor(IDirect3D8 *iface, UINT adapter) { struct d3d8 *d3d8 = impl_from_IDirect3D8(iface); struct wined3d_output_desc desc; HRESULT hr; TRACE("iface %p, adapter %u.\n", iface, adapter); wined3d_mutex_lock(); hr = wined3d_get_output_desc(d3d8->wined3d, adapter, &desc); wined3d_mutex_unlock(); if (FAILED(hr)) { WARN("Failed to get output desc, hr %#x.\n", hr); return NULL; } return desc.monitor; }