feat(libSceNpWebApi2): implement the internal and presence initializers #8485
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8485"
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 orezraey on 2026-10-20T13:30:42Z.
What
sceNpWebApi2IntInitialize,sceNpWebApi2IntInitialize2andsceNpWebApi2InitializeForPresencewere declared from shadPS4's prototypes and threwNotImplemented. They now create a library context the waysceNpWebApi2Initializealready does, following shadPS4's implementation on the PS4:sceNpWebApi2IntInitializeandsceNpWebApi2IntInitialize2take an argument structure and returnSCE_NP_WEBAPI2_ERROR_INVALID_ARGUMENT(0x80553402, as in shadPS4'snp_error.h) for a null pointer or astruct_sizeother than the structure's size; otherwise they create a context with itspool_size.sceNpWebApi2InitializeForPresence(lib_http_ctx_id, pool_size)creates a context withpool_size.NpWebApi2IntInitializeArgs(32 bytes) andNpWebApi2IntInitialize2Args(40 bytes) inSceTypes.hppfollow shadPS4's declarations, withstatic_asserts on both sizes.sceNpWebApi2Initializeand the three share aCreateLibraryContext(poolSize)helper, sosceNpWebApi2GetMemoryPoolStatsandsceNpWebApi2Terminatetreat the new contexts like the existing ones.docs/dev/debt/libSceNpWebApi2.mdrecords what is not modelled: shadPS4 also stores a context type (2 for the internal initializers, 3 for presence), the name and the push configuration group, and refuses more than 0x8000 contexts; none of this is kept here, and nothing is measured on a PS5. The two multipart exports stay in the existing entry.Tested
BUILD_TESTING=ON.guest_np_web_api2now also checks, for each new entry point, the returned context, its pool size throughsceNpWebApi2GetMemoryPoolStats,SCE_NP_WEBAPI2_ERROR_INVALID_ARGUMENTfor a null pointer and a wrongstruct_size, and thatsceNpWebApi2Terminateremoves the context. It passes.tools/progress.py --module libSceNpWebApi2: 31 of 39 implemented (28 onmain).tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pycould not compare #5965, #6044, #6977, #7081 and #7412, which conflict withmainand shareSceTypes.hppor the library tests; none of their diffs touches these exports or structures.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T13:31:32Z.
Progress report (
2185dbf→a9a0c05)📈 System libraries: 64.51% (+0.05%, +3 implemented functions)
✅ 3 implemented
sceNpWebApi2InitializeForPresencesceNpWebApi2IntInitializesceNpWebApi2IntInitialize2Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T13:47:11Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/SceTypes.hppcore/libs/tests/GuestNpWebApi2.cppcore/libs/SceTypes.hppcore/libs/SceTypes.hppcore/libs/SceTypes.hppImported from boykopovar/AnyPS5. Originally posted by nikowolf123 on 2026-10-20T19:05:09Z.
docs/dev/debt/libSceNpWebApi2.md#L14still says "The pool size is the one given tosceNpWebApi2Initialize". After this change that covers only one of the four initializers.CreateLibraryContextstores every new context's pool ing_pools, andsceNpWebApi2GetMemoryPoolStatsreports it from there. For example, a context fromsceNpWebApi2IntInitializewithpool_size = 0x4000reports 0x4000, although nothing was passed tosceNpWebApi2Initialize. The new test checks this for all three new functions at L70, L75 and L79. I'd suggest naming the initializer that created the context instead:Imported from boykopovar/AnyPS5. Originally posted by orezraey on 2026-10-20T19:50:37Z.
Thanks, applied your wording in
a9a0c05af: the entry now says the pool size is the one given to the initializer that created the context.