Refactor main module resolution & HMODULE handle behavior

This commit is contained in:
2025-09-29 13:50:27 -06:00
parent 4a2ba45620
commit c17953b318
13 changed files with 355 additions and 224 deletions

View File

@@ -169,8 +169,8 @@ namespace msvcrt {
std::string converted = files::hostPathListToWindows(value);
std::string result = converted.empty() ? value : converted;
std::string exeDir;
if (wibo::argv && wibo::argv[0]) {
std::filesystem::path exePath = std::filesystem::absolute(std::filesystem::path(wibo::argv[0])).parent_path();
if (!wibo::guestExecutablePath.empty()) {
auto exePath = wibo::guestExecutablePath.parent_path();
if (!exePath.empty()) {
exeDir = files::pathToWindows(exePath);
}