mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-10-04 09:16:17 +00:00
update
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <Shlobj.h>
|
#include <Shlobj.h>
|
||||||
#include <tlhelp32.h>
|
#include <tlhelp32.h>
|
||||||
#include <Psapi.h>
|
#include <Psapi.h>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
#include <ventoy_disk.h>
|
#include <ventoy_disk.h>
|
||||||
#include <ventoy_http.h>
|
#include <ventoy_http.h>
|
||||||
|
|
||||||
char g_ventoy_dir[MAX_PATH];
|
char g_ventoy_dir[MAX_PATH];
|
||||||
|
|
||||||
static BOOL g_running = FALSE;
|
static BOOL g_running = FALSE;
|
||||||
static HWND g_refresh_button;
|
static HWND g_refresh_button;
|
||||||
@@ -44,22 +44,22 @@ typedef enum MSGID
|
|||||||
|
|
||||||
const WCHAR *g_msg_cn[MSGID_BUTT] =
|
const WCHAR *g_msg_cn[MSGID_BUTT] =
|
||||||
{
|
{
|
||||||
L"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"错误",
|
||||||
L"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"提醒",
|
||||||
L"<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ventoy <EFBFBD≯<EFBFBD>Ŀ¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ISO<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD>ã<EFBFBD>",
|
L"请在 Ventoy 盘根目录下运行本程序!(存放ISO文件的位置)",
|
||||||
L"<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ventoy Ŀ¼ʧ<EFBFBD>ܣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"创建 ventoy 目录失败,无法继续!",
|
||||||
L"ventoy Ŀ¼<EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǵ<EFBFBD>Сд<EFBFBD><EFBFBD>ƥ<EFBFBD>䣬<EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"ventoy 目录存在,但是大小写不匹配,请先将其重命名!",
|
||||||
L"<EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>",
|
L"内部错误,程序即将退出!",
|
||||||
L"ˢ<EFBFBD><EFBFBD>",
|
L"刷新",
|
||||||
L"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"启动",
|
||||||
L"ֹͣ",
|
L"停止",
|
||||||
L"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"链接",
|
||||||
L"<EFBFBD>˳<EFBFBD>",
|
L"退出",
|
||||||
|
|
||||||
L"ֹͣ<EFBFBD><EFBFBD><EFBFBD>к<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD>潫<EFBFBD><EFBFBD><EFBFBD>رգ<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"停止运行后浏览器页面将会关闭,是否继续?",
|
||||||
L"<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>",
|
L"当前服务正在运行,是否退出?",
|
||||||
L"<EFBFBD><EFBFBD><EFBFBD>ȹر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD> VentoyPlugson <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"请先关闭正在运行的 VentoyPlugson 程序!",
|
||||||
L"ventoy\\plugson.tar.xz <EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><EFBFBD>Ŀ¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>",
|
L"ventoy\\plugson.tar.xz 文件不存在,请在正确的目录下运行!",
|
||||||
};
|
};
|
||||||
const WCHAR *g_msg_en[MSGID_BUTT] =
|
const WCHAR *g_msg_en[MSGID_BUTT] =
|
||||||
{
|
{
|
||||||
@@ -93,7 +93,7 @@ void ventoy_log_exit(void);
|
|||||||
|
|
||||||
static BOOL OnDestroyDialog()
|
static BOOL OnDestroyDialog()
|
||||||
{
|
{
|
||||||
ventoy_http_exit();
|
ventoy_http_exit();
|
||||||
ventoy_disk_exit();
|
ventoy_disk_exit();
|
||||||
#ifndef VENTOY_SIM
|
#ifndef VENTOY_SIM
|
||||||
ventoy_www_exit();
|
ventoy_www_exit();
|
||||||
@@ -468,6 +468,7 @@ static int ParseCmdLine(LPSTR lpCmdLine, char *ip, char *port)
|
|||||||
|
|
||||||
//
|
//
|
||||||
//copy from Rufus
|
//copy from Rufus
|
||||||
|
//Copyright © 2011-2021 Pete Batard <pete@akeo.ie>
|
||||||
//
|
//
|
||||||
#include <delayimp.h>
|
#include <delayimp.h>
|
||||||
// For delay-loaded DLLs, use LOAD_LIBRARY_SEARCH_SYSTEM32 to avoid DLL search order hijacking.
|
// For delay-loaded DLLs, use LOAD_LIBRARY_SEARCH_SYSTEM32 to avoid DLL search order hijacking.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -45,24 +45,24 @@ typedef enum MSGID
|
|||||||
|
|
||||||
const WCHAR *g_msg_cn[MSGID_BUTT] =
|
const WCHAR *g_msg_cn[MSGID_BUTT] =
|
||||||
{
|
{
|
||||||
L"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"错误",
|
||||||
L"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"提醒",
|
||||||
L"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"创建",
|
||||||
L"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"解析",
|
||||||
L"ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"指定的文件不存在",
|
||||||
L"<EFBFBD><EFBFBD>֧<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>vlnk",
|
L"不支持为此文件创建vlnk",
|
||||||
L"<EFBFBD><EFBFBD>֧<EFBFBD>ֵ<EFBFBD><EFBFBD>ļ<EFBFBD>ϵͳ",
|
L"不支持的文件系统",
|
||||||
L"<EFBFBD><EFBFBD>֧<EFBFBD>ֵ<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"不支持的文件后缀名",
|
||||||
L"<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"获取磁盘信息时发生错误",
|
||||||
L"Vlnk <EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>",
|
L"Vlnk 文件创建成功。",
|
||||||
L"<EFBFBD><EFBFBD><EFBFBD>ȹر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD> VentoyVlnk <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"请先关闭正在运行的 VentoyVlnk 程序!",
|
||||||
L"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>ʧ<EFBFBD><EFBFBD>",
|
L"创建文件失败",
|
||||||
L"<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>vlnk<EFBFBD>ļ<EFBFBD><EFBFBD>ˣ<EFBFBD>",
|
L"此文件已经是一个vlnk文件了!",
|
||||||
L"<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>vlnk<EFBFBD>ļ<EFBFBD>!",
|
L"非法的vlnk文件!",
|
||||||
L"<EFBFBD><EFBFBD> vlnk <EFBFBD>ļ<EFBFBD>ָ<EFBFBD><EFBFBD> ",
|
L"此 vlnk 文件指向 ",
|
||||||
L"<EFBFBD><EFBFBD> vlnk ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>",
|
L"此 vlnk 指向的文件不存在!",
|
||||||
L"<EFBFBD>ļ<EFBFBD>·<EFBFBD><EFBFBD>̫<EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
|
L"文件路径太长!",
|
||||||
L"<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>vlnk<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!",
|
L"非法的vlnk文件后缀名!",
|
||||||
};
|
};
|
||||||
const WCHAR *g_msg_en[MSGID_BUTT] =
|
const WCHAR *g_msg_en[MSGID_BUTT] =
|
||||||
{
|
{
|
||||||
@@ -105,62 +105,62 @@ static int VtoyMessageBox
|
|||||||
|
|
||||||
return MessageBox(hWnd, lpText, lpCaption, uType);
|
return MessageBox(hWnd, lpText, lpCaption, uType);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Log2File(const char *log)
|
static void Log2File(const char *log)
|
||||||
{
|
{
|
||||||
time_t stamp;
|
time_t stamp;
|
||||||
struct tm ttm;
|
struct tm ttm;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
time(&stamp);
|
time(&stamp);
|
||||||
localtime_s(&ttm, &stamp);
|
localtime_s(&ttm, &stamp);
|
||||||
|
|
||||||
fopen_s(&fp, g_LogFile, "a+");
|
fopen_s(&fp, g_LogFile, "a+");
|
||||||
if (fp)
|
if (fp)
|
||||||
{
|
{
|
||||||
fprintf_s(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s",
|
fprintf_s(fp, "[%04u/%02u/%02u %02u:%02u:%02u] %s",
|
||||||
ttm.tm_year + 1900, ttm.tm_mon + 1, ttm.tm_mday,
|
ttm.tm_year + 1900, ttm.tm_mon + 1, ttm.tm_mday,
|
||||||
ttm.tm_hour, ttm.tm_min, ttm.tm_sec, log);
|
ttm.tm_hour, ttm.tm_min, ttm.tm_sec, log);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void LogW(const WCHAR *Fmt, ...)
|
|
||||||
{
|
|
||||||
WCHAR log[512];
|
|
||||||
CHAR alog[2048];
|
|
||||||
va_list arg;
|
|
||||||
|
|
||||||
if (g_LogFile[0] == 0)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
va_start(arg, Fmt);
|
|
||||||
vswprintf_s(log, 512, Fmt, arg);
|
|
||||||
va_end(arg);
|
|
||||||
|
|
||||||
WideCharToMultiByte(CP_UTF8, 0, log, -1, alog, 2048, 0, 0);
|
|
||||||
|
|
||||||
Log2File(alog);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LogW(const WCHAR *Fmt, ...)
|
||||||
void LogA(const CHAR *Fmt, ...)
|
{
|
||||||
{
|
WCHAR log[512];
|
||||||
CHAR log[512];
|
CHAR alog[2048];
|
||||||
va_list arg;
|
va_list arg;
|
||||||
|
|
||||||
if (g_LogFile[0] == 0)
|
if (g_LogFile[0] == 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
va_start(arg, Fmt);
|
va_start(arg, Fmt);
|
||||||
vsprintf_s(log, 512, Fmt, arg);
|
vswprintf_s(log, 512, Fmt, arg);
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
|
|
||||||
Log2File(log);
|
WideCharToMultiByte(CP_UTF8, 0, log, -1, alog, 2048, 0, 0);
|
||||||
|
|
||||||
|
Log2File(alog);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LogA(const CHAR *Fmt, ...)
|
||||||
|
{
|
||||||
|
CHAR log[512];
|
||||||
|
va_list arg;
|
||||||
|
|
||||||
|
if (g_LogFile[0] == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
va_start(arg, Fmt);
|
||||||
|
vsprintf_s(log, 512, Fmt, arg);
|
||||||
|
va_end(arg);
|
||||||
|
|
||||||
|
Log2File(log);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int Utf8ToUtf16(const char* src, WCHAR * dst)
|
static int Utf8ToUtf16(const char* src, WCHAR * dst)
|
||||||
@@ -834,6 +834,7 @@ static int ParseCmdLine(LPSTR lpCmdLine)
|
|||||||
|
|
||||||
//
|
//
|
||||||
//copy from Rufus
|
//copy from Rufus
|
||||||
|
//Copyright © 2011-2021 Pete Batard <pete@akeo.ie>
|
||||||
//
|
//
|
||||||
#include <delayimp.h>
|
#include <delayimp.h>
|
||||||
// For delay-loaded DLLs, use LOAD_LIBRARY_SEARCH_SYSTEM32 to avoid DLL search order hijacking.
|
// For delay-loaded DLLs, use LOAD_LIBRARY_SEARCH_SYSTEM32 to avoid DLL search order hijacking.
|
||||||
|
Reference in New Issue
Block a user