Skip to content

feat(libSceNpCppWebApi): track the TitleCloudStorage and InGameCatalog parameter lifecycles as the module does - #11252

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
AlexFigas:feat/npcppwebapi-parameter-lifecycle
Oct 26, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
AlexFigas:feat/npcppwebapi-parameter-lifecycle

Conversation

@AlexFigas

Copy link
Copy Markdown
Contributor

What

Several parameter exports threw:

  • TitleCloudStorage::V1::DataApi::ParameterToGetMultiDataStatusesByUser: constructor, initialize, setfields, terminate and destructor.
  • DataApi::ParameterToDownloadData::setobjectId.
  • InGameCatalog::V5::ContainerApi::ParameterToGetContainer: constructor, isInitialized and setserviceLabel.

The rest of these three classes succeeded without state, so isInitialized could not be answered. All three now follow the module bundled with PPSA21564 (sce_module/libSceNpCppWebApi.prx, the library's own code). In the module, a parameter object is {ParameterBase implementation at +0, class implementation at +8}:

Member Module Here
constructor (0xc8360, 0x2fb8e0) ParameterBase constructor zeroes +0, then +8 = 0 zeroes +0 and +8
initialize (0xc83c0, 0x2fb940, 0x2f6f40) null LibContext → 0x80553503; context not found → 0x80553502; +8 != 0 → 0x8055350f; allocates the implementation (OOM → 0x80553504), then String::copyFrom of each string argument, which returns 0x80553503 for null and undoes the initialize same checks in the same order. A LibContext counts as not found when its value is 0, which is what Common::terminate leaves and Common::initialize replaces. +8 holds a marker instead of an allocation
isInitialized (0xc85a0) [rdi + 8] != 0 same
setfields, setobjectId, setcontainerIds (0x2fbce0, 0x2f72a0, 0xc85d0) +8 == 0 → 0x80553502; otherwise String::copyFrom, 0x80553503 for null same codes; the string is not kept
setserviceLabel (0xc88a0), like setsort/setoffset/setlimit stores the value only when +8 != 0, no result stores nothing
terminate (0xc8530, 0x2fbc00) +8 == 0 → 0x80553510; otherwise frees it, +8 = 0, returns 0 same
destructor jmp ParameterBase::~ParameterBase, a bare ret does nothing

No value is kept, because only a request would read one, and requests fail with SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN here. The TitleCloudStorage entry under Silent stubs now says this for all three classes.

Tested

On Ubuntu 24.04 under WSL2 (GCC 13.3, Release), ctest --test-dir build -R np_cpp_web_api passes all 4 tests. guest_np_cpp_web_api_offline gains TestParameterLifecycles, which runs each of the three classes through the same sequence:

  • the constructor zeroes exactly 0x10 bytes;
  • a setter returns 0x80553502 and terminate returns 0x80553510 before initialize;
  • initialize returns 0x80553503 for a null context and 0x80553502 for a context Common::initialize has not set;
  • initialize returns 0x80553503 for a null string argument and leaves the parameter uninitialized;
  • initialize then succeeds, and a second call returns 0x8055350f;
  • a setter returns 0x80553503 for null and 0 otherwise;
  • terminate succeeds once, then returns 0x80553510;
  • the parameter can be initialized again;
  • isInitialized tracks every step for ParameterToGetContainer.

Also run:

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

Copy link
Copy Markdown

Progress report (b90d009 → fcf9754)

📈 System libraries: 50.16% (+0.07%, +9 implemented functions)

✅ 9 implemented
Library Name
libSceNpCppWebApi _ZN3sce2Np9CppWebApi13InGameCatalog2V512ContainerApi23ParameterToGetContainer15setserviceLabelEi
libSceNpCppWebApi _ZN3sce2Np9CppWebApi13InGameCatalog2V512ContainerApi23ParameterToGetContainerC1Ev
libSceNpCppWebApi _ZN3sce2Np9CppWebApi17TitleCloudStorage2V17DataApi23ParameterToDownloadData11setobjectIdEPKc
libSceNpCppWebApi _ZN3sce2Np9CppWebApi17TitleCloudStorage2V17DataApi37ParameterToGetMultiDataStatusesByUser10initializeEPNS1_6Common10LibContextEPKcSA_
libSceNpCppWebApi _ZN3sce2Np9CppWebApi17TitleCloudStorage2V17DataApi37ParameterToGetMultiDataStatusesByUser9setfieldsEPKc
libSceNpCppWebApi _ZN3sce2Np9CppWebApi17TitleCloudStorage2V17DataApi37ParameterToGetMultiDataStatusesByUser9terminateEv
libSceNpCppWebApi _ZN3sce2Np9CppWebApi17TitleCloudStorage2V17DataApi37ParameterToGetMultiDataStatusesByUserC1Ev
libSceNpCppWebApi _ZN3sce2Np9CppWebApi17TitleCloudStorage2V17DataApi37ParameterToGetMultiDataStatusesByUserD1Ev
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi13InGameCatalog2V512ContainerApi23ParameterToGetContainer13isInitializedEv
⚪ 2 behaviourally empty (constant return or throw)
Library Name
libSceNpCppWebApi _ZN3sce2Np9CppWebApi13InGameCatalog2V512ContainerApi23ParameterToGetContainer15setserviceLabelEi
libSceNpCppWebApi _ZN3sce2Np9CppWebApi17TitleCloudStorage2V17DataApi37ParameterToGetMultiDataStatusesByUserD1Ev

Changed libraries (implemented exports)

Library Before After Change
libSceNpCppWebApi 408/664 (61.45%) 417/664 (62.80%) +1.36 pp

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head fcf9754a29bd24441dc7cc3fe84d9f99d6253a81 against current main b90d009d9f73354cbea239a74a8f7e2dcd138772. The lifecycle state and error ordering match the module behavior documented in the PR: construction initializes the two object slots, initialization rejects null/uninitialized contexts and duplicate initialization, setters reject uninitialized/null inputs, and termination clears the initialized slot. The no-storage limitation is recorded in the debt entry and is consistent with requests still failing as not signed in. Local diff-check and conventions pass; merge previews with #11235 and #11248 are clean. Hosted eligibility, conventions, intake, labels and report checks pass; platform product jobs are skipped. The author reports the focused Ubuntu/WSL2 np_cpp_web_api tests pass 4/4; I did not rerun them locally because this checkout has only a relinker build and full configuration is unavailable here.

@babyhuey

Copy link
Copy Markdown
Contributor

Windows run of this head fcf9754a29b, merged onto main 9b197b6ce45 (clean merge, local only), with the selection CI's skipped Windows product job uses: Windows 11, Ryzen 7 5800X, RTX 3080, WinLibs GCC 15.2, Release, BUILD_TESTING=ON. The tree was configured fresh after the merge, then select_tests.py select / ninja -f select.ninja selected / --target libs / select_tests.py ctest --parallel 4 --timeout 120, with check_skips.py --job windows (all skips expected).

  • Selected 378 tests: 371 pass, 1 fails, pr_overlap_encoding, which also fails on 9b197b6ce45 itself on this machine. No failures from this PR.

AI-assisted: yes (Claude Code)

@oneandonlydean
oneandonlydean merged commit 1e22d0f into boykopovar:main Oct 26, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants