Commit 7f61f35b authored by Joshua Ashton's avatar Joshua Ashton 🐸

[d3d9] Add wideStringToMultiByte and use it to convert adapter info.

parent ba8d599c
Pipeline #40 passed with stage
in 1 minute and 38 seconds
......@@ -55,8 +55,8 @@ namespace dxup {
DXGI_OUTPUT_DESC outDesc;
output->GetDesc(&outDesc);
wcstombs(pIdentifier->Description, desc.Description, MAX_DEVICE_IDENTIFIER_STRING);
wcstombs(pIdentifier->DeviceName, outDesc.DeviceName, 32);
convert::wideStringToMultiByte(desc.Description, pIdentifier->Description, MAX_DEVICE_IDENTIFIER_STRING);
convert::wideStringToMultiByte(outDesc.DeviceName, pIdentifier->DeviceName, 32);
strcpy(pIdentifier->Driver, "d3d9.dll");
pIdentifier->DriverVersion.QuadPart = 0;
pIdentifier->VendorId = desc.VendorId;
......
......@@ -156,6 +156,10 @@ namespace dxup {
return D3D_OK;
}
inline void wideStringToMultiByte(const WCHAR* wide, char* mb, uint32_t mblen) {
WideCharToMultiByte(CP_ACP, 0, wide, -1, mb, mblen, nullptr, nullptr);
}
}
namespace reinterpret {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment