From 642ef33df02eb674f94f167a3a4fe32e809b636f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Tue, 12 Mar 2019 16:30:19 +0100 Subject: [PATCH] dxgi: Introduce IWineDXGIAdapter::get_adapter_info(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/dxgi/adapter.c | 24 ++++++++++++++++++++++++ include/wine/winedxgi.idl | 12 ++++++++++++ 2 files changed, 36 insertions(+) diff --git a/dlls/dxgi/adapter.c b/dlls/dxgi/adapter.c index 31baae6f49f..d96cb1e5b23 100644 --- a/dlls/dxgi/adapter.c +++ b/dlls/dxgi/adapter.c @@ -364,6 +364,28 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc3(IWineDXGIAdapter *iface, return dxgi_adapter_get_desc(adapter, desc); } +static HRESULT STDMETHODCALLTYPE dxgi_adapter_get_adapter_info(IWineDXGIAdapter *iface, + struct wine_dxgi_adapter_info *info) +{ + struct dxgi_adapter *adapter = impl_from_IWineDXGIAdapter(iface); + struct wined3d_adapter_identifier adapter_id; + HRESULT hr; + + TRACE("iface %p, info %p.\n", iface, info); + + memset(&adapter_id, 0, sizeof(adapter_id)); + if (SUCCEEDED(hr = wined3d_get_adapter_identifier(adapter->factory->wined3d, adapter->ordinal, 0, &adapter_id))) + { + info->driver_uuid = adapter_id.driver_uuid; + info->device_uuid = adapter_id.device_uuid; + info->vendor_id = adapter_id.vendor_id; + info->device_id = adapter_id.device_id; + info->luid = adapter_id.adapter_luid; + } + + return hr; +} + static const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl = { dxgi_adapter_QueryInterface, @@ -390,6 +412,8 @@ static const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl = dxgi_adapter_UnregisterVideoMemoryBudgetChangeNotification, /* IDXGIAdapter4 methods */ dxgi_adapter_GetDesc3, + /* IWineDXGIAdapter methods */ + dxgi_adapter_get_adapter_info, }; struct dxgi_adapter *unsafe_impl_from_IDXGIAdapter(IDXGIAdapter *iface) diff --git a/include/wine/winedxgi.idl b/include/wine/winedxgi.idl index f300eb928b6..84440901a9e 100644 --- a/include/wine/winedxgi.idl +++ b/include/wine/winedxgi.idl @@ -68,6 +68,17 @@ interface IWineDXGIDeviceParent : IUnknown struct wined3d_device_parent *get_wined3d_device_parent(); } +struct wine_dxgi_adapter_info +{ + GUID driver_uuid; + GUID device_uuid; + + DWORD vendor_id; + DWORD device_id; + + LUID luid; +}; + [ object, local, @@ -75,6 +86,7 @@ interface IWineDXGIDeviceParent : IUnknown ] interface IWineDXGIAdapter : IDXGIAdapter4 { + HRESULT get_adapter_info([out] struct wine_dxgi_adapter_info *info); } [