mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-01 15:28:21 -04:00
strat: 0 -> ResultSuccess
This commit is contained in:
parent
9427a5cf46
commit
c6d67eab6a
51 changed files with 166 additions and 166 deletions
|
@ -79,7 +79,7 @@ Result ContentManagement::MountCode(u64 tid, FsStorageId sid) {
|
|||
}
|
||||
|
||||
if (ShouldOverrideContentsWithSD(tid) && R_SUCCEEDED(MountCodeNspOnSd(tid))) {
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
if (R_FAILED(rc = ResolveContentPath(path, tid, sid))) {
|
||||
|
@ -116,7 +116,7 @@ Result ContentManagement::UnmountCode() {
|
|||
g_mounted_hbl_nsp = false;
|
||||
}
|
||||
fsdevUnmountDevice("code");
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
||||
|
@ -469,7 +469,7 @@ Result ContentManagement::SetExternalContentSource(u64 tid, FsFileSystem filesys
|
|||
std::make_tuple(tid),
|
||||
std::make_tuple(tid, mountpoint));
|
||||
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
void ContentManagement::ClearExternalContentSource(u64 tid) {
|
||||
|
|
|
@ -32,5 +32,5 @@ Result HidManagement::GetKeysHeld(u64 *keys) {
|
|||
hidScanInput();
|
||||
*keys = hidKeysHeld(CONTROLLER_P1_AUTO);
|
||||
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
|
|
@ -38,13 +38,13 @@ Result LaunchQueue::Add(u64 tid, const char *args, u64 arg_size) {
|
|||
g_launch_queue[idx].arg_size = arg_size;
|
||||
|
||||
std::copy(args, args + arg_size, g_launch_queue[idx].args);
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result LaunchQueue::AddCopy(u64 tid_base, u64 tid) {
|
||||
int idx = GetIndex(tid_base);
|
||||
if (idx == LAUNCH_QUEUE_FULL) {
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
return Add(tid, g_launch_queue[idx].args, g_launch_queue[idx].arg_size);
|
||||
|
@ -62,7 +62,7 @@ Result LaunchQueue::AddItem(const LaunchItem *item) {
|
|||
}
|
||||
|
||||
g_launch_queue[idx] = *item;
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
int LaunchQueue::GetIndex(u64 tid) {
|
||||
|
|
|
@ -75,7 +75,7 @@ Result MapUtils::LocateSpaceForMapModern(u64 *out, u64 out_size) {
|
|||
}
|
||||
if (mem_info.type == 0 && mem_info.addr - cur_base + mem_info.size >= out_size) {
|
||||
*out = cur_base;
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
if (mem_info.addr + mem_info.size <= cur_base) {
|
||||
return rc;
|
||||
|
@ -110,7 +110,7 @@ Result MapUtils::LocateSpaceForMapDeprecated(u64 *out, u64 out_size) {
|
|||
}
|
||||
if (mem_info.type == 0 && mem_info.addr - cur_base + mem_info.size >= out_size) {
|
||||
*out = cur_base;
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
u64 mem_end = mem_info.addr + mem_info.size;
|
||||
if (mem_end < cur_base) {
|
||||
|
@ -214,5 +214,5 @@ Result MapUtils::GetAddressSpaceInfo(AddressSpaceInfo *out, Handle process_h) {
|
|||
out->heap_end = out->heap_base + out->heap_size;
|
||||
out->map_end = out->map_base + out->map_size;
|
||||
out->addspace_end = out->addspace_base + out->addspace_size;
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
|
@ -72,7 +72,7 @@ class AutoCloseMap {
|
|||
this->process_handle = process_h;
|
||||
this->base_address = address;
|
||||
this->size = size;
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
void Close() {
|
||||
|
@ -153,7 +153,7 @@ struct MappedCodeMemory {
|
|||
}
|
||||
|
||||
Result Unmap() {
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
if (this->IsMapped()) {
|
||||
if (R_FAILED((rc = svcUnmapProcessMemory(this->mapped_address, this->process_handle, this->code_memory_address, this->size)))) {
|
||||
/* TODO: panic(). */
|
||||
|
|
|
@ -30,7 +30,7 @@ Result NpdmUtils::LoadNpdmFromCache(u64 tid, NpdmInfo *out) {
|
|||
return LoadNpdm(tid, out);
|
||||
}
|
||||
*out = g_npdm_cache.info;
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
FILE *NpdmUtils::OpenNpdmFromECS(ContentManagement::ExternalContentSource *ecs) {
|
||||
|
@ -179,7 +179,7 @@ Result NpdmUtils::LoadNpdmInternal(FILE *f_npdm, NpdmUtils::NpdmCache *cache) {
|
|||
|
||||
info->acid_kac = (void *)((uintptr_t)info->acid + info->acid->kac_offset);
|
||||
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -223,13 +223,13 @@ Result NpdmUtils::LoadNpdm(u64 tid, NpdmInfo *out) {
|
|||
/* We validated! */
|
||||
info->title_id = tid;
|
||||
*out = *info;
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result NpdmUtils::ValidateCapabilityAgainstRestrictions(u32 *restrict_caps, size_t num_restrict_caps, u32 *&cur_cap, size_t &caps_remaining) {
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
u32 desc = *cur_cap++;
|
||||
caps_remaining--;
|
||||
unsigned int low_bits = 0;
|
||||
|
@ -278,7 +278,7 @@ Result NpdmUtils::ValidateCapabilityAgainstRestrictions(u32 *restrict_caps, size
|
|||
break;
|
||||
}
|
||||
/* Valid! */
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ Result NpdmUtils::ValidateCapabilityAgainstRestrictions(u32 *restrict_caps, size
|
|||
break;
|
||||
}
|
||||
/* Valid! */
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -353,7 +353,7 @@ Result NpdmUtils::ValidateCapabilityAgainstRestrictions(u32 *restrict_caps, size
|
|||
continue;
|
||||
}
|
||||
/* Valid! */
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -368,13 +368,13 @@ Result NpdmUtils::ValidateCapabilityAgainstRestrictions(u32 *restrict_caps, size
|
|||
continue;
|
||||
}
|
||||
/* Valid! */
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11: /* IRQ Pair. */
|
||||
rc = 0x0;
|
||||
rc = ResultSuccess;
|
||||
for (unsigned int irq_i = 0; irq_i < 2; irq_i++) {
|
||||
u32 irq = desc & 0x3FF;
|
||||
desc >>= 10;
|
||||
|
@ -411,7 +411,7 @@ Result NpdmUtils::ValidateCapabilityAgainstRestrictions(u32 *restrict_caps, size
|
|||
}
|
||||
if (desc == r_desc) {
|
||||
/* Valid! */
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
}
|
||||
break;
|
||||
case 14: /* Kernel Release Version. */
|
||||
|
@ -428,7 +428,7 @@ Result NpdmUtils::ValidateCapabilityAgainstRestrictions(u32 *restrict_caps, size
|
|||
}
|
||||
if (desc == r_desc) {
|
||||
/* Valid! */
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
}
|
||||
break;
|
||||
case 15: /* Handle Table Size. */
|
||||
|
@ -442,7 +442,7 @@ Result NpdmUtils::ValidateCapabilityAgainstRestrictions(u32 *restrict_caps, size
|
|||
break;
|
||||
}
|
||||
/* Valid! */
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -461,11 +461,11 @@ Result NpdmUtils::ValidateCapabilityAgainstRestrictions(u32 *restrict_caps, size
|
|||
}
|
||||
if ((desc & ~r_desc) == 0) {
|
||||
/* Valid! */
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
}
|
||||
break;
|
||||
case 32: /* Empty Descriptor. */
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
break;
|
||||
default: /* Unrecognized Descriptor. */
|
||||
rc = ResultLoaderUnknownCapability;
|
||||
|
@ -475,7 +475,7 @@ Result NpdmUtils::ValidateCapabilityAgainstRestrictions(u32 *restrict_caps, size
|
|||
}
|
||||
|
||||
Result NpdmUtils::ValidateCapabilities(u32 *acid_caps, size_t num_acid_caps, u32 *aci0_caps, size_t num_aci0_caps) {
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
size_t remaining = num_aci0_caps;
|
||||
u32 *cur_cap = aci0_caps;
|
||||
while (remaining) {
|
||||
|
|
|
@ -43,7 +43,7 @@ Result NroUtils::ValidateNrrHeader(NrrHeader *header, u64 size, u64 title_id_min
|
|||
return ResultLoaderInvalidNrr;
|
||||
}
|
||||
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result NroUtils::LoadNro(Registration::Process *target_proc, Handle process_h, u64 nro_heap_address, u64 nro_heap_size, u64 bss_heap_address, u64 bss_heap_size, u64 *out_address) {
|
||||
|
@ -51,7 +51,7 @@ Result NroUtils::LoadNro(Registration::Process *target_proc, Handle process_h, u
|
|||
MappedCodeMemory mcm_nro = {0};
|
||||
MappedCodeMemory mcm_bss = {0};
|
||||
unsigned int i;
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
u8 nro_hash[0x20];
|
||||
struct sha256_state sha_ctx;
|
||||
|
||||
|
@ -143,7 +143,7 @@ Result NroUtils::LoadNro(Registration::Process *target_proc, Handle process_h, u
|
|||
|
||||
Registration::AddNroToProcess(target_proc->index, &mcm_nro, &mcm_bss, nro_hdr.text_size, nro_hdr.ro_size, nro_hdr.rw_size, nro_hdr.build_id);
|
||||
*out_address = mcm_nro.code_memory_address;
|
||||
rc = 0x0;
|
||||
rc = ResultSuccess;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ Result NsoUtils::LoadNsoHeaders(u64 title_id) {
|
|||
}
|
||||
}
|
||||
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result NsoUtils::ValidateNsoLoadSet() {
|
||||
|
@ -157,7 +157,7 @@ Result NsoUtils::ValidateNsoLoadSet() {
|
|||
}
|
||||
}
|
||||
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
||||
|
@ -239,7 +239,7 @@ Result NsoUtils::CalculateNsoLoadExtents(u32 addspace_type, u32 args_size, NsoLo
|
|||
extents->args_address += extents->base_address;
|
||||
}
|
||||
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
|
||||
|
@ -286,7 +286,7 @@ Result NsoUtils::LoadNsoSegment(u64 title_id, unsigned int index, unsigned int s
|
|||
}
|
||||
}
|
||||
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result NsoUtils::LoadNsosIntoProcessMemory(Handle process_h, u64 title_id, NsoLoadExtents *extents, u8 *args, u32 args_size) {
|
||||
|
|
|
@ -107,7 +107,7 @@ Result ProcessCreation::InitializeProcessInfo(NpdmUtils::NpdmInfo *npdm, Handle
|
|||
}
|
||||
}
|
||||
|
||||
return 0x0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result ProcessCreation::CreateProcess(Handle *out_process_h, u64 index, char *nca_path, LaunchQueue::LaunchItem *launch_item, u64 arg_flags, Handle reslimit_h) {
|
||||
|
@ -221,7 +221,7 @@ Result ProcessCreation::CreateProcess(Handle *out_process_h, u64 index, char *nc
|
|||
/* Send the pid/tid pair to anyone interested in man-in-the-middle-attacking it. */
|
||||
Registration::AssociatePidTidForMitM(index);
|
||||
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
|
||||
/* If HBL, override HTML document path. */
|
||||
if (ContentManagement::ShouldOverrideContentsWithHBL(target_process->tid_sid.title_id)) {
|
||||
|
|
|
@ -150,7 +150,7 @@ Result ProcessManagerService::PopulateProgramInfoBuffer(ProcessManagerService::P
|
|||
out->aci0_fah_size = info.aci0->fah_size;
|
||||
std::memcpy(out->ac_buffer + offset, info.aci0_fah, out->aci0_fah_size);
|
||||
offset += out->aci0_fah_size;
|
||||
rc = 0;
|
||||
rc = ResultSuccess;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ Result Registration::GetRegisteredTidSid(u64 index, Registration::TidSid *out) {
|
|||
|
||||
*out = target_process->tid_sid;
|
||||
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
void Registration::SetProcessIdTidAndIs64BitAddressSpace(u64 index, u64 process_id, u64 tid, bool is_64_bit_addspace) {
|
||||
|
@ -149,7 +149,7 @@ Result Registration::AddNrrInfo(u64 index, MappedCodeMemory *nrr_info) {
|
|||
return ResultLoaderInsufficientNrrRegistrations;
|
||||
}
|
||||
*nrr_info_it = *nrr_info;
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Result Registration::RemoveNrrInfo(u64 index, u64 base_address) {
|
||||
|
@ -162,7 +162,7 @@ Result Registration::RemoveNrrInfo(u64 index, u64 base_address) {
|
|||
for (unsigned int i = 0; i < NRR_INFO_MAX; i++) {
|
||||
if (target_process->nrr_infos[i].IsActive() && target_process->nrr_infos[i].base_address == base_address) {
|
||||
target_process->nrr_infos[i].Close();
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
}
|
||||
return ResultLoaderNotRegistered;
|
||||
|
@ -273,7 +273,7 @@ Result Registration::GetNsoInfosForProcessId(Registration::NsoInfo *out, u32 max
|
|||
|
||||
*num_written = cur;
|
||||
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
void Registration::AssociatePidTidForMitM(u64 index) {
|
||||
|
|
|
@ -70,7 +70,7 @@ Result RelocatableObjectsService::UnloadNro(PidDescriptor pid_desc, u64 nro_addr
|
|||
}
|
||||
|
||||
Result RelocatableObjectsService::LoadNrr(PidDescriptor pid_desc, u64 nrr_address, u64 nrr_size) {
|
||||
Result rc = 0;
|
||||
Result rc = ResultSuccess;
|
||||
Registration::Process *target_proc = NULL;
|
||||
MappedCodeMemory nrr_info = {0};
|
||||
ON_SCOPE_EXIT {
|
||||
|
@ -142,7 +142,7 @@ Result RelocatableObjectsService::Initialize(PidDescriptor pid_desc, CopiedHandl
|
|||
this->process_handle = process_h.handle;
|
||||
this->process_id = handle_pid;
|
||||
this->has_initialized = true;
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
return ResultLoaderInvalidProcess;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ Result ShellService::SetExternalContentSource(Out<MovedHandle> out, u64 tid) {
|
|||
serviceCreate(&service, client_h);
|
||||
ContentManagement::SetExternalContentSource(tid, FsFileSystem {service});
|
||||
out.SetValue(server_h);
|
||||
return 0;
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
void ShellService::ClearExternalContentSource(u64 tid) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue