mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-10-05 01:36:18 +00:00
Fix the "plugson.tar.xz not found" error, when the path contains unicode characters.
This commit is contained in:
@@ -468,6 +468,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
{
|
||||
int rc;
|
||||
HANDLE hMutex;
|
||||
WCHAR CurDir[MAX_PATH];
|
||||
|
||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
|
||||
@@ -489,7 +490,9 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
||||
return 1;
|
||||
}
|
||||
|
||||
GetCurrentDirectoryA(MAX_PATH, g_cur_dir);
|
||||
GetCurrentDirectoryW(MAX_PATH, CurDir);
|
||||
WideCharToMultiByte(CP_UTF8, 0, CurDir, -1, g_cur_dir, MAX_PATH, NULL, 0);
|
||||
|
||||
sprintf_s(g_ventoy_dir, sizeof(g_ventoy_dir), "%s", g_cur_dir);
|
||||
sprintf_s(g_log_file, sizeof(g_log_file), "%s\\%s", g_cur_dir, LOG_FILE);
|
||||
ventoy_log_init();
|
||||
|
Reference in New Issue
Block a user