Services/AM: Rename and readjust GetNumContentInfos for accuracy

This commit is contained in:
shinyquagsire23 2017-11-06 17:49:39 -07:00
parent d854d4119a
commit c07f1b275c
4 changed files with 17 additions and 5 deletions

View File

@ -701,11 +701,21 @@ void ListDataTitleTicketInfos(Service::Interface* self) {
ticket_count, title_id, start_index, ticket_info_out);
}
void GetNumContentInfos(Service::Interface* self) {
void GetDLCContentInfoCount(Service::Interface* self) {
IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x1001, 3, 0); // 0x100100C0
auto media_type = static_cast<Service::FS::MediaType>(rp.Pop<u8>());
u64 title_id = rp.Pop<u64>();
// Validate that only DLC TIDs are passed in
u32 tid_high = static_cast<u32>(title_id >> 32);
if (tid_high != TID_HIGH_DLC) {
IPC::RequestBuilder rb = rp.MakeBuilder(2, 2);
rb.Push(ResultCode(ErrCodes::InvalidTID, ErrorModule::AM, ErrorSummary::InvalidArgument,
ErrorLevel::Usage));
rb.Push<u32>(0);
return;
}
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
rb.Push(RESULT_SUCCESS); // No error

View File

@ -22,6 +22,7 @@ namespace AM {
namespace ErrCodes {
enum {
CIACurrentlyInstalling = 4,
InvalidTID = 31,
EmptyCIA = 32,
InvalidTIDInList = 60,
InvalidCIAHeader = 104,
@ -204,7 +205,8 @@ void GetPatchTitleInfos(Service::Interface* self);
void ListDataTitleTicketInfos(Service::Interface* self);
/**
* AM::GetNumContentInfos service function
* AM::GetDLCContentInfoCount service function
* Explicitly checks that TID high value is 0004008C or an error is returned.
* Inputs:
* 0 : Command header (0x100100C0)
* 1 : MediaType
@ -213,7 +215,7 @@ void ListDataTitleTicketInfos(Service::Interface* self);
* 1 : Result, 0 on success, otherwise error code
* 2 : Number of content infos plus one
*/
void GetNumContentInfos(Service::Interface* self);
void GetDLCContentInfoCount(Service::Interface* self);
/**
* AM::DeleteTicket service function

View File

@ -9,7 +9,7 @@ namespace Service {
namespace AM {
const Interface::FunctionInfo FunctionTable[] = {
{0x100100C0, GetNumContentInfos, "GetNumContentInfos"},
{0x100100C0, GetDLCContentInfoCount, "GetDLCContentInfoCount"},
{0x10020104, FindDLCContentInfos, "FindDLCContentInfos"},
{0x10030142, ListDLCContentInfos, "ListDLCContentInfos"},
{0x10040102, DeleteContents, "DeleteContents"},

View File

@ -54,7 +54,7 @@ const Interface::FunctionInfo FunctionTable[] = {
{0x002B0142, nullptr, "ListExistingContentInfosSystem"},
{0x002C0084, nullptr, "GetProgramInfosIgnorePlatform"},
{0x002D00C0, CheckContentRightsIgnorePlatform, "CheckContentRightsIgnorePlatform"},
{0x100100C0, GetNumContentInfos, "GetNumContentInfos"},
{0x100100C0, GetDLCContentInfoCount, "GetDLCContentInfoCount"},
{0x10020104, FindDLCContentInfos, "FindDLCContentInfos"},
{0x10030142, ListDLCContentInfos, "ListDLCContentInfos"},
{0x10040102, DeleteContents, "DeleteContents"},