mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-29 14:05:22 -04:00
[process] add a timeout for the process search
* The process search appears to be blocking on some platform, and we also don't want users to have to wait too long on format startup * Also update the update check for Windows XP SSL errors
This commit is contained in:
parent
5c3437f6de
commit
4617ba786d
6 changed files with 72 additions and 35 deletions
|
@ -153,7 +153,7 @@ static HANDLE GetHandle(char* Path, BOOL bLockDrive, BOOL bWriteAccess, BOOL bWr
|
|||
bWriteShare = TRUE;
|
||||
// Try to report the process that is locking the drive
|
||||
// We also use bit 6 as a flag to indicate that SearchProcess was called.
|
||||
access_mask = SearchProcess(DevPath, TRUE, TRUE, FALSE) | 0x40;
|
||||
access_mask = SearchProcess(DevPath, 5000, TRUE, TRUE, FALSE) | 0x40;
|
||||
}
|
||||
Sleep(DRIVE_ACCESS_TIMEOUT / DRIVE_ACCESS_RETRIES);
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ static HANDLE GetHandle(char* Path, BOOL bLockDrive, BOOL bWriteAccess, BOOL bWr
|
|||
uprintf("Could not lock access to %s: %s", Path, WindowsErrorString());
|
||||
// See if we can report the processes are accessing the drive
|
||||
if (!IS_ERROR(FormatStatus) && (access_mask == 0))
|
||||
access_mask = SearchProcess(DevPath, TRUE, TRUE, FALSE);
|
||||
access_mask = SearchProcess(DevPath, 5000, TRUE, TRUE, FALSE);
|
||||
// Try to continue if the only access rights we saw were for read-only
|
||||
if ((access_mask & 0x07) != 0x01)
|
||||
safe_closehandle(hDrive);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue