LOADER_RegisterProgram: use FS_ProgramInfo
This commit is contained in:
parent
0ed1f2beb2
commit
8ffc9461ea
@ -24,12 +24,10 @@ Result LOADER_LoadProcess(Handle* process, u64 programHandle);
|
|||||||
/**
|
/**
|
||||||
* @brief Registers a program (along with its update).
|
* @brief Registers a program (along with its update).
|
||||||
* @param[out] programHandle Pointer to output the program handle to.
|
* @param[out] programHandle Pointer to output the program handle to.
|
||||||
* @param titleId The program's title ID.
|
* @param programInfo The program info.
|
||||||
* @param mediaType The program's media type.
|
* @param programInfo The program update info.
|
||||||
* @param updateTitleId The program update's title ID.
|
|
||||||
* @param updateMediaType The program update's media type.
|
|
||||||
*/
|
*/
|
||||||
Result LOADER_RegisterProgram(u64* programHandle, u64 titleId, FS_MediaType mediaType, u64 updateTitleId, FS_MediaType updateMediaType);
|
Result LOADER_RegisterProgram(u64* programHandle, const FS_ProgramInfo *programInfo, const FS_ProgramInfo *programInfoUpdate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Unregisters a program (along with its update).
|
* @brief Unregisters a program (along with its update).
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include <string.h>
|
||||||
#include <3ds/services/loader.h>
|
#include <3ds/services/loader.h>
|
||||||
#include <3ds/result.h>
|
#include <3ds/result.h>
|
||||||
#include <3ds/svc.h>
|
#include <3ds/svc.h>
|
||||||
@ -39,19 +40,14 @@ Result LOADER_LoadProcess(Handle* process, u64 programHandle)
|
|||||||
return (Result)cmdbuf[1];
|
return (Result)cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
Result LOADER_RegisterProgram(u64* programHandle, u64 titleId, FS_MediaType mediaType, u64 updateTitleId, FS_MediaType updateMediaType)
|
Result LOADER_RegisterProgram(u64* programHandle, const FS_ProgramInfo *programInfo, const FS_ProgramInfo *programInfoUpdate)
|
||||||
{
|
{
|
||||||
Result ret = 0;
|
Result ret = 0;
|
||||||
u32 *cmdbuf = getThreadCommandBuffer();
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
|
||||||
cmdbuf[0] = IPC_MakeHeader(2, 8, 0); // 0x20200
|
cmdbuf[0] = IPC_MakeHeader(2, 8, 0); // 0x20200
|
||||||
cmdbuf[1] = (u32)titleId;
|
memcpy(&cmdbuf[1], programInfo, sizeof(FS_ProgramInfo));
|
||||||
cmdbuf[2] = (u32)(titleId >> 32);
|
memcpy(&cmdbuf[5], programInfoUpdate, sizeof(FS_ProgramInfo));
|
||||||
cmdbuf[3] = mediaType;
|
|
||||||
|
|
||||||
cmdbuf[5] = (u32)updateTitleId;
|
|
||||||
cmdbuf[6] = (u32)(updateTitleId >> 32);
|
|
||||||
cmdbuf[7] = updateMediaType;
|
|
||||||
|
|
||||||
if(R_FAILED(ret = svcSendSyncRequest(loaderHandle))) return ret;
|
if(R_FAILED(ret = svcSendSyncRequest(loaderHandle))) return ret;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user