I have working wrappers for Xinput and DirectInput in my game, but I had problems with xbox controllers, because they are also recognized as generic controllers by directinput.
I have found out that Microsoft recommends to solve this problem like described on this MSDN page (See the IsXInputDevice function in the code sample).
I implemented the suggested function, but sadly it is very slow and I found out that the following call takes about half a minute to finish on my computer:
pIWbemServices->CreateInstanceEnum(bstrClassName, 0, NULL, &pEnumDevices);
Could anyone solve this problem and if yes, how? I imagine many games use this method to select the correct input method for gamepads, but the problem is not common at all.
For the time being, I began writing a wrapper for raw input but I'd be happy if this also got solved.