[XAM] let swapdisk request be cancelled (fixes GTAV)
This commit is contained in:
parent
b7bd389a27
commit
0d8428c772
|
@ -501,6 +501,13 @@ static_assert_size(X_SWAPDISC_ERROR_MESSAGE, 12);
|
|||
dword_result_t XamSwapDisc(dword_t disc_number,
|
||||
pointer_t<X_KEVENT> completion_handle,
|
||||
pointer_t<X_SWAPDISC_ERROR_MESSAGE> error_message) {
|
||||
std::u16string text_message = xe::load_and_swap<std::u16string>(
|
||||
kernel_state()->memory()->TranslateVirtual(error_message->stringTextPtr));
|
||||
const std::filesystem::path new_disc_path =
|
||||
kernel_state()->emulator()->GetNewDiscPath(xe::to_utf8(text_message));
|
||||
XELOGI("GetNewDiscPath returned path {}.", new_disc_path.string().c_str());
|
||||
if (new_disc_path != L"") {
|
||||
|
||||
auto filesystem = kernel_state()->file_system();
|
||||
auto mount_path = "\\Device\\LauncherData";
|
||||
|
||||
|
@ -508,16 +515,13 @@ dword_result_t XamSwapDisc(dword_t disc_number,
|
|||
filesystem->UnregisterDevice(mount_path);
|
||||
}
|
||||
|
||||
std::u16string text_message = xe::load_and_swap<std::u16string>(
|
||||
kernel_state()->memory()->TranslateVirtual(error_message->stringTextPtr));
|
||||
|
||||
const std::filesystem::path new_disc_path =
|
||||
kernel_state()->emulator()->GetNewDiscPath(xe::to_utf8(text_message));
|
||||
XELOGI("GetNewDiscPath returned path {}.", new_disc_path.string().c_str());
|
||||
|
||||
// TODO(Gliniak): Implement checking if inserted file is requested one
|
||||
kernel_state()->emulator()->LaunchPath(new_disc_path, true);
|
||||
|
||||
}
|
||||
// Resolve the pending disc swap event
|
||||
auto kevent = xboxkrnl::xeKeSetEvent(completion_handle, 1, 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue