diff options
| author | 2017-07-21 13:19:55 -0500 | |
|---|---|---|
| committer | 2017-07-21 14:59:26 -0500 | |
| commit | 68596a706860f37de876ca070f9de6e664df0d05 (patch) | |
| tree | 32f3f28f25a32f19adca39034f021ec154eb68b1 | |
| parent | Services/APT: Reset the APT parameter inside CancelParameter if the condition... (diff) | |
| download | yuzu-68596a706860f37de876ca070f9de6e664df0d05.tar.gz yuzu-68596a706860f37de876ca070f9de6e664df0d05.tar.xz yuzu-68596a706860f37de876ca070f9de6e664df0d05.zip | |
Services/APT: Return the proper error code when calling SendParameter with an outstanding parameter already in memory.
| -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) { | |||
| 192 | 192 | ||
| 193 | IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); | 193 | IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); |
| 194 | 194 | ||
| 195 | // A new parameter can not be sent if the previous one hasn't been consumed yet | ||
| 196 | if (next_parameter) { | ||
| 197 | rb.Push(ResultCode(ErrCodes::ParameterPresent, ErrorModule::Applet, | ||
| 198 | ErrorSummary::InvalidState, ErrorLevel::Status)); | ||
| 199 | return; | ||
| 200 | } | ||
| 201 | |||
| 195 | if (dest_applet == nullptr) { | 202 | if (dest_applet == nullptr) { |
| 196 | LOG_ERROR(Service_APT, "Unknown applet id=0x%08X", dst_app_id); | 203 | LOG_ERROR(Service_APT, "Unknown applet id=0x%08X", dst_app_id); |
| 197 | rb.Push<u32>(-1); // TODO(Subv): Find the right error code | 204 | rb.Push<u32>(-1); // TODO(Subv): Find the right error code |
| @@ -208,10 +215,10 @@ void SendParameter(Service::Interface* self) { | |||
| 208 | 215 | ||
| 209 | rb.Push(dest_applet->ReceiveParameter(param)); | 216 | rb.Push(dest_applet->ReceiveParameter(param)); |
| 210 | 217 | ||
| 211 | LOG_WARNING(Service_APT, | 218 | LOG_DEBUG(Service_APT, |
| 212 | "(STUBBED) called src_app_id=0x%08X, dst_app_id=0x%08X, signal_type=0x%08X," | 219 | "called src_app_id=0x%08X, dst_app_id=0x%08X, signal_type=0x%08X," |
| 213 | "buffer_size=0x%08X, handle=0x%08X, size=0x%08zX, in_param_buffer_ptr=0x%08X", | 220 | "buffer_size=0x%08X, handle=0x%08X, size=0x%08zX, in_param_buffer_ptr=0x%08X", |
| 214 | src_app_id, dst_app_id, signal_type, buffer_size, handle, size, buffer); | 221 | src_app_id, dst_app_id, signal_type, buffer_size, handle, size, buffer); |
| 215 | } | 222 | } |
| 216 | 223 | ||
| 217 | void ReceiveParameter(Service::Interface* self) { | 224 | 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 { | |||
| 116 | DisableScreenshotPostingToMiiverse = 3 | 116 | DisableScreenshotPostingToMiiverse = 3 |
| 117 | }; | 117 | }; |
| 118 | 118 | ||
| 119 | namespace ErrCodes { | ||
| 120 | enum { | ||
| 121 | ParameterPresent = 2, | ||
| 122 | }; | ||
| 123 | } | ||
| 124 | |||
| 119 | /// Send a parameter to the currently-running application, which will read it via ReceiveParameter | 125 | /// Send a parameter to the currently-running application, which will read it via ReceiveParameter |
| 120 | void SendParameter(const MessageParameter& parameter); | 126 | void SendParameter(const MessageParameter& parameter); |
| 121 | 127 | ||