sceNp: more error checks

This commit is contained in:
Megamouse 2021-10-11 20:28:11 +02:00
parent e2a9c0a8f3
commit 80ef348600

View File

@ -716,7 +716,7 @@ error_code sceNpBasicUnregisterHandler()
return CELL_OK; return CELL_OK;
} }
error_code sceNpBasicSetPresence(vm::cptr<void> data, u64 size) error_code sceNpBasicSetPresence(vm::cptr<u8> data, u64 size)
{ {
sceNp.todo("sceNpBasicSetPresence(data=*0x%x, size=%d)", data, size); sceNp.todo("sceNpBasicSetPresence(data=*0x%x, size=%d)", data, size);
@ -727,6 +727,16 @@ error_code sceNpBasicSetPresence(vm::cptr<void> data, u64 size)
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!data || !data[0])
{
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
}
if (size > SCE_NP_BASIC_MAX_PRESENCE_SIZE) if (size > SCE_NP_BASIC_MAX_PRESENCE_SIZE)
{ {
return SCE_NP_BASIC_ERROR_EXCEEDS_MAX; return SCE_NP_BASIC_ERROR_EXCEEDS_MAX;
@ -746,6 +756,11 @@ error_code sceNpBasicSetPresenceDetails(vm::cptr<SceNpBasicPresenceDetails> pres
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!pres || options > SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) if (!pres || options > SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS)
{ {
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
@ -770,6 +785,11 @@ error_code sceNpBasicSetPresenceDetails2(vm::cptr<SceNpBasicPresenceDetails2> pr
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!pres || options > SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) if (!pres || options > SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS)
{ {
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
@ -794,6 +814,11 @@ error_code sceNpBasicSendMessage(vm::cptr<SceNpId> to, vm::cptr<void> data, u64
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!to || to->handle.data[0] == '\0' || !data || !size) if (!to || to->handle.data[0] == '\0' || !data || !size)
{ {
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
@ -840,6 +865,8 @@ error_code sceNpBasicSendMessageGui(vm::cptr<SceNpBasicMessageDetails> msg, sys_
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
} }
// TODO: SCE_NP_BASIC_ERROR_NOT_SUPPORTED, might be in between argument checks
if (msg->size > SCE_NP_BASIC_MAX_MESSAGE_SIZE) if (msg->size > SCE_NP_BASIC_MAX_MESSAGE_SIZE)
{ {
return SCE_NP_BASIC_ERROR_EXCEEDS_MAX; return SCE_NP_BASIC_ERROR_EXCEEDS_MAX;
@ -940,11 +967,18 @@ error_code sceNpBasicSendMessageAttachment(vm::cptr<SceNpId> to, vm::cptr<char>
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!to || to->handle.data[0] == '\0' || !data || !size) if (!to || to->handle.data[0] == '\0' || !data || !size)
{ {
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
} }
// TODO: SCE_NP_BASIC_ERROR_NOT_SUPPORTED, might be in between argument checks
if (strlen(subject.get_ptr()) > SCE_NP_BASIC_BODY_CHARACTER_MAX || strlen(body.get_ptr()) > SCE_NP_BASIC_BODY_CHARACTER_MAX) if (strlen(subject.get_ptr()) > SCE_NP_BASIC_BODY_CHARACTER_MAX || strlen(body.get_ptr()) > SCE_NP_BASIC_BODY_CHARACTER_MAX)
{ {
return SCE_NP_BASIC_ERROR_EXCEEDS_MAX; return SCE_NP_BASIC_ERROR_EXCEEDS_MAX;
@ -969,6 +1003,11 @@ error_code sceNpBasicRecvMessageAttachment(sys_memory_container_t containerId)
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
return CELL_OK; return CELL_OK;
} }
@ -1031,13 +1070,13 @@ error_code sceNpBasicRecvMessageCustom(u16 mainType, u32 recvOptions, sys_memory
return SCE_NP_BASIC_ERROR_NOT_REGISTERED; return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
} }
// TODO: SCE_NP_BASIC_ERROR_NOT_SUPPORTED
if ((recvOptions & ~SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_ALL_OPTIONS)) if ((recvOptions & ~SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_ALL_OPTIONS))
{ {
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
} }
// TODO: SCE_NP_BASIC_ERROR_NOT_SUPPORTED
atomic_t<bool> wake_up = false; atomic_t<bool> wake_up = false;
bool result = false; bool result = false;
@ -1100,6 +1139,11 @@ error_code sceNpBasicMarkMessageAsUsed(SceNpBasicMessageId msgId)
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
//if (!msgId > ?) //if (!msgId > ?)
//{ //{
// return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; // return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
@ -1119,6 +1163,13 @@ error_code sceNpBasicAbortGui()
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
// TODO: abort GUI interaction
return CELL_OK; return CELL_OK;
} }
@ -1133,11 +1184,18 @@ error_code sceNpBasicAddFriend(vm::cptr<SceNpId> contact, vm::cptr<char> body, s
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!contact || contact->handle.data[0] == '\0') if (!contact || contact->handle.data[0] == '\0')
{ {
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
} }
// TODO: SCE_NP_BASIC_ERROR_NOT_SUPPORTED, might be in between argument checks
if (strlen(body.get_ptr()) > SCE_NP_BASIC_BODY_CHARACTER_MAX) if (strlen(body.get_ptr()) > SCE_NP_BASIC_BODY_CHARACTER_MAX)
{ {
return SCE_NP_BASIC_ERROR_EXCEEDS_MAX; return SCE_NP_BASIC_ERROR_EXCEEDS_MAX;
@ -1208,6 +1266,11 @@ error_code sceNpBasicGetFriendPresenceByIndex(u32 index, vm::ptr<SceNpUserInfo>
{ {
sceNp.todo("sceNpBasicGetFriendPresenceByIndex(index=%d, user=*0x%x, pres=*0x%x, options=%d)", index, user, pres, options); sceNp.todo("sceNpBasicGetFriendPresenceByIndex(index=%d, user=*0x%x, pres=*0x%x, options=%d)", index, user, pres, options);
if (!pres)
{
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
}
auto& nph = g_fxo->get<named_thread<np_handler>>(); auto& nph = g_fxo->get<named_thread<np_handler>>();
if (!nph.is_NP_init) if (!nph.is_NP_init)
@ -1215,7 +1278,7 @@ error_code sceNpBasicGetFriendPresenceByIndex(u32 index, vm::ptr<SceNpUserInfo>
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!user || !pres) if (!user)
{ {
// TODO: check index and (options & SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) depending on fw // TODO: check index and (options & SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) depending on fw
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
@ -1228,6 +1291,11 @@ error_code sceNpBasicGetFriendPresenceByIndex2(u32 index, vm::ptr<SceNpUserInfo>
{ {
sceNp.todo("sceNpBasicGetFriendPresenceByIndex2(index=%d, user=*0x%x, pres=*0x%x, options=%d)", index, user, pres, options); sceNp.todo("sceNpBasicGetFriendPresenceByIndex2(index=%d, user=*0x%x, pres=*0x%x, options=%d)", index, user, pres, options);
if (!pres)
{
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
}
auto& nph = g_fxo->get<named_thread<np_handler>>(); auto& nph = g_fxo->get<named_thread<np_handler>>();
if (!nph.is_NP_init) if (!nph.is_NP_init)
@ -1235,7 +1303,7 @@ error_code sceNpBasicGetFriendPresenceByIndex2(u32 index, vm::ptr<SceNpUserInfo>
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!user || !pres) if (!user)
{ {
// TODO: check index and (options & SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) depending on fw // TODO: check index and (options & SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) depending on fw
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
@ -1250,12 +1318,17 @@ error_code sceNpBasicGetFriendPresenceByNpId(vm::cptr<SceNpId> npid, vm::ptr<Sce
auto& nph = g_fxo->get<named_thread<np_handler>>(); auto& nph = g_fxo->get<named_thread<np_handler>>();
if (!pres)
{
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
}
if (!nph.is_NP_init) if (!nph.is_NP_init)
{ {
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!npid || !pres) if (!npid)
{ {
// TODO: check (options & SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) depending on fw // TODO: check (options & SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) depending on fw
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
@ -1270,12 +1343,17 @@ error_code sceNpBasicGetFriendPresenceByNpId2(vm::cptr<SceNpId> npid, vm::ptr<Sc
auto& nph = g_fxo->get<named_thread<np_handler>>(); auto& nph = g_fxo->get<named_thread<np_handler>>();
if (!pres)
{
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
}
if (!nph.is_NP_init) if (!nph.is_NP_init)
{ {
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!npid || !pres) if (!npid)
{ {
// TODO: check (options & SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) depending on fw // TODO: check (options & SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS) depending on fw
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
@ -1361,6 +1439,11 @@ error_code sceNpBasicGetPlayersHistoryEntryCount(u32 options, vm::ptr<u32> count
{ {
sceNp.todo("sceNpBasicGetPlayersHistoryEntryCount(options=%d, count=*0x%x)", options, count); sceNp.todo("sceNpBasicGetPlayersHistoryEntryCount(options=%d, count=*0x%x)", options, count);
if (options > SCE_NP_BASIC_PLAYERS_HISTORY_OPTIONS_ALL)
{
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
}
auto& nph = g_fxo->get<named_thread<np_handler>>(); auto& nph = g_fxo->get<named_thread<np_handler>>();
if (!nph.is_NP_init) if (!nph.is_NP_init)
@ -1368,6 +1451,11 @@ error_code sceNpBasicGetPlayersHistoryEntryCount(u32 options, vm::ptr<u32> count
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!count) if (!count)
{ {
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
@ -1389,6 +1477,11 @@ error_code sceNpBasicGetPlayersHistoryEntry(u32 options, u32 index, vm::ptr<SceN
{ {
sceNp.warning("sceNpBasicGetPlayersHistoryEntry(options=%d, index=%d, npid=*0x%x)", options, index, npid); sceNp.warning("sceNpBasicGetPlayersHistoryEntry(options=%d, index=%d, npid=*0x%x)", options, index, npid);
if (options > SCE_NP_BASIC_PLAYERS_HISTORY_OPTIONS_ALL)
{
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
}
auto& nph = g_fxo->get<named_thread<np_handler>>(); auto& nph = g_fxo->get<named_thread<np_handler>>();
if (!nph.is_NP_init) if (!nph.is_NP_init)
@ -1396,6 +1489,11 @@ error_code sceNpBasicGetPlayersHistoryEntry(u32 options, u32 index, vm::ptr<SceN
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!npid) if (!npid)
{ {
// TODO: Check index // TODO: Check index
@ -1422,6 +1520,11 @@ error_code sceNpBasicAddBlockListEntry(vm::cptr<SceNpId> npid)
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!npid || npid->handle.data[0] == '\0') if (!npid || npid->handle.data[0] == '\0')
{ {
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
@ -1500,6 +1603,11 @@ error_code sceNpBasicGetMessageAttachmentEntryCount(vm::ptr<u32> count)
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!count) if (!count)
{ {
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
@ -1528,6 +1636,11 @@ error_code sceNpBasicGetMessageAttachmentEntry(u32 index, vm::ptr<SceNpUserInfo>
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!from) if (!from)
{ {
// TODO: check index // TODO: check index
@ -1547,17 +1660,27 @@ error_code sceNpBasicGetCustomInvitationEntryCount(vm::ptr<u32> count)
{ {
sceNp.todo("sceNpBasicGetCustomInvitationEntryCount(count=*0x%x)", count); sceNp.todo("sceNpBasicGetCustomInvitationEntryCount(count=*0x%x)", count);
if (!count)
{
return SCE_NP_AUTH_EINVAL;
}
auto& nph = g_fxo->get<named_thread<np_handler>>(); auto& nph = g_fxo->get<named_thread<np_handler>>();
// TODO: Find the correct test which returns SCE_NP_AUTH_ESRCH if (!nph.is_NP_init)
{
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
}
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!count)
{
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
}
// TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND
if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE)
{ {
return SCE_NP_AUTH_ESRCH; return SCE_NP_ERROR_ID_NOT_FOUND;
} }
// TODO: Check if there are custom invitations // TODO: Check if there are custom invitations
@ -1570,18 +1693,28 @@ error_code sceNpBasicGetCustomInvitationEntry(u32 index, vm::ptr<SceNpUserInfo>
{ {
sceNp.todo("sceNpBasicGetCustomInvitationEntry(index=%d, from=*0x%x)", index, from); sceNp.todo("sceNpBasicGetCustomInvitationEntry(index=%d, from=*0x%x)", index, from);
auto& nph = g_fxo->get<named_thread<np_handler>>();
if (!nph.is_NP_init)
{
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
}
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!from) if (!from)
{ {
// TODO: check index // TODO: check index
return SCE_NP_AUTH_EINVAL; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
} }
auto& nph = g_fxo->get<named_thread<np_handler>>();
// TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND // TODO: Find the correct test which returns SCE_NP_ERROR_ID_NOT_FOUND
if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE) if (nph.get_psn_status() != SCE_NP_MANAGER_STATUS_ONLINE)
{ {
return SCE_NP_AUTH_ESRCH; return SCE_NP_ERROR_ID_NOT_FOUND;
} }
return CELL_OK; return CELL_OK;
@ -1598,6 +1731,11 @@ error_code sceNpBasicGetMatchingInvitationEntryCount(vm::ptr<u32> count)
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!count) if (!count)
{ {
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
@ -1626,6 +1764,11 @@ error_code sceNpBasicGetMatchingInvitationEntry(u32 index, vm::ptr<SceNpUserInfo
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!from) if (!from)
{ {
// TODO: check index // TODO: check index
@ -1652,6 +1795,11 @@ error_code sceNpBasicGetClanMessageEntryCount(vm::ptr<u32> count)
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!count) if (!count)
{ {
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT; return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
@ -1680,6 +1828,11 @@ error_code sceNpBasicGetClanMessageEntry(u32 index, vm::ptr<SceNpUserInfo> from)
return SCE_NP_BASIC_ERROR_NOT_INITIALIZED; return SCE_NP_BASIC_ERROR_NOT_INITIALIZED;
} }
if (!nph.basic_handler.registered)
{
return SCE_NP_BASIC_ERROR_NOT_REGISTERED;
}
if (!from) if (!from)
{ {
// TODO: check index // TODO: check index
@ -1699,6 +1852,12 @@ error_code sceNpBasicGetMessageEntryCount(u32 type, vm::ptr<u32> count)
{ {
sceNp.todo("sceNpBasicGetMessageEntryCount(type=%d, count=*0x%x)", type, count); sceNp.todo("sceNpBasicGetMessageEntryCount(type=%d, count=*0x%x)", type, count);
// TODO: verify this check and its location
if (type > SCE_NP_BASIC_MESSAGE_INFO_TYPE_BOOTABLE_CUSTOM_DATA_MESSAGE)
{
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
}
auto& nph = g_fxo->get<named_thread<np_handler>>(); auto& nph = g_fxo->get<named_thread<np_handler>>();
if (!nph.is_NP_init) if (!nph.is_NP_init)
@ -1727,6 +1886,12 @@ error_code sceNpBasicGetMessageEntry(u32 type, u32 index, vm::ptr<SceNpUserInfo>
{ {
sceNp.todo("sceNpBasicGetMessageEntry(type=%d, index=%d, from=*0x%x)", type, index, from); sceNp.todo("sceNpBasicGetMessageEntry(type=%d, index=%d, from=*0x%x)", type, index, from);
// TODO: verify this check and its location
if (type > SCE_NP_BASIC_MESSAGE_INFO_TYPE_BOOTABLE_CUSTOM_DATA_MESSAGE)
{
return SCE_NP_BASIC_ERROR_INVALID_ARGUMENT;
}
auto& nph = g_fxo->get<named_thread<np_handler>>(); auto& nph = g_fxo->get<named_thread<np_handler>>();
if (!nph.is_NP_init) if (!nph.is_NP_init)