From 678658086d62c23a821d9ef41d8f7f7d4e7e5cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Tue, 25 Jun 2019 14:30:12 +0200 Subject: [PATCH] tests: Print adapter name on Windows. 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 --- tests/d3d12_crosstest.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h index 22844ab3..fbc0e3de 100644 --- a/tests/d3d12_crosstest.h +++ b/tests/d3d12_crosstest.h @@ -297,9 +297,11 @@ static ID3D12Device *create_device(void) static void init_adapter_info(void) { + char name[MEMBER_SIZE(DXGI_ADAPTER_DESC, Description)]; IDXGIAdapter *dxgi_adapter; DXGI_ADAPTER_DESC desc; IUnknown *adapter; + unsigned int i; HRESULT hr; if (!(adapter = create_adapter())) @@ -312,7 +314,12 @@ static void init_adapter_info(void) hr = IDXGIAdapter_GetDesc(dxgi_adapter, &desc); ok(hr == S_OK, "Failed to get adapter desc, hr %#x.\n", hr); - trace("Adapter: %04x:%04x.\n", desc.VendorId, desc.DeviceId); + /* FIXME: Use debugstr_w(). */ + for (i = 0; i < ARRAY_SIZE(desc.Description) && isprint(desc.Description[i]); ++i) + name[i] = desc.Description[i]; + name[min(i, ARRAY_SIZE(name) - 1)] = '\0'; + + trace("Adapter: %s, %04x:%04x.\n", name, desc.VendorId, desc.DeviceId); if (desc.VendorId == 0x1414 && desc.DeviceId == 0x008c) {