summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2025-10-14 22:13:05 -0500
committerJordan Woyak <jordan.woyak@gmail.com>2025-11-05 04:05:36 -0600
commit2fb1fdfb16d5e45888fc327f850cd3d78330ce96 (patch)
tree762fffe4a76d5532cbe8a419e7a6764d4ef11895 /Source/Core
parent24426267719faa2a09ce4837e9f79ba3234f27af (diff)
WiimoteReal/IOWin: Use Common::GetDeviceInterfaceList.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/HW/WiimoteReal/IOWin.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/Source/Core/Core/HW/WiimoteReal/IOWin.cpp b/Source/Core/Core/HW/WiimoteReal/IOWin.cpp
index af442355cd..d44428feaf 100644
--- a/Source/Core/Core/HW/WiimoteReal/IOWin.cpp
+++ b/Source/Core/Core/HW/WiimoteReal/IOWin.cpp
@@ -583,20 +583,8 @@ auto WiimoteScannerWindows::FindWiimoteHIDDevices() -> FindResults
// Enumerate connected HID interfaces IDs.
auto class_guid = GUID_DEVINTERFACE_HID;
constexpr ULONG flags = CM_GET_DEVICE_INTERFACE_LIST_PRESENT;
- ULONG list_size = 0;
- CM_Get_Device_Interface_List_Size(&list_size, &class_guid, nullptr, flags);
- const auto buffer = std::make_unique_for_overwrite<WCHAR[]>(list_size);
- const auto list_result =
- CM_Get_Device_Interface_List(&class_guid, nullptr, buffer.get(), list_size, flags);
- if (list_result != CR_SUCCESS)
- {
- ERROR_LOG_FMT(WIIMOTE, "CM_Get_Device_Interface_List: {}", list_result);
- return results;
- }
-
- for (const WCHAR* hid_iface = buffer.get(); *hid_iface != L'\0';
- hid_iface += wcslen(hid_iface) + 1)
+ for (auto* hid_iface : Common::GetDeviceInterfaceList(&class_guid, nullptr, flags))
{
// TODO: WiimoteWindows::GetId() does a redundant conversion.
const auto hid_iface_utf8 = WStringToUTF8(hid_iface);