[misc] prevent unwanted device refreshes

This commit is contained in:
Pete Batard 2018-09-03 13:04:05 +01:00
parent 3459d89f09
commit a472e96e87
2 changed files with 11 additions and 5 deletions

View file

@ -321,6 +321,12 @@ BOOL GetOpticalMedia(IMG_SAVE* img_save)
*/
BOOL GetDevices(DWORD devnum)
{
// Make sure at least one second has elapsed since we last displayed devices
static ULONGLONG LastRefresh = 0;
if (GetTickCount64() < LastRefresh + 1000)
return FALSE;
LastRefresh = GetTickCount64();
// List of USB storage drivers we know - list may be incomplete!
const char* usbstor_name[] = {
// Standard MS USB storage driver