mirror of
https://gitlab.com/suyu-emu/suyu.git
synced 2024-03-15 23:15:44 +00:00
Services/APT: Use the right error codes in ReceiveParameter and GlanceParameter when the parameter doesn't exist.
This commit is contained in:
parent
5682608df7
commit
2dc720c355
|
@ -227,6 +227,20 @@ void ReceiveParameter(Service::Interface* self) {
|
||||||
"buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)",
|
"buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)",
|
||||||
buffer_size, static_buff_size);
|
buffer_size, static_buff_size);
|
||||||
|
|
||||||
|
if (!next_parameter) {
|
||||||
|
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||||
|
rb.Push(ResultCode(ErrorDescription::NoData, ErrorModule::Applet,
|
||||||
|
ErrorSummary::InvalidState, ErrorLevel::Status));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (next_parameter->destination_id != app_id) {
|
||||||
|
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||||
|
rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound,
|
||||||
|
ErrorLevel::Status));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
IPC::RequestBuilder rb = rp.MakeBuilder(4, 4);
|
IPC::RequestBuilder rb = rp.MakeBuilder(4, 4);
|
||||||
|
|
||||||
rb.Push(RESULT_SUCCESS); // No error
|
rb.Push(RESULT_SUCCESS); // No error
|
||||||
|
@ -259,6 +273,20 @@ void GlanceParameter(Service::Interface* self) {
|
||||||
"buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)",
|
"buffer_size is bigger than the size in the buffer descriptor (0x%08X > 0x%08zX)",
|
||||||
buffer_size, static_buff_size);
|
buffer_size, static_buff_size);
|
||||||
|
|
||||||
|
if (!next_parameter) {
|
||||||
|
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||||
|
rb.Push(ResultCode(ErrorDescription::NoData, ErrorModule::Applet,
|
||||||
|
ErrorSummary::InvalidState, ErrorLevel::Status));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (next_parameter->destination_id != app_id) {
|
||||||
|
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
|
||||||
|
rb.Push(ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, ErrorSummary::NotFound,
|
||||||
|
ErrorLevel::Status));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
IPC::RequestBuilder rb = rp.MakeBuilder(4, 4);
|
IPC::RequestBuilder rb = rp.MakeBuilder(4, 4);
|
||||||
rb.Push(RESULT_SUCCESS); // No error
|
rb.Push(RESULT_SUCCESS); // No error
|
||||||
rb.Push(next_parameter->sender_id);
|
rb.Push(next_parameter->sender_id);
|
||||||
|
|
Loading…
Reference in a new issue