feat(libSceNpSessionSignaling): implement context properties and state queries #14910
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14910"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by edubox on 2026-11-02T00:29:40Z.
What
Seven
libSceNpSessionSignalingexports threwnot implemented. Their signatures are recovered from the wrappers in the 11.00 module, and the offline host can answer the ones that do not need the network:sceNpSessionSignalingInitializeWithPortforwards(param, port, reserved)to the same initializer assceNpSessionSignalingInitialize, which passes port0x217band reserved0. The wrapper at0xab40forwards both extra arguments; whether the initializer validates them is internal and unmeasured, so the host opens no socket and accepts both.sceNpSessionSignalingGetMemoryInforeturns the pool size recorded at initialization and zero used/peak sizes, since the host allocates no signaling pool.sceNpSessionSignalingGetConnectionStatisticsreturns all-zero counters, since no connection ever activates.sceNpSessionSignalingGetGroupFromPeerAddressperforms the same initialization, null-argument and context checks as the other lookups and then returns group-not-found, because no session exists.sceNpSessionSignalingGetCustomProperty/SetCustomPropertykeep one 32-bit property per context. The Set wrapper at0xb3c0passes the opaque property pointer to the internal setter together with a stack dword and copies that dword to the optional previous-value output; the Get wrapper at0xb470calls the internal getter with a stack dword and copies it to the optional output. That establishes the 32-bit previous/output exchange and the forwarded pointer, not the internal four-byte load and replacement, so the host models one 32-bit value.sceNpSessionSignalingRegisterInternalCallbackstores the callback and user-data pointers in the context and never invokes them; null pointers are accepted and the call returns 0 after forwarding, as the wrapper does.The wrappers at
0xab40(InitializeWithPort),0xb3c0(SetCustomProperty),0xb470(GetCustomProperty),0xb930(GetGroupFromPeerAddress),0xbb30(GetMemoryInfo),0xbae0(GetConnectionStatistics) and0xbb80(RegisterInternalCallback) establish the error order and the 32-bit outputs.CreateJoinActivate,JoinActivateand theManualUdp*family still throw.A destroyed context slot now clears the custom property and both callback pointers before reuse, so a new context starts from the same state as a fresh slot. The callback signature is not measured; the two pointers are only stored.
Tested
BUILD_TESTING=ON: builtguest_np_session_signaling_tests; the test binary passes.GuestNpSessionSignaling.cppcovers each new export before initialization, the null-argument and context-not-found errors, the memory and statistics contents, the default/replaced custom property and the group lookup on a valid context, plusInitializeWithPortafter terminate and its already-initialized error. It also runs SetCustomProperty + RegisterInternalCallback -> DestroyContext -> CreateContext -> GetCustomProperty for bothCreateContextandCreateContext2, and requires the reused slot to report a zero property.python3 tools/check_conventions.py --base origin/main: all checks pass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)