]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - Plugson/src/main_windows.c
Auto use memdisk mode for KolibriOS.iso
[Ventoy.git] / Plugson / src / main_windows.c
index 67d6ee0fa43bb77a30205b0e5cac82e4761b7298..e6a0bf47a0f361751e9dca618c4114d8e9976c94 100644 (file)
@@ -468,6 +468,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
 {\r
     int rc;\r
        HANDLE hMutex;\r
+       WCHAR CurDir[MAX_PATH];\r
 \r
     UNREFERENCED_PARAMETER(hPrevInstance);\r
 \r
@@ -489,7 +490,9 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
                return 1;\r
        }\r
 \r
-       GetCurrentDirectoryA(MAX_PATH, g_cur_dir);\r
+       GetCurrentDirectoryW(MAX_PATH, CurDir);\r
+       WideCharToMultiByte(CP_UTF8, 0, CurDir, -1, g_cur_dir, MAX_PATH, NULL, 0);\r
+\r
        sprintf_s(g_ventoy_dir, sizeof(g_ventoy_dir), "%s", g_cur_dir);\r
        sprintf_s(g_log_file, sizeof(g_log_file), "%s\\%s", g_cur_dir, LOG_FILE);\r
        ventoy_log_init();\r