BunnyFl measured firmware 13.42 libSceNpManager.sprx for the eleven
NpManagerInt getters. They now take the measured arguments and refuse
as measured: user id -1 or a null required pointer gives
INVALID_ARGUMENT, the authorization calls also refuse their value and
mode ranges (0x80550004 for the mode), and the PSNO URI form refuses
its size (0x80550011) and a URI of 0x2000 bytes or more (0x80550005).
Past the checks they keep main's offline signed-out answer for any
request id, and the tests take their request ids from the NpManagerInt
request table.
BunnyFl measured firmware 13.42 libSceNpManager.sprx. The IdMapper
account-id lookups take seven arguments: a request id of 0 or less
gives 0x80553085, then user id -1, a null pointer or a value outside
1 to 1000 gives 0x80553083, and past the checks they answer signed out
as main's offline model does. IdMapper abort and delete refuse a
request id of 0 or less with 0x80553085, and IdMapper requests get a
counter of their own instead of the sceNpCreateRequest pool.
NpManagerInt requests sit in a 64-slot table of their own: the 65th
live request gives 0x80559D05, delete gives 0x80559D0A for an id the
table does not hold, and abort answers from the offline service.
sceNpManagerIntAuthGetAuthorizationCode, AuthGetIdToken,
GetAuthorizationCode and GetAuthorizationCodeWithPsnoUri return
SCE_NP_ERROR_SIGNED_OUT. That is the answer libSceNpAuth's
authorization-code and ID-token calls give for a live request while NP
is signed out. Their signatures are unknown, so they read no argument.
sceNpManagerIntGetUserIdByOnlineId and GetUserIdByNpId return
SCE_NP_ERROR_SIGNED_OUT, as sceNpGetUserIdByOnlineId does while NP is
signed out. An NpId carries the online ID, so the NpId form is the same
lookup. Neither reads an argument.
sceNpManagerIntGetAccountAge, GetAccountCountryA, GetAccountLanguageA,
GetNpId and GetOnlineId return SCE_NP_ERROR_SIGNED_OUT, as their public
twins do while NP is signed out. Their signatures are unknown, so they
read no argument and write nothing.
sceNpAbortRequest and sceNpDeleteRequest return SCE_NP_ERROR_REQUEST_NOT_FOUND
for an id that was never created or was deleted; sceNpPollAsync does too and
additionally rejects a null result pointer with SCE_NP_ERROR_INVALID_ARGUMENT
before reading the id, without writing the caller's result. A live request
keeps its signed-out completion. This pins the validation half of shadPS4's
np_manager model that issue #9277 reports; the kind, completion state and
WaitAsync publication half stays open, documented in the debt entry, and the
sceNpWaitAsync export itself stays with PR #9282.
Tests: guest_np_manager tests the four absent/deleted probes (0, -1, 0x7fffffff,
a deleted id) for all three calls, output preservation, null-result precedence
and the live-id paths; guest_np_reachability unchanged. Both pass on Linux; the
new asserts failed on unpatched exports first.
sceNpUnregisterStateCallbackA returns 0x80550015 for a callback id
outside 1..8, compared unsigned so 0, negative ids and INT_MIN are
included, as libSceNpManager.sprx does at RVA 0x15b10 in prosper's
reading. An empty slot still returns 0x80550009.
sceNpCheckNpAvailabilityA, sceNpGetAccountLanguageA,
sceNpGetParentalControlInfoA and sceNpGetAccountDateOfBirthA return
SIGNED_OUT without writing, like sceNpGetAccountCountryA. The game
presence queries report OFFLINE. A null pointer or user id -1 is
INVALID_ARGUMENT, and the request forms refuse request id 0 and an
unknown request as sceNpSetGamePresenceOnline does. Signatures and
checks follow shadPS4 and Orbital; sceNpIsPlusMember keeps throwing.
After the argument checks, shadPS4 looks the request up and returns
REQUEST_NOT_FOUND for one that was never created or was deleted. The
library already tracks live requests for sceNpSetTimeout.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
shadPS4 declares sceNpSetGamePresenceOnline(req_id, online_id, presence)
and returns INVALID_ARGUMENT for request id 0 or a null online id. The
export took (user id, timeout), so a caller's arguments landed in the
wrong registers.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sceNpGetAccountId and sceNpSetGamePresenceOnline report NP as signed
out, and sceNpUnregisterPlusEventCallback returns 0 like the premium
form.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sceNpGetAccountCountry, sceNpGetAccountDateOfBirth, sceNpGetAccountLanguage
and sceNpGetParentalControlInfo take an online id that matches no user,
sceNpGetUserIdByOnlineId and sceNpCheckPlus report NP as signed out, and
sceNpNotifyPlusFeature is declared and throws.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Account id 0 or a null output returns SCE_NP_ERROR_INVALID_ARGUMENT;
otherwise the always signed-out NP returns SCE_NP_ERROR_SIGNED_OUT, as
sceNpGetAccountIdA does. PPSA14632 imports it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sceNpRegisterStateCallback and sceNpRegisterStateCallbackA stored nothing,
the unregister calls always succeeded and sceNpCheckCallback did nothing,
so a title that waits for its NP state callback never learned the user's
state. #1277 reports that Minecraft Preview (PPSA19639) needs the callback
(stop 2).
sceNpRegisterStateCallbackA now keeps up to 8 callbacks and returns the
slot plus 1. A null callback returns INVALID_ARGUMENT, a callback that is
already registered CALLBACK_ALREADY_REGISTERED and a ninth one
CALLBACK_MAX (0x8055001D). sceNpUnregisterStateCallbackA returns
INVALID_ARGUMENT for an id outside 1..8 and CALLBACK_NOT_REGISTERED for an
empty slot. The legacy sceNpRegisterStateCallback keeps one callback with
the same errors. The rules follow shadPS4
src/core/libraries/np/np_manager.cpp @15abf68c9b52 (RegisterStateCallbackA
and UnregisterStateCallbackAById L857-L901, the legacy pair L981-L1005,
ORBIS_NP_STATE_CALLBACK_MAX L36) and np_error.h L38.
Each registration is marked pending. sceNpCheckCallback takes the pending
registrations under the lock and calls them after releasing it, on the
calling thread, with SIGNED_OUT for the initial user 0x10000000. For the A
form this follows KytyPS5 src/libs/network.cpp @9e41d8320a27
(NpRegisterStateCallbackA L4021-L4034 marks the registration pending,
NpCheckCallback L3959-L3974 delivers it once). KytyPS5 never calls the
legacy callback (NpRegisterStateCallback and NpUnregisterStateCallback,
L4009-L4019, do nothing). The legacy callback is called as
(user, SIGNED_OUT, nullptr, userdata), as in shadPS4, which passes an NpId
only for SIGNED_IN (L823, L938-L940).
shadPS4 queues SIGNED_OUT from the user service login event instead
(DispatchPendingNpStateCallbacks L903-L962), and the same event calls the
reachability callback once with UNAVAILABLE (L922-L931, L959-L961). The
reachability callback is still not called here. These differences and the
unmeasured console behaviour are recorded in
docs/dev/debt/libSceNpManager.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Validate timeout arguments and track live requests so unknown or deleted
ids return REQUEST_NOT_FOUND. This supplies the remaining absent load
import alongside the dialog Close export; timeouts follow the existing
offline network model and are not stored.
Co-Authored-By: GPT-6.1-sol <[email protected]>