Service/AM: fix some headers

This commit is contained in:
wwylele 2018-03-01 17:58:31 +02:00
parent 61e5f320c9
commit 7c4ed77e06

View file

@ -476,7 +476,7 @@ Module::Interface::Interface(std::shared_ptr<Module> am, const char* name, u32 m
Module::Interface::~Interface() = default; Module::Interface::~Interface() = default;
void Module::Interface::GetNumPrograms(Kernel::HLERequestContext& ctx) { void Module::Interface::GetNumPrograms(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x1, 1, 0); // 0x00010040 IPC::RequestParser rp(ctx, 0x0001, 1, 0); // 0x00010040
u32 media_type = rp.Pop<u8>(); u32 media_type = rp.Pop<u8>();
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
@ -609,29 +609,29 @@ void Module::Interface::DeleteContents(Kernel::HLERequestContext& ctx) {
} }
void Module::Interface::GetProgramList(Kernel::HLERequestContext& ctx) { void Module::Interface::GetProgramList(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 2, 2, 2); // 0x00020082 IPC::RequestParser rp(ctx, 0x0002, 2, 2); // 0x00020082
u32 count = rp.Pop<u32>(); u32 count = rp.Pop<u32>();
u8 media_type = rp.Pop<u8>(); u8 media_type = rp.Pop<u8>();
auto& title_ids_output_pointer = rp.PopMappedBuffer(); auto& title_ids_output = rp.PopMappedBuffer();
if (media_type > 2) { if (media_type > 2) {
IPC::RequestBuilder rb = rp.MakeBuilder(2, 2); IPC::RequestBuilder rb = rp.MakeBuilder(2, 2);
rb.Push<u32>(-1); // TODO(shinyquagsire23): Find the right error code rb.Push<u32>(-1); // TODO(shinyquagsire23): Find the right error code
rb.Push<u32>(0); rb.Push<u32>(0);
rb.PushMappedBuffer(title_ids_output_pointer); rb.PushMappedBuffer(title_ids_output);
return; return;
} }
u32 media_count = static_cast<u32>(am->am_title_list[media_type].size()); u32 media_count = static_cast<u32>(am->am_title_list[media_type].size());
u32 copied = std::min(media_count, count); u32 copied = std::min(media_count, count);
title_ids_output_pointer.Write(am->am_title_list[media_type].data(), 0, copied * sizeof(u64)); title_ids_output.Write(am->am_title_list[media_type].data(), 0, copied * sizeof(u64));
IPC::RequestBuilder rb = rp.MakeBuilder(2, 2); IPC::RequestBuilder rb = rp.MakeBuilder(2, 2);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.Push(copied); rb.Push(copied);
rb.PushMappedBuffer(title_ids_output_pointer); rb.PushMappedBuffer(title_ids_output);
} }
ResultCode GetTitleInfoFromList(const std::vector<u64>& title_id_list, ResultCode GetTitleInfoFromList(const std::vector<u64>& title_id_list,
@ -663,7 +663,7 @@ ResultCode GetTitleInfoFromList(const std::vector<u64>& title_id_list,
} }
void Module::Interface::GetProgramInfos(Kernel::HLERequestContext& ctx) { void Module::Interface::GetProgramInfos(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 3, 2, 4); // 0x00030084 IPC::RequestParser rp(ctx, 0x0003, 2, 4); // 0x00030084
auto media_type = static_cast<Service::FS::MediaType>(rp.Pop<u8>()); auto media_type = static_cast<Service::FS::MediaType>(rp.Pop<u8>());
u32 title_count = rp.Pop<u32>(); u32 title_count = rp.Pop<u32>();
@ -682,7 +682,7 @@ void Module::Interface::GetProgramInfos(Kernel::HLERequestContext& ctx) {
} }
void Module::Interface::DeleteUserProgram(Kernel::HLERequestContext& ctx) { void Module::Interface::DeleteUserProgram(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x000400, 3, 0); IPC::RequestParser rp(ctx, 0x0004, 3, 0);
auto media_type = rp.PopEnum<FS::MediaType>(); auto media_type = rp.PopEnum<FS::MediaType>();
u32 low = rp.Pop<u32>(); u32 low = rp.Pop<u32>();
u32 high = rp.Pop<u32>(); u32 high = rp.Pop<u32>();
@ -836,7 +836,7 @@ void Module::Interface::GetDLCContentInfoCount(Kernel::HLERequestContext& ctx) {
} }
void Module::Interface::DeleteTicket(Kernel::HLERequestContext& ctx) { void Module::Interface::DeleteTicket(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 7, 2, 0); // 0x00070080 IPC::RequestParser rp(ctx, 0x0007, 2, 0); // 0x00070080
u64 title_id = rp.Pop<u64>(); u64 title_id = rp.Pop<u64>();
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
@ -845,7 +845,7 @@ void Module::Interface::DeleteTicket(Kernel::HLERequestContext& ctx) {
} }
void Module::Interface::GetNumTickets(Kernel::HLERequestContext& ctx) { void Module::Interface::GetNumTickets(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 8, 0, 0); // 0x00080000 IPC::RequestParser rp(ctx, 0x0008, 0, 0); // 0x00080000
u32 ticket_count = 0; u32 ticket_count = 0;
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
@ -855,7 +855,7 @@ void Module::Interface::GetNumTickets(Kernel::HLERequestContext& ctx) {
} }
void Module::Interface::GetTicketList(Kernel::HLERequestContext& ctx) { void Module::Interface::GetTicketList(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 9, 2, 2); // 0x00090082 IPC::RequestParser rp(ctx, 0x0009, 2, 2); // 0x00090082
u32 ticket_list_count = rp.Pop<u32>(); u32 ticket_list_count = rp.Pop<u32>();
u32 ticket_index = rp.Pop<u32>(); u32 ticket_index = rp.Pop<u32>();
auto& ticket_tids_out = rp.PopMappedBuffer(); auto& ticket_tids_out = rp.PopMappedBuffer();
@ -869,7 +869,7 @@ void Module::Interface::GetTicketList(Kernel::HLERequestContext& ctx) {
} }
void Module::Interface::QueryAvailableTitleDatabase(Kernel::HLERequestContext& ctx) { void Module::Interface::QueryAvailableTitleDatabase(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x19, 1, 0); // 0x190040 IPC::RequestParser rp(ctx, 0x0019, 1, 0); // 0x190040
u8 media_type = rp.Pop<u8>(); u8 media_type = rp.Pop<u8>();
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
@ -880,7 +880,7 @@ void Module::Interface::QueryAvailableTitleDatabase(Kernel::HLERequestContext& c
} }
void Module::Interface::CheckContentRights(Kernel::HLERequestContext& ctx) { void Module::Interface::CheckContentRights(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x25, 3, 0); // 0x2500C0 IPC::RequestParser rp(ctx, 0x0025, 3, 0); // 0x2500C0
u64 tid = rp.Pop<u64>(); u64 tid = rp.Pop<u64>();
u16 content_index = rp.Pop<u16>(); u16 content_index = rp.Pop<u16>();
@ -896,7 +896,7 @@ void Module::Interface::CheckContentRights(Kernel::HLERequestContext& ctx) {
} }
void Module::Interface::CheckContentRightsIgnorePlatform(Kernel::HLERequestContext& ctx) { void Module::Interface::CheckContentRightsIgnorePlatform(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x2D, 3, 0); // 0x2D00C0 IPC::RequestParser rp(ctx, 0x002D, 3, 0); // 0x2D00C0
u64 tid = rp.Pop<u64>(); u64 tid = rp.Pop<u64>();
u16 content_index = rp.Pop<u16>(); u16 content_index = rp.Pop<u16>();