mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-22 09:19:18 +01:00
Re-add delay on device disable
This commit is contained in:
parent
8be2f9f271
commit
92c7b50d6d
@ -309,6 +309,16 @@ namespace DS4Windows
|
||||
}
|
||||
*/
|
||||
|
||||
//System.Threading.Thread.Sleep(50);
|
||||
sw.Restart();
|
||||
while (sw.ElapsedMilliseconds < 50)
|
||||
{
|
||||
// Use SpinWait to keep control of current thread. Using Sleep could potentially
|
||||
// cause other events to get run out of order
|
||||
System.Threading.Thread.SpinWait(100);
|
||||
}
|
||||
sw.Stop();
|
||||
|
||||
propChangeParams.stateChange = NativeMethods.DICS_ENABLE;
|
||||
success = NativeMethods.SetupDiSetClassInstallParams(deviceInfoSet, ref deviceInfoData, ref propChangeParams, Marshal.SizeOf(propChangeParams));
|
||||
if (!success)
|
||||
|
Loading…
Reference in New Issue
Block a user