X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/293f677cbfbaae984fc3063c62d4b9afa0067520..f7fac26c91a2efbb77b243ffd20e89e992ea1f71:/Plugson/src/main_windows.c diff --git a/Plugson/src/main_windows.c b/Plugson/src/main_windows.c index 67d6ee0..e6a0bf4 100644 --- a/Plugson/src/main_windows.c +++ b/Plugson/src/main_windows.c @@ -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();