mirror of
https://github.com/ventoy/Ventoy.git
synced 2024-12-24 06:05:58 -05:00
Add cmdline check
This commit is contained in:
parent
9118d5fe45
commit
e3506c0f10
@ -393,12 +393,12 @@ static BOOL IsSupportedVlnkSuffix(WCHAR *FileName)
|
||||
|
||||
if (len > 9)
|
||||
{
|
||||
if (lstrcmp(FileName - 9, L".vlnk.iso") == 0 ||
|
||||
lstrcmp(FileName - 9, L".vlnk.img") == 0 ||
|
||||
lstrcmp(FileName - 9, L".vlnk.wim") == 0 ||
|
||||
lstrcmp(FileName - 9, L".vlnk.vhd") == 0 ||
|
||||
lstrcmp(FileName - 9, L".vlnk.efi") == 0 ||
|
||||
lstrcmp(FileName - 9, L".vlnk.dat") == 0)
|
||||
if (lstrcmp(FileName + len - 9, L".vlnk.iso") == 0 ||
|
||||
lstrcmp(FileName + len - 9, L".vlnk.img") == 0 ||
|
||||
lstrcmp(FileName + len - 9, L".vlnk.wim") == 0 ||
|
||||
lstrcmp(FileName + len - 9, L".vlnk.vhd") == 0 ||
|
||||
lstrcmp(FileName + len - 9, L".vlnk.efi") == 0 ||
|
||||
lstrcmp(FileName + len - 9, L".vlnk.dat") == 0)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@ -407,8 +407,8 @@ static BOOL IsSupportedVlnkSuffix(WCHAR *FileName)
|
||||
|
||||
if (len > 10)
|
||||
{
|
||||
if (lstrcmp(FileName - 10, L".vlnk.vhdx") == 0 ||
|
||||
lstrcmp(FileName - 9, L".vlnk.vtoy") == 0)
|
||||
if (lstrcmp(FileName + len - 10, L".vlnk.vhdx") == 0 ||
|
||||
lstrcmp(FileName + len - 10, L".vlnk.vtoy") == 0)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@ -879,6 +879,13 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!IsSupportedVlnkSuffix(g_CmdOutFile))
|
||||
{
|
||||
LogW(L"File <<%ls>> contains invalid vlnk suffix!\n", g_CmdOutFile);
|
||||
VtoyMessageBox(NULL, g_msg_lang[MSGID_INVALID_SUFFIX], g_msg_lang[MSGID_ERROR], MB_OK | MB_ICONERROR);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return CreateVlnk(NULL, g_CurDirW, g_CmdInFile, g_CmdOutFile);
|
||||
}
|
||||
else
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user