Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dadigang
Ventoy
Commits
f130325a
Commit
f130325a
authored
Feb 17, 2022
by
longpanda
Browse files
Add commad line option -s in VentoyVlnk.exe.
parent
1ca48923
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
2 deletions
+41
-2
Vlnk/src/main_windows.c
Vlnk/src/main_windows.c
+41
-2
Vlnk/vs/VentoyVlnk/Release/VentoyVlnk.exe
Vlnk/vs/VentoyVlnk/Release/VentoyVlnk.exe
+0
-0
No files found.
Vlnk/src/main_windows.c
View file @
f130325a
...
@@ -14,6 +14,7 @@ static HWND g_create_button;
...
@@ -14,6 +14,7 @@ static HWND g_create_button;
static
HWND
g_parse_button
;
static
HWND
g_parse_button
;
static
BOOL
g_ShowHelp
=
FALSE
;
static
BOOL
g_ShowHelp
=
FALSE
;
static
BOOL
g_SaveAs
=
FALSE
;
static
WCHAR
g_CmdInFile
[
MAX_PATH
];
static
WCHAR
g_CmdInFile
[
MAX_PATH
];
static
WCHAR
g_CmdOutFile
[
MAX_PATH
];
static
WCHAR
g_CmdOutFile
[
MAX_PATH
];
...
@@ -363,11 +364,30 @@ End:
...
@@ -363,11 +364,30 @@ End:
}
}
static
BOOL
VentoyGetSaveFileName
(
HWND
hWnd
,
WCHAR
*
szFile
)
{
OPENFILENAME
ofn
=
{
0
};
ofn
.
lStructSize
=
sizeof
(
ofn
);
ofn
.
hwndOwner
=
hWnd
;
ofn
.
lpstrFilter
=
L"Vlnk File
\0
*.vlnk.iso;*.vlnk.img;*.vlnk.wim;*.vlnk.efi;*.vlnk.vhd;*.vlnk.vhdx;*.vlnk.vtoy;*.vlnk.dat
\0
"
;
ofn
.
nFilterIndex
=
1
;
ofn
.
lpstrFile
=
szFile
;
ofn
.
nMaxFile
=
MAX_PATH
;
ofn
.
Flags
=
OFN_EXPLORER
|
OFN_PATHMUSTEXIST
|
OFN_HIDEREADONLY
|
OFN_OVERWRITEPROMPT
;
ofn
.
lpstrFileTitle
=
NULL
;
ofn
.
nMaxFileTitle
=
0
;
ofn
.
lpstrInitialDir
=
NULL
;
return
GetSaveFileName
(
&
ofn
);
}
static
int
CreateVlnk
(
HWND
hWnd
,
WCHAR
*
Dir
,
WCHAR
*
InFile
,
WCHAR
*
OutFile
)
static
int
CreateVlnk
(
HWND
hWnd
,
WCHAR
*
Dir
,
WCHAR
*
InFile
,
WCHAR
*
OutFile
)
{
{
int
i
;
int
i
;
int
end
;
int
end
;
int
len
;
int
len
;
BOOL
SetOutFile
=
FALSE
;
UINT32
DiskSig
;
UINT32
DiskSig
;
DISK_EXTENT
DiskExtend
;
DISK_EXTENT
DiskExtend
;
OPENFILENAME
ofn
=
{
0
};
OPENFILENAME
ofn
=
{
0
};
...
@@ -500,6 +520,7 @@ static int CreateVlnk(HWND hWnd, WCHAR *Dir, WCHAR *InFile, WCHAR *OutFile)
...
@@ -500,6 +520,7 @@ static int CreateVlnk(HWND hWnd, WCHAR *Dir, WCHAR *InFile, WCHAR *OutFile)
return
1
;
return
1
;
}
}
Buf
=
malloc
(
VLNK_FILE_LEN
);
Buf
=
malloc
(
VLNK_FILE_LEN
);
if
(
Buf
)
if
(
Buf
)
{
{
...
@@ -510,10 +531,25 @@ static int CreateVlnk(HWND hWnd, WCHAR *Dir, WCHAR *InFile, WCHAR *OutFile)
...
@@ -510,10 +531,25 @@ static int CreateVlnk(HWND hWnd, WCHAR *Dir, WCHAR *InFile, WCHAR *OutFile)
if
(
OutFile
)
if
(
OutFile
)
{
{
wcscpy_s
(
DstFullPath
,
MAX_PATH
,
OutFile
);
wcscpy_s
(
DstFullPath
,
MAX_PATH
,
OutFile
);
SetOutFile
=
TRUE
;
}
}
else
else
{
{
DefaultVlnkDstFullPath
(
Pos
+
1
,
Dir
,
DstFullPath
);
DefaultVlnkDstFullPath
(
Pos
+
1
,
Dir
,
DstFullPath
);
if
(
g_SaveAs
)
{
wcscpy_s
(
szFile
,
MAX_PATH
,
DstFullPath
);
if
(
VentoyGetSaveFileName
(
hWnd
,
szFile
))
{
wcscpy_s
(
DstFullPath
,
MAX_PATH
,
szFile
);
SetOutFile
=
TRUE
;
}
else
{
LogA
(
"User cancel the save as diaglog, use default name
\n
"
);
}
}
}
}
LogW
(
L"vlnk output file path is <%ls>
\n
"
,
DstFullPath
);
LogW
(
L"vlnk output file path is <%ls>
\n
"
,
DstFullPath
);
...
@@ -524,7 +560,7 @@ static int CreateVlnk(HWND hWnd, WCHAR *Dir, WCHAR *InFile, WCHAR *OutFile)
...
@@ -524,7 +560,7 @@ static int CreateVlnk(HWND hWnd, WCHAR *Dir, WCHAR *InFile, WCHAR *OutFile)
LogW
(
L"Vlnk file create success <%ls>
\n
"
,
DstFullPath
);
LogW
(
L"Vlnk file create success <%ls>
\n
"
,
DstFullPath
);
if
(
OutFile
)
if
(
Set
OutFile
)
{
{
swprintf_s
(
Msg
,
1024
,
L"%ls
\r\n\r\n
%ls"
,
g_msg_lang
[
MSGID_VLNK_SUCCESS
],
DstFullPath
);
swprintf_s
(
Msg
,
1024
,
L"%ls
\r\n\r\n
%ls"
,
g_msg_lang
[
MSGID_VLNK_SUCCESS
],
DstFullPath
);
VtoyMessageBox
(
hWnd
,
Msg
,
g_msg_lang
[
MSGID_INFO
],
MB_OK
|
MB_ICONINFORMATION
);
VtoyMessageBox
(
hWnd
,
Msg
,
g_msg_lang
[
MSGID_INFO
],
MB_OK
|
MB_ICONINFORMATION
);
...
@@ -580,7 +616,6 @@ static CHAR GetDriveLetter(UINT32 disksig, UINT64 PartOffset)
...
@@ -580,7 +616,6 @@ static CHAR GetDriveLetter(UINT32 disksig, UINT64 PartOffset)
return
0
;
return
0
;
}
}
static
int
ParseVlnk
(
HWND
hWnd
)
static
int
ParseVlnk
(
HWND
hWnd
)
{
{
int
i
;
int
i
;
...
@@ -728,6 +763,10 @@ static int ParseCmdLine(LPSTR lpCmdLine)
...
@@ -728,6 +763,10 @@ static int ParseCmdLine(LPSTR lpCmdLine)
{
{
g_ShowHelp
=
TRUE
;
g_ShowHelp
=
TRUE
;
}
}
else
if
(
lstrcmp
(
lpszArgv
[
i
],
L"-s"
)
==
0
||
lstrcmp
(
lpszArgv
[
i
],
L"-S"
)
==
0
)
{
g_SaveAs
=
TRUE
;
}
else
if
(
lstrcmp
(
lpszArgv
[
i
],
L"-i"
)
==
0
||
lstrcmp
(
lpszArgv
[
i
],
L"-I"
)
==
0
)
else
if
(
lstrcmp
(
lpszArgv
[
i
],
L"-i"
)
==
0
||
lstrcmp
(
lpszArgv
[
i
],
L"-I"
)
==
0
)
{
{
if
(
i
+
1
<
argc
)
if
(
i
+
1
<
argc
)
...
...
Vlnk/vs/VentoyVlnk/Release/VentoyVlnk.exe
View file @
f130325a
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment