loader/ECS: don't clear ECS on failure, add ClearExternalContentSource command

This commit is contained in:
misson20000 2019-01-06 16:30:05 -08:00 committed by Michael Scire
parent d0505d3c11
commit 35cf3b65a3
4 changed files with 34 additions and 6 deletions

View file

@ -214,8 +214,8 @@ Result ProcessCreation::CreateProcess(Handle *out_process_h, u64 index, char *nc
Registration::AssociatePidTidForMitM(index);
rc = 0;
CREATE_PROCESS_END:
/* ECS is a one-shot operation. */
/* ECS is a one-shot operation, but we don't clear on failure. */
ContentManagement::ClearExternalContentSource(target_process->tid_sid.title_id);
if (mounted_code) {
if (R_SUCCEEDED(rc) && target_process->tid_sid.storage_id != FsStorageId_None) {
@ -224,6 +224,8 @@ CREATE_PROCESS_END:
ContentManagement::UnmountCode();
}
}
CREATE_PROCESS_END:
if (R_SUCCEEDED(rc)) {
*out_process_h = process_h;
} else {

View file

@ -45,3 +45,7 @@ Result ShellService::SetExternalContentSource(Out<MovedHandle> out, u64 tid) {
out.SetValue(server_h);
return 0;
}
void ShellService::ClearExternalContentSource(u64 tid) {
ContentManagement::ClearExternalContentSource(tid);
}

View file

@ -23,6 +23,7 @@ enum ShellServiceCmd {
Shell_Cmd_ClearLaunchQueue = 1,
Shell_Cmd_AtmosphereSetExternalContentSource = 65000,
Shell_Cmd_AtmosphereClearExternalContentSource = 65001,
};
class ShellService final : public IServiceObject {
@ -33,10 +34,12 @@ class ShellService final : public IServiceObject {
/* Atmosphere commands. */
Result SetExternalContentSource(Out<MovedHandle> out, u64 tid);
void ClearExternalContentSource(u64 tid);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MakeServiceCommandMeta<Shell_Cmd_AddTitleToLaunchQueue, &ShellService::AddTitleToLaunchQueue>(),
MakeServiceCommandMeta<Shell_Cmd_ClearLaunchQueue, &ShellService::ClearLaunchQueue>(),
MakeServiceCommandMeta<Shell_Cmd_AtmosphereSetExternalContentSource, &ShellService::SetExternalContentSource>(),
MakeServiceCommandMeta<Shell_Cmd_AtmosphereClearExternalContentSource, &ShellService::ClearExternalContentSource>(),
};
};