From: longpanda Date: Wed, 20 Oct 2021 14:57:18 +0000 (+0800) Subject: Optimization for Ventoy2Disk.exe X-Git-Tag: v1.0.56~6 X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/commitdiff_plain/52ae65f54dd8f45085f0ac325e16ce583a47fa99?ds=sidebyside Optimization for Ventoy2Disk.exe --- diff --git a/INSTALL/Ventoy2Disk.exe b/INSTALL/Ventoy2Disk.exe index 008d3d3..e36770c 100644 Binary files a/INSTALL/Ventoy2Disk.exe and b/INSTALL/Ventoy2Disk.exe differ diff --git a/Ventoy2Disk/Ventoy2Disk/process.c b/Ventoy2Disk/Ventoy2Disk/process.c index 5064d1f..2f5d970 100644 --- a/Ventoy2Disk/Ventoy2Disk/process.c +++ b/Ventoy2Disk/Ventoy2Disk/process.c @@ -504,7 +504,9 @@ int FindProcessOccupyDisk(HANDLE hDrive, PHY_DRIVE_INFO *pPhyDrive) if (buffer == NULL) goto out; - for (i = 0;; i++) { + Log("handles->NumberOfHandles = %lu", (ULONG)handles->NumberOfHandles); + + for (i = 0; i < handles->NumberOfHandles; i++) { ULONG attempts = 8; PSYSTEM_HANDLE_TABLE_ENTRY_INFO_EX handleInfo = (i < handles->NumberOfHandles) ? &handles->Handles[i] : NULL;