diff --git a/src/core/kernel/exports/EmuKrnlHal.cpp b/src/core/kernel/exports/EmuKrnlHal.cpp index 0e934140f..6083dbeab 100644 --- a/src/core/kernel/exports/EmuKrnlHal.cpp +++ b/src/core/kernel/exports/EmuKrnlHal.cpp @@ -43,7 +43,6 @@ #include "common\EmuEEPROM.h" // For EEPROM #include "devices\Xbox.h" // For g_SMBus, SMBUS_ADDRESS_SYSTEM_MICRO_CONTROLLER #include "devices\SMCDevice.h" // For SMC_COMMAND_SCRATCH -#include "common/util/strConverter.hpp" // for utf16_to_ascii #include "core\kernel\memory-manager\VMManager.h" #include // for std::replace diff --git a/src/core/kernel/support/EmuFile.cpp b/src/core/kernel/support/EmuFile.cpp index 1977385ee..429819df1 100644 --- a/src/core/kernel/support/EmuFile.cpp +++ b/src/core/kernel/support/EmuFile.cpp @@ -40,7 +40,6 @@ #include #pragma warning(default:4005) #include "Logging.h" -#include "common/util/strConverter.hpp" // utf16_to_ascii #include "common/util/cliConfig.hpp" #include "common/CxbxDebugger.h" #include "EmuShared.h" @@ -790,20 +789,21 @@ std::string CxbxConvertXboxToHostPath(const std::string_view XboxDevicePath) std::wstring wXbePath; // We pretend to come from NtCreateFile to force symbolic link resolution CxbxConvertFilePath(XboxDevicePath.data(), wXbePath, &rootDirectoryHandle, "NtCreateFile"); - - // Convert Wide String as returned by above to a string, for XbePath - std::string XbePath = utf16_to_ascii(wXbePath.c_str()); + std::filesystem::path XbePath; // If the rootDirectoryHandle is not null, we have a relative path // We need to prepend the path of the root directory to get a full DOS path if (rootDirectoryHandle != nullptr) { WCHAR directoryPathBuffer[MAX_PATH]; GetFinalPathNameByHandleW(rootDirectoryHandle, directoryPathBuffer, MAX_PATH, VOLUME_NAME_DOS); - std::string directoryPath = utf16_to_ascii(directoryPathBuffer); - XbePath = directoryPath + std::string("\\") + XbePath; + XbePath = directoryPathBuffer; + XbePath /= wXbePath; + } + else { + XbePath = wXbePath; } - return XbePath; + return XbePath.string(); } int CxbxRegisterDeviceHostPath(const std::string_view XboxDevicePath, std::string HostDevicePath, bool IsFile, std::size_t size)