问题 Sometimes (in about 50% of runs), EnumDevices takes 5-10 seconds to return. Normally it is almost instant. I couldn't find any other reports of this kind of behaviour. When things are this slow, it's ok to profile by watching stdout :) This: std::cout << "A"; directInput8Interface->EnumDevices(DI8DEVCLASS_GAMECTRL, MyCallback, NULL, DIEDFL_ATTACHEDONLY); std::cout << "C"; ... BOOL CALLBACK MyCallback(LPCDIDEVICEINSTANCE, LPVOID) { std::cout << "B"; return DIENUM_CONTINUE; } Seems to hang at a