mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-16 04:09:39 +00:00
WindowsDevice: Remove GetDeviceProperty function in favor of the CfgMgr32 versions. SetupAPI seems to be no longer recommended.
This commit is contained in:
parent
2fb1fdfb16
commit
28be9dc64f
@ -14,29 +14,6 @@
|
||||
|
||||
namespace Common
|
||||
{
|
||||
std::wstring GetDeviceProperty(const HDEVINFO& device_info, const PSP_DEVINFO_DATA device_data,
|
||||
const DEVPROPKEY* requested_property)
|
||||
{
|
||||
DWORD required_size = 0;
|
||||
DEVPROPTYPE device_property_type;
|
||||
BOOL result;
|
||||
|
||||
result = SetupDiGetDeviceProperty(device_info, device_data, requested_property,
|
||||
&device_property_type, nullptr, 0, &required_size, 0);
|
||||
if (!result && GetLastError() != ERROR_INSUFFICIENT_BUFFER)
|
||||
return std::wstring();
|
||||
|
||||
std::vector<TCHAR> unicode_buffer(required_size / sizeof(TCHAR));
|
||||
|
||||
result = SetupDiGetDeviceProperty(
|
||||
device_info, device_data, requested_property, &device_property_type,
|
||||
reinterpret_cast<PBYTE>(unicode_buffer.data()), required_size, nullptr, 0);
|
||||
if (!result)
|
||||
return std::wstring();
|
||||
|
||||
return std::wstring(unicode_buffer.data());
|
||||
}
|
||||
|
||||
std::optional<std::wstring> GetPropertyHelper(auto function, auto dev,
|
||||
const DEVPROPKEY* requested_property,
|
||||
DEVPROPTYPE expected_type)
|
||||
|
||||
@ -24,10 +24,6 @@
|
||||
|
||||
namespace Common
|
||||
{
|
||||
// Obtains a device property and returns it as a wide string.
|
||||
std::wstring GetDeviceProperty(const HANDLE& device_info, const PSP_DEVINFO_DATA device_data,
|
||||
const DEVPROPKEY* requested_property);
|
||||
|
||||
std::optional<std::wstring> GetDevNodeStringProperty(DEVINST device,
|
||||
const DEVPROPKEY* requested_property);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user