From 8a5d24ab4b6726637c279089204180c6b4fb8bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Thu, 17 Aug 2017 18:32:42 +0200 Subject: [PATCH] WFSI: Implement IOCTL_WFSI_IMPORT_TITLE_CANCEL. It gets called for cleaning up whenever something goes wrong, and also when cancelling an update. --- Source/Core/Core/IOS/WFS/WFSI.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/IOS/WFS/WFSI.cpp b/Source/Core/Core/IOS/WFS/WFSI.cpp index 2f609d1832..8a33d66721 100644 --- a/Source/Core/Core/IOS/WFS/WFSI.cpp +++ b/Source/Core/Core/IOS/WFS/WFSI.cpp @@ -312,8 +312,20 @@ IPCCommandResult WFSI::IOCtl(const IOCtlRequest& request) break; case IOCTL_WFSI_IMPORT_TITLE_CANCEL: - WARN_LOG(IOS_WFS, "IOCTL_WFSI_IMPORT_TITLE_CANCEL: unimplemented"); + { + INFO_LOG(IOS_WFS, "IOCTL_WFSI_IMPORT_TITLE_CANCEL"); + + bool continue_install = Memory::Read_U32(request.buffer_in) != 0; + if (m_patch_type == PatchType::NOT_A_PATCH) + return_error_code = CancelTitleImport(continue_install); + else if (m_patch_type == PatchType::PATCH_TYPE_1 || m_patch_type == PatchType::PATCH_TYPE_2) + return_error_code = CancelPatchImport(continue_install); + else + return_error_code = WFS_EINVAL; + + m_tmd = {}; break; + } case IOCTL_WFSI_INIT: {