From c6a1eb3f1e4c54b14403a450d6a3d5b003ca11f8 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Wed, 10 Apr 2024 13:09:32 +0100 Subject: [PATCH] [*] UWP args(?) --- Source/CmdLine/AuCmdLinePlatform.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Source/CmdLine/AuCmdLinePlatform.cpp b/Source/CmdLine/AuCmdLinePlatform.cpp index ea1d871d..1f6b4e96 100644 --- a/Source/CmdLine/AuCmdLinePlatform.cpp +++ b/Source/CmdLine/AuCmdLinePlatform.cpp @@ -27,7 +27,7 @@ namespace Aurora::CmdLine for (int i = 0; i < argc; i++) { - gEntrypointString.push_back(argv[0]); + gEntrypointString.push_back(argv[i]); } } @@ -72,10 +72,10 @@ namespace Aurora::CmdLine { AuList ret; + #if defined(AURORA_PLATFORM_WIN32) + auto cmd = GetCommandLineW(); SysAssert(cmd); - - #if defined(AURORA_PLATFORM_WIN32) if (!pCommandLineToArgvW) { @@ -83,13 +83,20 @@ namespace Aurora::CmdLine } int count {}; - auto temp = pCommandLineToArgvW(cmd, &count); + auto pTemp = pCommandLineToArgvW(cmd, &count); for (int i = 0; i < count; i++) { - ret.push_back(Locale::ConvertFromWChar(temp[i])); + ret.push_back(Locale::ConvertFromWChar(pTemp[i])); } + LocalFree(pTemp); + + #elif defined(__argc) || defined(_CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY) + + InitCommandLineArguments(__argc, __argv); + return gEntrypointString; + #else // https://github.com/wine-mirror/wine/blob/7ec5f555b05152dda53b149d5994152115e2c623/dlls/shell32/shell32_main.c#L58