From 68713e08b4b5009e76147e0109ffef3472477cfe Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Sat, 19 Jul 2025 14:02:43 +0200 Subject: Common: Move GetDeviceProperty() into its own header Otherwise we include Windows headers in the entire codebase through CommonFuncs.h --- Source/Core/Common/CommonFuncs.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'Source/Core/Common/CommonFuncs.cpp') diff --git a/Source/Core/Common/CommonFuncs.cpp b/Source/Core/Common/CommonFuncs.cpp index f59939bf6b..91eed700ab 100644 --- a/Source/Core/Common/CommonFuncs.cpp +++ b/Source/Core/Common/CommonFuncs.cpp @@ -92,28 +92,5 @@ std::optional GetModuleName(void* hInstance) name.resize(size); return name; } - -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 unicode_buffer(required_size / sizeof(TCHAR)); - - result = SetupDiGetDeviceProperty( - device_info, device_data, requested_property, &device_property_type, - reinterpret_cast(unicode_buffer.data()), required_size, nullptr, 0); - if (!result) - return std::wstring(); - - return std::wstring(unicode_buffer.data()); -} #endif } // namespace Common -- cgit v1.2.3