diff options
| author | 2019-04-10 14:07:49 -0400 | |
|---|---|---|
| committer | 2019-07-07 21:38:33 -0400 | |
| commit | c6a32dc077f3d55421898294ada0a5fe93400b9e (patch) | |
| tree | 21593192a8c19f5f335dcbdb48f2a9b93960d3a8 /src | |
| parent | es: Implement ETicket GetPersonalizedTicketSize (15) (diff) | |
| download | yuzu-c6a32dc077f3d55421898294ada0a5fe93400b9e.tar.gz yuzu-c6a32dc077f3d55421898294ada0a5fe93400b9e.tar.xz yuzu-c6a32dc077f3d55421898294ada0a5fe93400b9e.zip | |
es: Implement ETicket GetCommonTicketData (16)
Copies the raw common ticket data for the specified rights ID into the buffer provided.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/es/es.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp index e18f27e7a..8a29453d7 100644 --- a/src/core/hle/service/es/es.cpp +++ b/src/core/hle/service/es/es.cpp | |||
| @@ -31,7 +31,7 @@ public: | |||
| 31 | {13, nullptr, "ListMissingPersonalizedTicket"}, | 31 | {13, nullptr, "ListMissingPersonalizedTicket"}, |
| 32 | {14, &ETicket::GetCommonTicketSize, "GetCommonTicketSize"}, | 32 | {14, &ETicket::GetCommonTicketSize, "GetCommonTicketSize"}, |
| 33 | {15, &ETicket::GetPersonalizedTicketSize, "GetPersonalizedTicketSize"}, | 33 | {15, &ETicket::GetPersonalizedTicketSize, "GetPersonalizedTicketSize"}, |
| 34 | {16, nullptr, "GetCommonTicketData"}, | 34 | {16, &ETicket::GetCommonTicketData, "GetCommonTicketData"}, |
| 35 | {17, nullptr, "GetPersonalizedTicketData"}, | 35 | {17, nullptr, "GetPersonalizedTicketData"}, |
| 36 | {18, nullptr, "OwnTicket"}, | 36 | {18, nullptr, "OwnTicket"}, |
| 37 | {19, nullptr, "GetTicketInfo"}, | 37 | {19, nullptr, "GetTicketInfo"}, |
| @@ -222,6 +222,25 @@ private: | |||
| 222 | rb.Push<u64>(ticket.size()); | 222 | rb.Push<u64>(ticket.size()); |
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | void GetCommonTicketData(Kernel::HLERequestContext& ctx) { | ||
| 226 | IPC::RequestParser rp{ctx}; | ||
| 227 | const auto rights_id = rp.PopRaw<u128>(); | ||
| 228 | |||
| 229 | LOG_DEBUG(Service_ETicket, "called, rights_id={:016X}{:016X}", rights_id[1], rights_id[0]); | ||
| 230 | |||
| 231 | if (!CheckRightsId(ctx, rights_id)) | ||
| 232 | return; | ||
| 233 | |||
| 234 | const auto ticket = keys.GetCommonTickets().at(rights_id); | ||
| 235 | |||
| 236 | const auto write_size = std::min(ticket.size(), ctx.GetWriteBufferSize()); | ||
| 237 | ctx.WriteBuffer(ticket.data(), write_size); | ||
| 238 | |||
| 239 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 240 | rb.Push(RESULT_SUCCESS); | ||
| 241 | rb.Push<u64>(write_size); | ||
| 242 | } | ||
| 243 | |||
| 225 | }; | 244 | }; |
| 226 | 245 | ||
| 227 | void InstallInterfaces(SM::ServiceManager& service_manager) { | 246 | void InstallInterfaces(SM::ServiceManager& service_manager) { |