mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-08-27 16:01:14 +00:00
1.0.05 release
1. Add backup thread in vtoyjump.exe 2. New iso support MXLinux 19.1 (Legacy + UEFI) KNOPPIX_V8.6-2019-08-08-EN.iso (Legacy) Puppy Linux, bionicpup64-8.0-uefi.iso (Legacy + UEFI) tails-amd64-4.5.iso (Legacy) slax-64bit-9.11.0.iso (Legacy) Kaspersky Rescue Disk 18 (Legacy + UEFI) Parted Magic 2018 Bootable ISO (Legacy + UEFI) veket_20.iso (Legacy) ZeroShell-3.9.3-X86.iso (Legacy) SuperGrub2Disk rescatux-0.73.iso (Legacy + UEFI) Some WinPE iso (Legacy + UEFI)
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "vtoyjump.h"
|
||||
#include "fat_filelib.h"
|
||||
|
||||
static ventoy_os_param g_os_param;
|
||||
static UINT8 g_os_param_reserved[32];
|
||||
static BOOL g_64bit_system = FALSE;
|
||||
static ventoy_guid g_ventoy_guid = VENTOY_GUID;
|
||||
@@ -784,7 +785,6 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
|
||||
DWORD PeStart;
|
||||
DWORD FileSize;
|
||||
BYTE *Buffer = NULL;
|
||||
ventoy_os_param os_param;
|
||||
CHAR ExeFileName[MAX_PATH];
|
||||
|
||||
sprintf_s(ExeFileName, sizeof(ExeFileName), "%s", argv[0]);
|
||||
@@ -818,9 +818,9 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
|
||||
CheckPeHead(Buffer + PeStart + sizeof(ventoy_os_param)))
|
||||
{
|
||||
Log("Find os pararm at %u", PeStart);
|
||||
memcpy(&os_param, Buffer + PeStart, sizeof(ventoy_os_param));
|
||||
|
||||
memcpy(g_os_param_reserved, os_param.vtoy_reserved, sizeof(g_os_param_reserved));
|
||||
memcpy(&g_os_param, Buffer + PeStart, sizeof(ventoy_os_param));
|
||||
memcpy(g_os_param_reserved, g_os_param.vtoy_reserved, sizeof(g_os_param_reserved));
|
||||
|
||||
if (g_os_param_reserved[0] == 1)
|
||||
{
|
||||
@@ -829,11 +829,11 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
|
||||
}
|
||||
|
||||
// convert / to \\
|
||||
for (Pos = 0; Pos < sizeof(os_param.vtoy_img_path) && os_param.vtoy_img_path[Pos]; Pos++)
|
||||
for (Pos = 0; Pos < sizeof(g_os_param.vtoy_img_path) && g_os_param.vtoy_img_path[Pos]; Pos++)
|
||||
{
|
||||
if (os_param.vtoy_img_path[Pos] == '/')
|
||||
if (g_os_param.vtoy_img_path[Pos] == '/')
|
||||
{
|
||||
os_param.vtoy_img_path[Pos] = '\\';
|
||||
g_os_param.vtoy_img_path[Pos] = '\\';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -857,7 +857,7 @@ int VentoyJump(INT argc, CHAR **argv, CHAR *LunchFile)
|
||||
goto End;
|
||||
}
|
||||
|
||||
rc = VentoyHook(&os_param);
|
||||
rc = VentoyHook(&g_os_param);
|
||||
|
||||
End:
|
||||
|
||||
@@ -912,35 +912,31 @@ int main(int argc, char **argv)
|
||||
|
||||
GetStartupInfoA(&Si);
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
memset(LunchFile, 0, sizeof(LunchFile));
|
||||
rc = VentoyJump(argc, argv, LunchFile);
|
||||
|
||||
if (g_os_param_reserved[0] == 3)
|
||||
{
|
||||
Log("VentoyJump loop %d", i + 1);
|
||||
|
||||
memset(LunchFile, 0, sizeof(LunchFile));
|
||||
rc = VentoyJump(argc, argv, LunchFile);
|
||||
|
||||
if (g_os_param_reserved[0] == 3)
|
||||
{
|
||||
Log("Open log for debug ...");
|
||||
sprintf_s(LunchFile, sizeof(LunchFile), "%s", "notepad.exe ventoy.log");
|
||||
break;
|
||||
}
|
||||
else if (rc == 0)
|
||||
{
|
||||
Log("Ventoy jump success ...");
|
||||
Si.dwFlags |= STARTF_USESHOWWINDOW;
|
||||
Si.wShowWindow = SW_HIDE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log("Ventoy jump fail, now wait ...");
|
||||
sprintf_s(LunchFile, sizeof(LunchFile), "%s", "cmd.exe");
|
||||
Sleep(3000);
|
||||
}
|
||||
Log("Open log for debug ...");
|
||||
sprintf_s(LunchFile, sizeof(LunchFile), "%s", "notepad.exe ventoy.log");
|
||||
}
|
||||
else
|
||||
{
|
||||
Si.dwFlags |= STARTF_USESHOWWINDOW;
|
||||
Si.wShowWindow = SW_HIDE;
|
||||
Log("Ventoy jump %s ...", rc == 0 ? "success" : "failed");
|
||||
}
|
||||
|
||||
CreateProcessA(NULL, LunchFile, NULL, NULL, FALSE, 0, NULL, NULL, &Si, &Pi);
|
||||
|
||||
while (rc)
|
||||
{
|
||||
Log("Ventoy hook failed, now wait and retry ...");
|
||||
Sleep(1000);
|
||||
|
||||
rc = VentoyHook(&g_os_param);
|
||||
}
|
||||
|
||||
CreateProcessA(NULL, LunchFile, NULL, NULL, FALSE, 0, NULL, NULL, &Si, &Pi);
|
||||
WaitForSingleObject(Pi.hProcess, INFINITE);
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user