diff options
| author | thibaut <thibaut-leaux-angeli@live.fr> | 2026-11-23 17:23:22 +0100 |
|---|---|---|
| committer | thibaut <thibaut-leaux-angeli@live.fr> | 2026-11-23 17:23:22 +0100 |
| commit | 626beeb8f77e0c0dbf4c1743a0e11b53336fc7b3 (patch) | |
| tree | 6cf928107ad75efa279527d60bf914563a051064 /runtime/src/main.cpp | |
| parent | a32330f561ea6088900a4abb61af9b5dd216d5ef (diff) | |
| parent | 8575d36edc479218972497a7bded8651a42856c0 (diff) | |
Merge remote-tracking branch 'origin/main' into slot133-host-va
# Conflicts:
# runtime/shims/d3d12_xs_device.cpp
Diffstat (limited to 'runtime/src/main.cpp')
| -rw-r--r-- | runtime/src/main.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index b75baf15f..71a5b44e1 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | #include <cstdio> | 21 | #include <cstdio> |
| 22 | #include <cstdlib> | 22 | #include <cstdlib> |
| 23 | #include <exception> | ||
| 23 | #include <filesystem> | 24 | #include <filesystem> |
| 24 | #include <map> | 25 | #include <map> |
| 25 | #include <string> | 26 | #include <string> |
| @@ -179,9 +180,15 @@ int wmain(int argc, wchar_t** argv) { | |||
| 179 | r.error); | 180 | r.error); |
| 180 | } | 181 | } |
| 181 | if (run) rt::process::set_command_line(image.filename().wstring(), game_args); | 182 | if (run) rt::process::set_command_line(image.filename().wstring(), game_args); |
| 183 | std::exception_ptr init_failure; | ||
| 182 | if (init || run) { | 184 | if (init || run) { |
| 183 | loader.initialise(); // TLS callbacks, then DllMain(DLL_PROCESS_ATTACH) for DLLs | 185 | try { |
| 184 | std::printf("%zu module(s) initialised\n", loader.modules().size()); | 186 | loader.initialise(); // TLS callbacks, then DllMain(DLL_PROCESS_ATTACH) for DLLs |
| 187 | std::printf("%zu module(s) initialised\n", loader.modules().size()); | ||
| 188 | } catch (const std::exception&) { | ||
| 189 | // Keep the mapped modules available for the binding report on an attach failure. | ||
| 190 | init_failure = std::current_exception(); | ||
| 191 | } | ||
| 185 | } | 192 | } |
| 186 | int unimplemented = 0, unimplemented_hresult = 0; | 193 | int unimplemented = 0, unimplemented_hresult = 0; |
| 187 | for (auto* m : loader.modules()) { | 194 | for (auto* m : loader.modules()) { |
| @@ -205,6 +212,10 @@ int wmain(int argc, wchar_t** argv) { | |||
| 205 | std::printf("%zu module(s) mapped, %d unimplemented import(s)\n", loader.modules().size(), unimplemented); | 212 | std::printf("%zu module(s) mapped, %d unimplemented import(s)\n", loader.modules().size(), unimplemented); |
| 206 | std::printf("unimplemented by return policy: hresult=%d other=%d\n", unimplemented_hresult, | 213 | std::printf("unimplemented by return policy: hresult=%d other=%d\n", unimplemented_hresult, |
| 207 | unimplemented - unimplemented_hresult); | 214 | unimplemented - unimplemented_hresult); |
| 215 | if (init_failure) { | ||
| 216 | std::fflush(stdout); | ||
| 217 | std::rethrow_exception(init_failure); | ||
| 218 | } | ||
| 208 | if (!run) { | 219 | if (!run) { |
| 209 | rt::startup_trace::event("exit", "\"code\":0"); | 220 | rt::startup_trace::event("exit", "\"code\":0"); |
| 210 | return 0; | 221 | return 0; |