diff options
| author | 2017-07-21 13:02:40 -0500 | |
|---|---|---|
| committer | 2017-07-21 14:59:21 -0500 | |
| commit | 2dc720c355dad55a607c1f993fc823cc198bed08 (patch) | |
| tree | 9a4be495c430689a33c041959e5f15c971a4669e /src | |
| parent | Services/APT: Use boost::optional for the APT parameter structure. (diff) | |
| download | yuzu-2dc720c355dad55a607c1f993fc823cc198bed08.tar.gz yuzu-2dc720c355dad55a607c1f993fc823cc198bed08.tar.xz yuzu-2dc720c355dad55a607c1f993fc823cc198bed08.zip | |
Services/APT: Use the right error codes in ReceiveParameter and GlanceParameter when the parameter doesn't exist.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/apt/apt.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index e4068926a..b5748693f 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp | |||
| @@ -227,6 +227,20 @@ void ReceiveParameter(Service::Interface* self) { | |||
| 227 | "buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)", | 227 | "buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)", |
| 228 | buffer_size, static_buff_size); | 228 | buffer_size, static_buff_size); |
| 229 | 229 | ||
| 230 | if (!next_parameter) { | ||
| 231 | IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); | ||
| 232 | rb.Push(ResultCode(ErrorDescription::NoData, ErrorModule::Applet, | ||
| 233 | ErrorSummary::InvalidState, ErrorLevel::Status)); | ||
| 234 | return; | ||
| 235 | } | ||
| 236 | |||
| 237 | if (next_parameter->destination_id != app_id) { | ||
| 238 | IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); | ||
| 239 | rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound, | ||
| 240 | ErrorLevel::Status)); | ||
| 241 | return; | ||
| 242 | } | ||
| 243 | |||
| 230 | IPC::RequestBuilder rb = rp.MakeBuilder(4, 4); | 244 | IPC::RequestBuilder rb = rp.MakeBuilder(4, 4); |
| 231 | 245 | ||
| 232 | rb.Push(RESULT_SUCCESS); // No error | 246 | rb.Push(RESULT_SUCCESS); // No error |
| @@ -259,6 +273,20 @@ void GlanceParameter(Service::Interface* self) { | |||
| 259 | "buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)", | 273 | "buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)", |
| 260 | buffer_size, static_buff_size); | 274 | buffer_size, static_buff_size); |
| 261 | 275 | ||
| 276 | if (!next_parameter) { | ||
| 277 | IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); | ||
| 278 | rb.Push(ResultCode(ErrorDescription::NoData, ErrorModule::Applet, | ||
| 279 | ErrorSummary::InvalidState, ErrorLevel::Status)); | ||
| 280 | return; | ||
| 281 | } | ||
| 282 | |||
| 283 | if (next_parameter->destination_id != app_id) { | ||
| 284 | IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); | ||
| 285 | rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound, | ||
| 286 | ErrorLevel::Status)); | ||
| 287 | return; | ||
| 288 | } | ||
| 289 | |||
| 262 | IPC::RequestBuilder rb = rp.MakeBuilder(4, 4); | 290 | IPC::RequestBuilder rb = rp.MakeBuilder(4, 4); |
| 263 | rb.Push(RESULT_SUCCESS); // No error | 291 | rb.Push(RESULT_SUCCESS); // No error |
| 264 | rb.Push(next_parameter->sender_id); | 292 | rb.Push(next_parameter->sender_id); |