Fix error returns

Based on 11.00 libkernel decomp.
This commit is contained in:
Stephen Miller 2025-06-22 11:44:59 -05:00
parent a9b26dd565
commit 76e178364a

View File

@ -103,7 +103,7 @@ s32 PS4_SYSV_ABI sceKernelGetModuleInfoForUnwind(VAddr addr, s32 flags,
auto* linker = Common::Singleton<Core::Linker>::Instance(); auto* linker = Common::Singleton<Core::Linker>::Instance();
auto* module = linker->FindByAddress(addr); auto* module = linker->FindByAddress(addr);
if (!module) { if (!module) {
return ORBIS_KERNEL_ERROR_EFAULT; return ORBIS_KERNEL_ERROR_ESRCH;
} }
const auto mod_info = module->GetModuleInfoEx(); const auto mod_info = module->GetModuleInfoEx();
@ -120,12 +120,21 @@ s32 PS4_SYSV_ABI sceKernelGetModuleInfoForUnwind(VAddr addr, s32 flags,
s32 PS4_SYSV_ABI sceKernelGetModuleInfoFromAddr(VAddr addr, s32 flags, s32 PS4_SYSV_ABI sceKernelGetModuleInfoFromAddr(VAddr addr, s32 flags,
Core::OrbisKernelModuleInfoEx* info) { Core::OrbisKernelModuleInfoEx* info) {
if (flags >= 3) {
std::memset(info, 0, sizeof(Core::OrbisKernelModuleInfoEx));
return ORBIS_KERNEL_ERROR_EINVAL;
}
if (info == nullptr) {
return ORBIS_KERNEL_ERROR_EFAULT;
}
LOG_INFO(Lib_Kernel, "called addr = {:#x}, flags = {:#x}", addr, flags); LOG_INFO(Lib_Kernel, "called addr = {:#x}, flags = {:#x}", addr, flags);
auto* linker = Common::Singleton<Core::Linker>::Instance(); auto* linker = Common::Singleton<Core::Linker>::Instance();
auto* module = linker->FindByAddress(addr); auto* module = linker->FindByAddress(addr);
if (!module) { if (!module) {
return ORBIS_KERNEL_ERROR_EFAULT; return ORBIS_KERNEL_ERROR_ESRCH;
} }
*info = module->GetModuleInfoEx(); *info = module->GetModuleInfoEx();
return ORBIS_OK; return ORBIS_OK;
} }