emufile: fix multi-xbe titles when running through xbox-iso-vfs

Prior to this commit, the relaunch path would become corrupted when running a game mounted with xbox-iso-vfs.
This commit is contained in:
Luke Usher 2022-07-08 20:37:32 +01:00
parent 16ffe3a80f
commit 4edd3feb3e
1 changed files with 4 additions and 3 deletions

View File

@ -797,9 +797,10 @@ std::string CxbxConvertXboxToHostPath(const std::string_view XboxDevicePath)
// 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) {
char directoryPathBuffer[MAX_PATH];
GetFinalPathNameByHandle(rootDirectoryHandle, directoryPathBuffer, MAX_PATH, VOLUME_NAME_DOS);
XbePath = directoryPathBuffer + std::string("\\") + XbePath;
WCHAR directoryPathBuffer[MAX_PATH];
GetFinalPathNameByHandleW(rootDirectoryHandle, directoryPathBuffer, MAX_PATH, VOLUME_NAME_DOS);
std::string directoryPath = utf16_to_ascii(directoryPathBuffer);
XbePath = directoryPath + std::string("\\") + XbePath;
}
return XbePath;