1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-05 19:51:45 +00:00

Merge branch 'master' of github.com:Atmosphere-NX/Atmosphere

This commit is contained in:
TuxSH 2018-05-07 23:06:01 +02:00
commit 16ccc8a241
3 changed files with 7 additions and 3 deletions

View file

@ -210,6 +210,10 @@ T GetValueFromIpcParsedCommand(IpcParsedCommand& r, IpcCommand& out_c, u8 *point
} else if constexpr (std::is_same<T, PidDescriptor>::value) {
cur_rawdata_index += sizeof(u64) / sizeof(u32);
return PidDescriptor(r.Pid);
} else if constexpr (std::is_same<T, bool>::value) {
/* Official bools accept non-zero values with low bit unset as false. */
cur_rawdata_index += size_in_raw_data<T>::value / sizeof(u32);
return ((*(((u32 *)r.Raw + old_rawdata_index))) & 1) == 1;
} else {
cur_rawdata_index += size_in_raw_data<T>::value / sizeof(u32);
return *((T *)((u32 *)r.Raw + old_rawdata_index));

View file

@ -230,7 +230,7 @@ Result Registration::RemoveNroInfo(u64 index, Handle process_h, u64 nro_heap_add
return 0xA809;
}
for (unsigned int i = 0; i < NRR_INFO_MAX; i++) {
for (unsigned int i = 0; i < NRO_INFO_MAX; i++) {
if (target_process->nro_infos[i].in_use && target_process->nro_infos[i].nro_heap_address == nro_heap_address) {
NroInfo *info = &target_process->nro_infos[i];
Result rc = svcUnmapProcessCodeMemory(process_h, info->base_address + info->text_size + info->ro_size + info->rw_size, info->bss_heap_address, info->bss_heap_size);

View file

@ -65,11 +65,11 @@ std::tuple<Result, MovedHandle> UserService::register_service(u64 service, u8 is
Result rc = 0x415;
#ifdef SM_ENABLE_SMHAX
if (!this->has_initialized) {
rc = Registration::RegisterServiceForPid(Registration::GetInitialProcessId(), service, max_sessions, is_light != 0, &service_h);
rc = Registration::RegisterServiceForPid(Registration::GetInitialProcessId(), service, max_sessions, (is_light & 1) != 0, &service_h);
}
#endif
if (this->has_initialized) {
rc = Registration::RegisterServiceForPid(this->pid, service, max_sessions, is_light != 0, &service_h);
rc = Registration::RegisterServiceForPid(this->pid, service, max_sessions, (is_light & 1) != 0, &service_h);
}
return {rc, MovedHandle{service_h}};
}