diff --git a/INSTALL/ventoy/vtoyjump32.exe b/INSTALL/ventoy/vtoyjump32.exe index 6f36a9ca..64a66e83 100644 Binary files a/INSTALL/ventoy/vtoyjump32.exe and b/INSTALL/ventoy/vtoyjump32.exe differ diff --git a/INSTALL/ventoy/vtoyjump64.exe b/INSTALL/ventoy/vtoyjump64.exe index a4308ed3..3b118a4c 100644 Binary files a/INSTALL/ventoy/vtoyjump64.exe and b/INSTALL/ventoy/vtoyjump64.exe differ diff --git a/vtoyjump/vtoyjump/vtoyjump.c b/vtoyjump/vtoyjump/vtoyjump.c index dd50b6b9..a70486a0 100644 --- a/vtoyjump/vtoyjump/vtoyjump.c +++ b/vtoyjump/vtoyjump/vtoyjump.c @@ -1642,6 +1642,37 @@ static int ExpandSingleVar(VarDiskInfo *pDiskInfo, int DiskNum, const char *var, Log("%s=", var, index); sprintf_s(value, len, "%d", index); } + else if (strncmp(var, "VT_WINDOWS_DISK_NONVTOY_CLOSEST_", 32) == 0) + { + uiDst = strtoul(var + 32, NULL, 10); + uiDst = uiDst * (1024ULL * 1024ULL * 1024ULL); + + for (i = 0; i < DiskNum; i++) + { + if (pDiskInfo[i].Capacity == 0 || i == g_vtoy_disk_drive) + { + continue; + } + + if (pDiskInfo[i].Capacity > uiDst) + { + uiDelta = pDiskInfo[i].Capacity - uiDst; + } + else + { + uiDelta = uiDst - pDiskInfo[i].Capacity; + } + + if (uiDelta < uiMaxDelta) + { + uiMaxDelta = uiDelta; + index = i; + } + } + + Log("%s=", var, index); + sprintf_s(value, len, "%d", index); + } else { Log("Invalid var name <%s>", var);