diff options
| author | admin <s0las16.224@gmail.com> | 2026-11-22 17:27:41 +0000 |
|---|---|---|
| committer | admin <s0las16.224@gmail.com> | 2026-11-22 17:27:41 +0000 |
| commit | abc889f5ecb1e536489c0ebaff90073434f6d425 (patch) | |
| tree | 5b04698fd8ae5eea080f8e410ec00e2dd9fefbb0 /runtime/src/main.cpp | |
| parent | 49475796c226c8511b9470bf97a4daf57b8af323 (diff) | |
Initialize game command line before process-attach callbacks
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Diffstat (limited to 'runtime/src/main.cpp')
| -rw-r--r-- | runtime/src/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index 06baae387..7bc2d78ab 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp | |||
| @@ -94,6 +94,7 @@ int wmain(int argc, wchar_t** argv) { | |||
| 94 | try { | 94 | try { |
| 95 | rt::Loader loader(game_dir); | 95 | rt::Loader loader(game_dir); |
| 96 | rt::Module& main_module = loader.load(image); // maps, binds and installs TLS; runs no image code | 96 | rt::Module& main_module = loader.load(image); // maps, binds and installs TLS; runs no image code |
| 97 | if (run) rt::process::set_command_line(image.filename().wstring(), game_args); | ||
| 97 | if (init || run) { | 98 | if (init || run) { |
| 98 | loader.initialise(); // TLS callbacks, then DllMain(DLL_PROCESS_ATTACH) for DLLs | 99 | loader.initialise(); // TLS callbacks, then DllMain(DLL_PROCESS_ATTACH) for DLLs |
| 99 | std::printf("%zu module(s) initialised\n", loader.modules().size()); | 100 | std::printf("%zu module(s) initialised\n", loader.modules().size()); |
| @@ -128,7 +129,6 @@ int wmain(int argc, wchar_t** argv) { | |||
| 128 | std::fprintf(stderr, "error: %s has no entry point\n", main_module.name.c_str()); | 129 | std::fprintf(stderr, "error: %s has no entry point\n", main_module.name.c_str()); |
| 129 | return 1; | 130 | return 1; |
| 130 | } | 131 | } |
| 131 | rt::process::set_command_line(image.filename().wstring(), game_args); | ||
| 132 | std::printf("console paths: GAME: -> %ls, writes -> %ls\n", game_dir.c_str(), overlay_dir.c_str()); | 132 | std::printf("console paths: GAME: -> %ls, writes -> %ls\n", game_dir.c_str(), overlay_dir.c_str()); |
| 133 | std::printf("running %s\n", main_module.name.c_str()); | 133 | std::printf("running %s\n", main_module.name.c_str()); |
| 134 | std::fflush(stdout); | 134 | std::fflush(stdout); |