diff options
author | Subv <subv2112@gmail.com> | 2017-07-21 20:19:55 +0200 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2017-07-21 21:59:26 +0200 |
commit | 68596a706860f37de876ca070f9de6e664df0d05 (patch) | |
tree | 32f3f28f25a32f19adca39034f021ec154eb68b1 | |
parent | Services/APT: Reset the APT parameter inside CancelParameter if the conditions are met. (diff) | |
download | yuzu-68596a706860f37de876ca070f9de6e664df0d05.tar yuzu-68596a706860f37de876ca070f9de6e664df0d05.tar.gz yuzu-68596a706860f37de876ca070f9de6e664df0d05.tar.bz2 yuzu-68596a706860f37de876ca070f9de6e664df0d05.tar.lz yuzu-68596a706860f37de876ca070f9de6e664df0d05.tar.xz yuzu-68596a706860f37de876ca070f9de6e664df0d05.tar.zst yuzu-68596a706860f37de876ca070f9de6e664df0d05.zip |
-rw-r--r-- | src/core/hle/service/apt/apt.cpp | 15 | ||||
-rw-r--r-- | src/core/hle/service/apt/apt.h | 6 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 9cfb7f71e..987fb0992 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -192,6 +192,13 @@ void SendParameter(Service::Interface* self) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); + // A new parameter can not be sent if the previous one hasn't been consumed yet + if (next_parameter) { + rb.Push(ResultCode(ErrCodes::ParameterPresent, ErrorModule::Applet, + ErrorSummary::InvalidState, ErrorLevel::Status)); + return; + } + if (dest_applet == nullptr) { LOG_ERROR(Service_APT, "Unknown applet id=0x%08X", dst_app_id); rb.Push<u32>(-1); // TODO(Subv): Find the right error code @@ -208,10 +215,10 @@ void SendParameter(Service::Interface* self) { rb.Push(dest_applet->ReceiveParameter(param)); - LOG_WARNING(Service_APT, - "(STUBBED) called src_app_id=0x%08X, dst_app_id=0x%08X, signal_type=0x%08X," - "buffer_size=0x%08X, handle=0x%08X, size=0x%08zX, in_param_buffer_ptr=0x%08X", - src_app_id, dst_app_id, signal_type, buffer_size, handle, size, buffer); + LOG_DEBUG(Service_APT, + "called src_app_id=0x%08X, dst_app_id=0x%08X, signal_type=0x%08X," + "buffer_size=0x%08X, handle=0x%08X, size=0x%08zX, in_param_buffer_ptr=0x%08X", + src_app_id, dst_app_id, signal_type, buffer_size, handle, size, buffer); } void ReceiveParameter(Service::Interface* self) { diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h index ee80926d2..106754853 100644 --- a/src/core/hle/service/apt/apt.h +++ b/src/core/hle/service/apt/apt.h @@ -116,6 +116,12 @@ enum class ScreencapPostPermission : u32 { DisableScreenshotPostingToMiiverse = 3 }; +namespace ErrCodes { +enum { + ParameterPresent = 2, +}; +} + /// Send a parameter to the currently-running application, which will read it via ReceiveParameter void SendParameter(const MessageParameter& parameter); |