From 11f45e60159cdd215158e2c60ac08ed4e5a07439 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Wed, 10 Apr 2019 14:03:08 -0400 Subject: es: Implement ETicket CountPersonalizedTicket (10) Returns the number of personalized (console/user-unique) tickets in the KeyManager. --- src/core/hle/service/es/es.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp index 1c6aef029..9adb39ac3 100644 --- a/src/core/hle/service/es/es.cpp +++ b/src/core/hle/service/es/es.cpp @@ -25,7 +25,7 @@ public: {7, nullptr, "DeleteAllPersonalizedTicketEx"}, {8, &ETicket::GetTitleKey, "GetTitleKey"}, {9, &ETicket::CountCommonTicket, "CountCommonTicket"}, - {10, nullptr, "CountPersonalizedTicket"}, + {10, &ETicket::CountPersonalizedTicket, "CountPersonalizedTicket"}, {11, nullptr, "ListCommonTicket"}, {12, nullptr, "ListPersonalizedTicket"}, {13, nullptr, "ListMissingPersonalizedTicket"}, @@ -133,6 +133,17 @@ private: rb.Push(count); } + void CountPersonalizedTicket(Kernel::HLERequestContext& ctx) { + LOG_DEBUG(Service_ETicket, "called"); + + keys.PopulateTickets(); + const auto count = keys.GetPersonalizedTickets().size(); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(RESULT_SUCCESS); + rb.Push(count); + } + }; void InstallInterfaces(SM::ServiceManager& service_manager) { -- cgit v1.2.3