mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-10 07:12:54 +02:00
InputCommon: Fix slow startup on some Windows systems
Rewrite GetXInputGUIDS to use SetupAPI instead of WMI Queries. When using a language pack where the system language and user/program language differ, Windows starts taking a VERY long time (10+ seconds) to complete Queries for Win32_PNPEntity objects (it's probably translating every single string since it transfers every single one from the WMI server into memory in the program). Fixes Issue 9744.
This commit is contained in:
@ -23,14 +23,11 @@ void InitJoystick(IDirectInput8* const idi8, HWND hwnd)
|
||||
idi8->EnumDevices(DI8DEVCLASS_GAMECTRL, DIEnumDevicesCallback, (LPVOID)&joysticks,
|
||||
DIEDFL_ATTACHEDONLY);
|
||||
|
||||
std::vector<DWORD> xinput_guids;
|
||||
GetXInputGUIDS(&xinput_guids);
|
||||
|
||||
std::unordered_set<DWORD> xinput_guids = GetXInputGUIDS();
|
||||
for (DIDEVICEINSTANCE& joystick : joysticks)
|
||||
{
|
||||
// skip XInput Devices
|
||||
if (std::find(xinput_guids.begin(), xinput_guids.end(), joystick.guidProduct.Data1) !=
|
||||
xinput_guids.end())
|
||||
if (xinput_guids.count(joystick.guidProduct.Data1))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user