summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2017-07-21 20:09:45 +0200
committerSubv <subv2112@gmail.com>2017-07-21 21:59:25 +0200
commita9bc417f5948dc63f182d31e4ba271aa23efe84d (patch)
tree9d72a9ab1381a7a0d1c1b90f47eeb43043e1b2b8 /src
parentServices/APT: Properly clear the apt parameter after a successful ReceiveParameter call. (diff)
downloadyuzu-a9bc417f5948dc63f182d31e4ba271aa23efe84d.tar
yuzu-a9bc417f5948dc63f182d31e4ba271aa23efe84d.tar.gz
yuzu-a9bc417f5948dc63f182d31e4ba271aa23efe84d.tar.bz2
yuzu-a9bc417f5948dc63f182d31e4ba271aa23efe84d.tar.lz
yuzu-a9bc417f5948dc63f182d31e4ba271aa23efe84d.tar.xz
yuzu-a9bc417f5948dc63f182d31e4ba271aa23efe84d.tar.zst
yuzu-a9bc417f5948dc63f182d31e4ba271aa23efe84d.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/apt/apt.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp
index b6c013d43..9cfb7f71e 100644
--- a/src/core/hle/service/apt/apt.cpp
+++ b/src/core/hle/service/apt/apt.cpp
@@ -314,17 +314,34 @@ void GlanceParameter(Service::Interface* self) {
void CancelParameter(Service::Interface* self) {
IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0xF, 4, 0); // 0xF0100
- u32 check_sender = rp.Pop<u32>();
+ bool check_sender = rp.Pop<bool>();
u32 sender_appid = rp.Pop<u32>();
- u32 check_receiver = rp.Pop<u32>();
+ bool check_receiver = rp.Pop<bool>();
u32 receiver_appid = rp.Pop<u32>();
+
+ bool cancellation_success = true;
+
+ if (!next_parameter) {
+ cancellation_success = false;
+ } else {
+ if (check_sender && next_parameter->sender_id != sender_appid)
+ cancellation_success = false;
+
+ if (check_receiver && next_parameter->destination_id != receiver_appid)
+ cancellation_success = false;
+ }
+
+ if (cancellation_success)
+ next_parameter = boost::none;
+
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
+
rb.Push(RESULT_SUCCESS); // No error
- rb.Push(true); // Set to Success
+ rb.Push(cancellation_success);
- LOG_WARNING(Service_APT, "(STUBBED) called check_sender=0x%08X, sender_appid=0x%08X, "
- "check_receiver=0x%08X, receiver_appid=0x%08X",
- check_sender, sender_appid, check_receiver, receiver_appid);
+ LOG_DEBUG(Service_APT, "called check_sender=%u, sender_appid=0x%08X, "
+ "check_receiver=%u, receiver_appid=0x%08X",
+ check_sender, sender_appid, check_receiver, receiver_appid);
}
void PrepareToStartApplication(Service::Interface* self) {