Merge pull request #281 from Steveice10/master
Minor am:net corrections and additions.
This commit is contained in:
commit
19175f7de3
@ -311,20 +311,21 @@ Result AM_InstallTicketBegin(Handle *ticketHandle);
|
|||||||
Result AM_InstallTicketAbort(Handle ticketHandle);
|
Result AM_InstallTicketAbort(Handle ticketHandle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Finalizes installing a ticket.
|
* @brief Finishes installing a ticket.
|
||||||
* @param ticketHandle Handle of the installation to finalize.
|
* @param ticketHandle Handle of the installation to finalize.
|
||||||
*/
|
*/
|
||||||
Result AM_InstallTicketFinalize(Handle ticketHandle);
|
Result AM_InstallTicketFinish(Handle ticketHandle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Begins installing a title.
|
* @brief Begins installing a title.
|
||||||
* @param mediaType Destination to install to.
|
* @param mediaType Destination to install to.
|
||||||
* @param titleId ID of the title to install.
|
* @param titleId ID of the title to install.
|
||||||
|
* @param unk Unknown. (usually false)
|
||||||
*/
|
*/
|
||||||
Result AM_InstallTitleBegin(FS_MediaType mediaType, u64 titleId);
|
Result AM_InstallTitleBegin(FS_MediaType mediaType, u64 titleId, bool unk);
|
||||||
|
|
||||||
/// Aborts installing a title.
|
/// Stops installing a title, generally to be resumed later.
|
||||||
Result AM_InstallTitleAbort();
|
Result AM_InstallTitleStop();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Resumes installing a title.
|
* @brief Resumes installing a title.
|
||||||
@ -333,12 +334,21 @@ Result AM_InstallTitleAbort();
|
|||||||
*/
|
*/
|
||||||
Result AM_InstallTitleResume(FS_MediaType mediaType, u64 titleId);
|
Result AM_InstallTitleResume(FS_MediaType mediaType, u64 titleId);
|
||||||
|
|
||||||
/// Aborts installing a title due to a TMD error.
|
/// Aborts installing a title.
|
||||||
Result AM_InstallTitleAbortTMD();
|
Result AM_InstallTitleAbort();
|
||||||
|
|
||||||
/// Finishes installing a title.
|
/// Finishes installing a title.
|
||||||
Result AM_InstallTitleFinish();
|
Result AM_InstallTitleFinish();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Commits installed titles.
|
||||||
|
* @param mediaType Location of the titles to finalize.
|
||||||
|
* @param titleCount Number of titles to finalize.
|
||||||
|
* @param temp Whether the titles being finalized are in the temporary database.
|
||||||
|
* @param titleIds Title IDs to finalize.
|
||||||
|
*/
|
||||||
|
Result AM_CommitImportTitles(FS_MediaType mediaType, u32 titleCount, bool temp, u64* titleIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Begins installing a TMD.
|
* @brief Begins installing a TMD.
|
||||||
* @param[out] tmdHandle Pointer to output a handle to write TMD data to.
|
* @param[out] tmdHandle Pointer to output a handle to write TMD data to.
|
||||||
@ -352,10 +362,18 @@ Result AM_InstallTmdBegin(Handle *tmdHandle);
|
|||||||
Result AM_InstallTmdAbort(Handle tmdHandle);
|
Result AM_InstallTmdAbort(Handle tmdHandle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Finalizes installing a TMD.
|
* @brief Finishes installing a TMD.
|
||||||
* @param tmdHandle Handle of the installation to finalize.
|
* @param tmdHandle Handle of the installation to finalize.
|
||||||
|
* @param unk Unknown. (usually true)
|
||||||
*/
|
*/
|
||||||
Result AM_InstallTmdFinalize(Handle tmdHandle);
|
Result AM_InstallTmdFinish(Handle tmdHandle, bool unk);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Prepares to import title contents.
|
||||||
|
* @param contentCount Number of contents to be imported.
|
||||||
|
* @param contentIndices Indices of the contents to be imported.
|
||||||
|
*/
|
||||||
|
Result AM_CreateImportContentContexts(u32 contentCount, u16* contentIndices);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Begins installing title content.
|
* @brief Begins installing title content.
|
||||||
@ -365,10 +383,10 @@ Result AM_InstallTmdFinalize(Handle tmdHandle);
|
|||||||
Result AM_InstallContentBegin(Handle *contentHandle, u16 index);
|
Result AM_InstallContentBegin(Handle *contentHandle, u16 index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Aborts installing title content.
|
* @brief Stops installing title content, generally to be resumed later.
|
||||||
* @param contentHandle Handle of the installation to abort.
|
* @param contentHandle Handle of the installation to abort.
|
||||||
*/
|
*/
|
||||||
Result AM_InstallContentAbort(Handle contentHandle);
|
Result AM_InstallContentStop(Handle contentHandle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Resumes installing title content.
|
* @brief Resumes installing title content.
|
||||||
@ -379,16 +397,42 @@ Result AM_InstallContentAbort(Handle contentHandle);
|
|||||||
Result AM_InstallContentResume(Handle *contentHandle, u64* resumeOffset, u16 index);
|
Result AM_InstallContentResume(Handle *contentHandle, u64* resumeOffset, u16 index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Finalizes installing title content.
|
* @brief Cancels installing title content.
|
||||||
* @param contentHandle Handle of the installation to finalize.
|
* @param contentHandle Handle of the installation to finalize.
|
||||||
*/
|
*/
|
||||||
Result AM_InstallContentFinalize(Handle contentHandle);
|
Result AM_InstallContentCancel(Handle contentHandle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Finalizes the installation of one or more titles.
|
* @brief Finishes installing title content.
|
||||||
|
* @param contentHandle Handle of the installation to finalize.
|
||||||
|
*/
|
||||||
|
Result AM_InstallContentFinish(Handle contentHandle);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Imports up to four certificates into the ticket certificate chain.
|
||||||
|
* @param cert1Size Size of the first certificate.
|
||||||
|
* @param cert1 Data of the first certificate.
|
||||||
|
* @param cert2Size Size of the second certificate.
|
||||||
|
* @param cert2 Data of the second certificate.
|
||||||
|
* @param cert3Size Size of the third certificate.
|
||||||
|
* @param cert3 Data of the third certificate.
|
||||||
|
* @param cert4Size Size of the fourth certificate.
|
||||||
|
* @param cert4 Data of the fourth certificate.
|
||||||
|
*/
|
||||||
|
Result AM_ImportCertificates(u32 cert1Size, void* cert1, u32 cert2Size, void* cert2, u32 cert3Size, void* cert3, u32 cert4Size, void* cert4);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Imports a certificate into the ticket certificate chain.
|
||||||
|
* @param certSize Size of the certificate.
|
||||||
|
* @param cert Data of the certificate.
|
||||||
|
*/
|
||||||
|
Result AM_ImportCertificate(u32 certSize, void* cert);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Commits installed titles, and updates FIRM if necessary.
|
||||||
* @param mediaType Location of the titles to finalize.
|
* @param mediaType Location of the titles to finalize.
|
||||||
* @param titleCount Number of titles to finalize.
|
* @param titleCount Number of titles to finalize.
|
||||||
* @param temp Whether the titles being finalized are in the temporary database.
|
* @param temp Whether the titles being finalized are in the temporary database.
|
||||||
* @param titleIds Title IDs to finalize.
|
* @param titleIds Title IDs to finalize.
|
||||||
*/
|
*/
|
||||||
Result AM_InstallTitlesFinish(FS_MediaType mediaType, u32 titleCount, bool temp, u64* titleIds);
|
Result AM_CommitImportTitlesAndUpdateFirmwareAuto(FS_MediaType mediaType, u32 titleCount, bool temp, u64* titleIds);
|
||||||
|
@ -581,7 +581,7 @@ Result AM_InstallTicketAbort(Handle ticketHandle)
|
|||||||
return (Result)cmdbuf[1];
|
return (Result)cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
Result AM_InstallTicketFinalize(Handle ticketHandle)
|
Result AM_InstallTicketFinish(Handle ticketHandle)
|
||||||
{
|
{
|
||||||
Result ret = 0;
|
Result ret = 0;
|
||||||
u32 *cmdbuf = getThreadCommandBuffer();
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
@ -595,7 +595,7 @@ Result AM_InstallTicketFinalize(Handle ticketHandle)
|
|||||||
return (Result)cmdbuf[1];
|
return (Result)cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
Result AM_InstallTitleBegin(FS_MediaType mediaType, u64 titleId)
|
Result AM_InstallTitleBegin(FS_MediaType mediaType, u64 titleId, bool unk)
|
||||||
{
|
{
|
||||||
Result ret = 0;
|
Result ret = 0;
|
||||||
u32 *cmdbuf = getThreadCommandBuffer();
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
@ -604,14 +604,14 @@ Result AM_InstallTitleBegin(FS_MediaType mediaType, u64 titleId)
|
|||||||
cmdbuf[1] = mediaType;
|
cmdbuf[1] = mediaType;
|
||||||
cmdbuf[2] = (u32) (titleId & 0xFFFFFFFF);
|
cmdbuf[2] = (u32) (titleId & 0xFFFFFFFF);
|
||||||
cmdbuf[3] = (u32) ((titleId >> 32) & 0xFFFFFFFF);
|
cmdbuf[3] = (u32) ((titleId >> 32) & 0xFFFFFFFF);
|
||||||
cmdbuf[4] = 0;
|
cmdbuf[4] = unk;
|
||||||
|
|
||||||
if(R_FAILED(ret = svcSendSyncRequest(amHandle))) return ret;
|
if(R_FAILED(ret = svcSendSyncRequest(amHandle))) return ret;
|
||||||
|
|
||||||
return (Result)cmdbuf[1];
|
return (Result)cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
Result AM_InstallTitleAbort()
|
Result AM_InstallTitleStop()
|
||||||
{
|
{
|
||||||
Result ret = 0;
|
Result ret = 0;
|
||||||
u32 *cmdbuf = getThreadCommandBuffer();
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
@ -638,7 +638,8 @@ Result AM_InstallTitleResume(FS_MediaType mediaType, u64 titleId)
|
|||||||
return (Result)cmdbuf[1];
|
return (Result)cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
Result AM_InstallTitleAbortTMD()
|
|
||||||
|
Result AM_InstallTitleAbort()
|
||||||
{
|
{
|
||||||
Result ret = 0;
|
Result ret = 0;
|
||||||
u32 *cmdbuf = getThreadCommandBuffer();
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
@ -662,6 +663,23 @@ Result AM_InstallTitleFinish()
|
|||||||
return (Result)cmdbuf[1];
|
return (Result)cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result AM_CommitImportTitles(FS_MediaType mediaType, u32 titleCount, bool temp, u64* titleIds)
|
||||||
|
{
|
||||||
|
Result ret = 0;
|
||||||
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
|
||||||
|
cmdbuf[0] = IPC_MakeHeader(0x809,3,2); // 0x080900C2
|
||||||
|
cmdbuf[1] = mediaType;
|
||||||
|
cmdbuf[2] = titleCount;
|
||||||
|
cmdbuf[3] = temp ? 1 : 0;
|
||||||
|
cmdbuf[4] = IPC_Desc_Buffer(titleCount * 8, IPC_BUFFER_R);
|
||||||
|
cmdbuf[5] = (u32)titleIds;
|
||||||
|
|
||||||
|
if(R_FAILED(ret = svcSendSyncRequest(amHandle))) return ret;
|
||||||
|
|
||||||
|
return (Result)cmdbuf[1];
|
||||||
|
}
|
||||||
|
|
||||||
Result AM_InstallTmdBegin(Handle *tmdHandle)
|
Result AM_InstallTmdBegin(Handle *tmdHandle)
|
||||||
{
|
{
|
||||||
Result ret = 0;
|
Result ret = 0;
|
||||||
@ -690,13 +708,13 @@ Result AM_InstallTmdAbort(Handle tmdHandle)
|
|||||||
return (Result)cmdbuf[1];
|
return (Result)cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
Result AM_InstallTmdFinalize(Handle tmdHandle)
|
Result AM_InstallTmdFinish(Handle tmdHandle, bool unk)
|
||||||
{
|
{
|
||||||
Result ret = 0;
|
Result ret = 0;
|
||||||
u32 *cmdbuf = getThreadCommandBuffer();
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
|
||||||
cmdbuf[0] = IPC_MakeHeader(0x80C,1,2); // 0x080C0042
|
cmdbuf[0] = IPC_MakeHeader(0x80C,1,2); // 0x080C0042
|
||||||
cmdbuf[1] = 1;
|
cmdbuf[1] = unk;
|
||||||
cmdbuf[2] = IPC_Desc_MoveHandles(1);
|
cmdbuf[2] = IPC_Desc_MoveHandles(1);
|
||||||
cmdbuf[3] = tmdHandle;
|
cmdbuf[3] = tmdHandle;
|
||||||
|
|
||||||
@ -705,6 +723,21 @@ Result AM_InstallTmdFinalize(Handle tmdHandle)
|
|||||||
return (Result)cmdbuf[1];
|
return (Result)cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result AM_CreateImportContentContexts(u32 contentCount, u16* contentIndices)
|
||||||
|
{
|
||||||
|
Result ret = 0;
|
||||||
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
|
||||||
|
cmdbuf[0] = IPC_MakeHeader(0x80D,1,2); // 0x080D0042
|
||||||
|
cmdbuf[1] = contentCount;
|
||||||
|
cmdbuf[2] = IPC_Desc_Buffer(contentCount * 2, IPC_BUFFER_R);
|
||||||
|
cmdbuf[3] = (u32)contentIndices;
|
||||||
|
|
||||||
|
if(R_FAILED(ret = svcSendSyncRequest(amHandle))) return ret;
|
||||||
|
|
||||||
|
return (Result)cmdbuf[1];
|
||||||
|
}
|
||||||
|
|
||||||
Result AM_InstallContentBegin(Handle *contentHandle, u16 index)
|
Result AM_InstallContentBegin(Handle *contentHandle, u16 index)
|
||||||
{
|
{
|
||||||
Result ret = 0;
|
Result ret = 0;
|
||||||
@ -720,7 +753,7 @@ Result AM_InstallContentBegin(Handle *contentHandle, u16 index)
|
|||||||
return (Result)cmdbuf[1];
|
return (Result)cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
Result AM_InstallContentAbort(Handle contentHandle)
|
Result AM_InstallContentStop(Handle contentHandle)
|
||||||
{
|
{
|
||||||
Result ret = 0;
|
Result ret = 0;
|
||||||
u32 *cmdbuf = getThreadCommandBuffer();
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
@ -750,7 +783,21 @@ Result AM_InstallContentResume(Handle *contentHandle, u64* resumeOffset, u16 ind
|
|||||||
return (Result)cmdbuf[1];
|
return (Result)cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
Result AM_InstallContentFinalize(Handle contentHandle)
|
Result AM_InstallContentCancel(Handle contentHandle)
|
||||||
|
{
|
||||||
|
Result ret = 0;
|
||||||
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
|
||||||
|
cmdbuf[0] = IPC_MakeHeader(0x811,0,2); // 0x08110002
|
||||||
|
cmdbuf[1] = IPC_Desc_MoveHandles(1);
|
||||||
|
cmdbuf[2] = contentHandle;
|
||||||
|
|
||||||
|
if(R_FAILED(ret = svcSendSyncRequest(amHandle))) return ret;
|
||||||
|
|
||||||
|
return (Result)cmdbuf[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
Result AM_InstallContentFinish(Handle contentHandle)
|
||||||
{
|
{
|
||||||
Result ret = 0;
|
Result ret = 0;
|
||||||
u32 *cmdbuf = getThreadCommandBuffer();
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
@ -764,7 +811,46 @@ Result AM_InstallContentFinalize(Handle contentHandle)
|
|||||||
return (Result)cmdbuf[1];
|
return (Result)cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
Result AM_InstallTitlesFinish(FS_MediaType mediaType, u32 titleCount, bool temp, u64* titleIds)
|
Result AM_ImportCertificates(u32 cert1Size, void* cert1, u32 cert2Size, void* cert2, u32 cert3Size, void* cert3, u32 cert4Size, void* cert4)
|
||||||
|
{
|
||||||
|
Result ret = 0;
|
||||||
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
|
||||||
|
cmdbuf[0] = IPC_MakeHeader(0x819,4,8); // 0x08190108
|
||||||
|
cmdbuf[1] = cert1Size;
|
||||||
|
cmdbuf[2] = cert2Size;
|
||||||
|
cmdbuf[3] = cert3Size;
|
||||||
|
cmdbuf[4] = cert4Size;
|
||||||
|
cmdbuf[5] = IPC_Desc_Buffer(cert1Size, IPC_BUFFER_R);
|
||||||
|
cmdbuf[6] = (u32)cert1;
|
||||||
|
cmdbuf[7] = IPC_Desc_Buffer(cert2Size, IPC_BUFFER_R);
|
||||||
|
cmdbuf[8] = (u32)cert2;
|
||||||
|
cmdbuf[9] = IPC_Desc_Buffer(cert3Size, IPC_BUFFER_R);
|
||||||
|
cmdbuf[10] = (u32)cert3;
|
||||||
|
cmdbuf[11] = IPC_Desc_Buffer(cert4Size, IPC_BUFFER_R);
|
||||||
|
cmdbuf[12] = (u32)cert4;
|
||||||
|
|
||||||
|
if(R_FAILED(ret = svcSendSyncRequest(amHandle))) return ret;
|
||||||
|
|
||||||
|
return (Result)cmdbuf[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
Result AM_ImportCertificate(u32 certSize, void* cert)
|
||||||
|
{
|
||||||
|
Result ret = 0;
|
||||||
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
|
||||||
|
cmdbuf[0] = IPC_MakeHeader(0x81A,1,2); // 0x081A0042
|
||||||
|
cmdbuf[1] = certSize;
|
||||||
|
cmdbuf[2] = IPC_Desc_Buffer(certSize, IPC_BUFFER_R);
|
||||||
|
cmdbuf[3] = (u32)cert;
|
||||||
|
|
||||||
|
if(R_FAILED(ret = svcSendSyncRequest(amHandle))) return ret;
|
||||||
|
|
||||||
|
return (Result)cmdbuf[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
Result AM_CommitImportTitlesAndUpdateFirmwareAuto(FS_MediaType mediaType, u32 titleCount, bool temp, u64* titleIds)
|
||||||
{
|
{
|
||||||
Result ret = 0;
|
Result ret = 0;
|
||||||
u32 *cmdbuf = getThreadCommandBuffer();
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
Loading…
Reference in New Issue
Block a user