3
0
Fork 0
forked from suyu/suyu

es: Implement ETicket GetPersonalizedTicketSize (15)

Returns the size of the buffer needed to hold the personal ticket associated with the rights ID.
This commit is contained in:
Zach Hilman 2019-04-10 14:07:00 -04:00
parent 35b617b57f
commit 44b0c19f6a

View file

@ -30,7 +30,7 @@ public:
{12, &ETicket::ListPersonalizedTicket, "ListPersonalizedTicket"},
{13, nullptr, "ListMissingPersonalizedTicket"},
{14, &ETicket::GetCommonTicketSize, "GetCommonTicketSize"},
{15, nullptr, "GetPersonalizedTicketSize"},
{15, &ETicket::GetPersonalizedTicketSize, "GetPersonalizedTicketSize"},
{16, nullptr, "GetCommonTicketData"},
{17, nullptr, "GetPersonalizedTicketData"},
{18, nullptr, "OwnTicket"},
@ -206,6 +206,22 @@ private:
rb.Push<u64>(ticket.size());
}
void GetPersonalizedTicketSize(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto rights_id = rp.PopRaw<u128>();
LOG_DEBUG(Service_ETicket, "called, rights_id={:016X}{:016X}", rights_id[1], rights_id[0]);
if (!CheckRightsId(ctx, rights_id))
return;
const auto ticket = keys.GetPersonalizedTickets().at(rights_id);
IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
rb.Push<u64>(ticket.size());
}
};
void InstallInterfaces(SM::ServiceManager& service_manager) {