I am working in a UWP app project. When I try to use Windows::Gaming::Input::Gamepad::Gamepads->Size to get the number of connected gamepads, it returned 0 (I connected Xbox One Controller and it play game fine). Then I try plug out and plug in my Xbox One Controller, I got this log in Debug output of VS2019.
onecoreuap\xbox\devices\api\winrt\pnpdevice.cpp(506)\Windows.Gaming.Input.dll!0EF71146: (caller: 0EF73A5C) ReturnHr(3) tid(29f4) 80070057 The parameter is incorrect.
onecore\com\combase\dcomrem\preventrundownbias.cpp(1310)\combase.dll!75F8752A: (caller: 75F8738B) LogHr(1) tid(4300) 80070005 Access is denied.
How can I fix this?