1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-23 03:02:53 +01:00

sys_prx: Tiny improvement

This commit is contained in:
Eladash 2019-07-26 11:47:30 +03:00 committed by Ani
parent 8ca53f9c84
commit fd433779bb

View File

@ -1,4 +1,4 @@
#include "stdafx.h"
#include "stdafx.h"
#include "sys_prx.h"
#include "Emu/System.h"
@ -257,6 +257,11 @@ error_code _sys_prx_start_module(u32 id, u64 flags, vm::ptr<sys_prx_start_stop_m
{
sys_prx.warning("_sys_prx_start_module(id=0x%x, flags=0x%x, pOpt=*0x%x)", id, flags, pOpt);
if (id == 0 || !pOpt)
{
return CELL_EINVAL;
}
const auto prx = idm::get<lv2_obj, lv2_prx>(id);
if (!prx)
@ -301,7 +306,7 @@ error_code _sys_prx_unload_module(u32 id, u64 flags, vm::ptr<sys_prx_unload_modu
if (!prx)
{
return CELL_ESRCH;
return CELL_PRX_ERROR_UNKNOWN_MODULE;
}
ppu_unload_prx(*prx);
@ -365,11 +370,21 @@ error_code _sys_prx_get_module_info(u32 id, u64 flags, vm::ptr<sys_prx_module_in
const auto prx = idm::get<lv2_obj, lv2_prx>(id);
if (!pOpt || !pOpt->info || !prx)
if (!pOpt)
{
return CELL_EFAULT;
}
if (pOpt->size != pOpt.size() || !pOpt->info)
{
return CELL_EINVAL;
}
if (!prx)
{
return CELL_PRX_ERROR_UNKNOWN_MODULE;
}
std::memset(pOpt->info->name, 0, 30);
std::memcpy(pOpt->info->name, prx->module_info_name, 28);
pOpt->info->version[0] = prx->module_info_version[0];