feat(libSceNpEntitlementAccess): report signed out from the consumable entitlement requests #8646

Merged
nikowolf123 merged 2 commits from upstream-pr/8646 into main 2026-11-01 22:54:14 +00:00
nikowolf123 commented 2026-10-20 20:04:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nikowolf123 on 2026-10-20T20:04:02Z.


What

sceNpEntitlementAccessRequestConsumeEntitlement, sceNpEntitlementAccessRequestConsumableEntitlementInfo and sceNpEntitlementAccessPollConsumableEntitlementInfo threw not implemented. There is no PSN sign-in, so they now give the signed-out answer that the library's other entitlement requests and polls already give (the consume calls since #292 and #763, the entitlement info calls since #2077 and #3603):

  • sceNpEntitlementAccessRequestConsumeEntitlement(userId, serviceLabel, entitlementLabel, transactionId, useCount, requestId) returns SCE_NP_ERROR_SIGNED_OUT (0x80550006) and does not write *requestId.
  • sceNpEntitlementAccessRequestConsumableEntitlementInfo(userId, serviceLabel, entitlementLabel, requestId) returns 0x80550006 and does not write *requestId.
  • sceNpEntitlementAccessPollConsumableEntitlementInfo(requestId, result, info) returns 0x80550006 and writes neither *result nor *info.

The answer is the same for every argument, null pointers included: no argument is read and there is no state.

Sources, pinned:

  • Parameter lists: dlc_emu scenpentitlementaccess_exports.cpp L146-L220, a replacement libSceNpEntitlementAccess PRX built against the SDK header (dlc_content.h L13 includes np/np_entitlement_access.h). idlesauce's ps4-eboot-dlc-patcher, L185-L254 marks its lists for the same three functions as "parameters assumed" and differs in two parameters: a SceNpServiceEntitlementLabel* in the consume request and an int32_t* useLimit as the poll's third argument. Those two are declared const void* and void*, as is the transaction id (sceNpEntitlementAccessGenerateTransactionId already takes it as void*); nothing reads them.
  • SCE_NP_ERROR_SIGNED_OUT = 0x80550006: shadPS4 np_error.h L15. The constant was already defined in Export.cpp.

Unverified, recorded in docs/dev/debt/libSceNpEntitlementAccess.md:

  • Under Silent stubs: only the signed-out path exists, and whether a signed-out console fails at the request or creates a request whose poll fails is not known. idlesauce's PS4 notes (L256-L289) say that sceNpEntitlementAccessRequestConsumeUnifiedEntitlement "returns ok even offline" and that sceNpEntitlementAccessPollConsumeEntitlement reports 0x817D0019 (TITLE_TOKEN in their header, L83).
  • Under Unknown function info: the parameter lists, and the null requestId check both sources make (their parameter error, 0x817D0002 in idlesauce's header, L81). It is not made here because its order against the signed-out failure is unknown.
  • The entry that listed these three with sceNpEntitlementAccessGetAddcontEntitlementInfoIndividual as having no credible prototype now names only that function.

Nothing here is measured on a PS5.

Tested

  • Linux: WSL2 Ubuntu 26.04 LTS, GCC 15.2.0, Release. Built the targets libSceNpEntitlementAccess and guest_offline_imports_tests with no warnings, then ran ctest -R '^guest_offline_imports$': guest_offline_imports passed (1/1). Again at 17934e157 on main 2c4b116da: passed (1/1).
  • guest_offline_imports now calls the three functions with valid-looking arguments (user 1, service label 0, a unified entitlement label, a zeroed 72-byte transaction id, use count 1) and with null pointers, requires 0x80550006 from every call, and checks that the request id, the result and a 64-byte info buffer keep their fill values.
  • The new checks fail on main: with only the test file changed, the same build and ctest run aborts at the first new call with sceNpEntitlementAccessRequestConsumeEntitlement not implemented.
  • tools/check_conventions.py --base origin/main passes. tools/progress.py --module libSceNpEntitlementAccess counts the three functions as done: 24 of 25 (21 of 25 on main).
  • Windows: not built.
  • No title was 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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4941732328 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8646). Originally posted by [nikowolf123](https://github.com/nikowolf123) on 2026-10-20T20:04:02Z. --- ### What `sceNpEntitlementAccessRequestConsumeEntitlement`, `sceNpEntitlementAccessRequestConsumableEntitlementInfo` and `sceNpEntitlementAccessPollConsumableEntitlementInfo` threw `not implemented`. There is no PSN sign-in, so they now give the signed-out answer that the library's other entitlement requests and polls already give (the consume calls since #292 and #763, the entitlement info calls since #2077 and #3603): - `sceNpEntitlementAccessRequestConsumeEntitlement(userId, serviceLabel, entitlementLabel, transactionId, useCount, requestId)` returns `SCE_NP_ERROR_SIGNED_OUT` (`0x80550006`) and does not write `*requestId`. - `sceNpEntitlementAccessRequestConsumableEntitlementInfo(userId, serviceLabel, entitlementLabel, requestId)` returns `0x80550006` and does not write `*requestId`. - `sceNpEntitlementAccessPollConsumableEntitlementInfo(requestId, result, info)` returns `0x80550006` and writes neither `*result` nor `*info`. The answer is the same for every argument, null pointers included: no argument is read and there is no state. Sources, pinned: - Parameter lists: [dlc_emu `scenpentitlementaccess_exports.cpp` L146-L220](https://github.com/drakmor/dlc_emu/blob/fcf69b16d46a9850578bce19dc2c1b4dc867cbb5/src/dlc_modules/scenpentitlementaccess_exports.cpp#L146-L220), a replacement libSceNpEntitlementAccess PRX built against the SDK header ([`dlc_content.h` L13](https://github.com/drakmor/dlc_emu/blob/fcf69b16d46a9850578bce19dc2c1b4dc867cbb5/src/dlc_modules/dlc_content.h#L13) includes `np/np_entitlement_access.h`). [idlesauce's ps4-eboot-dlc-patcher, L185-L254](https://github.com/idlesauce/ps4-eboot-dlc-patcher/blob/d1d1e0f0dbd5e06da45b7d8f8ca1827d34546692/prx_src/libSceNpEntitlementAccess.c#L185-L254) marks its lists for the same three functions as "parameters assumed" and differs in two parameters: a `SceNpServiceEntitlementLabel*` in the consume request and an `int32_t* useLimit` as the poll's third argument. Those two are declared `const void*` and `void*`, as is the transaction id (`sceNpEntitlementAccessGenerateTransactionId` already takes it as `void*`); nothing reads them. - `SCE_NP_ERROR_SIGNED_OUT = 0x80550006`: [shadPS4 `np_error.h` L15](https://github.com/shadps4-emu/shadPS4/blob/8d50471b7dc141dd700b51276b8edd1f293bce26/src/core/libraries/np/np_error.h#L15). The constant was already defined in `Export.cpp`. Unverified, recorded in `docs/dev/debt/libSceNpEntitlementAccess.md`: - Under Silent stubs: only the signed-out path exists, and whether a signed-out console fails at the request or creates a request whose poll fails is not known. idlesauce's PS4 notes ([L256-L289](https://github.com/idlesauce/ps4-eboot-dlc-patcher/blob/d1d1e0f0dbd5e06da45b7d8f8ca1827d34546692/prx_src/libSceNpEntitlementAccess.c#L256-L289)) say that `sceNpEntitlementAccessRequestConsumeUnifiedEntitlement` "returns ok even offline" and that `sceNpEntitlementAccessPollConsumeEntitlement` reports `0x817D0019` (`TITLE_TOKEN` in [their header, L83](https://github.com/idlesauce/ps4-eboot-dlc-patcher/blob/d1d1e0f0dbd5e06da45b7d8f8ca1827d34546692/prx_src/libSceNpEntitlementAccess.h#L83)). - Under Unknown function info: the parameter lists, and the null `requestId` check both sources make (their parameter error, `0x817D0002` in [idlesauce's header, L81](https://github.com/idlesauce/ps4-eboot-dlc-patcher/blob/d1d1e0f0dbd5e06da45b7d8f8ca1827d34546692/prx_src/libSceNpEntitlementAccess.h#L81)). It is not made here because its order against the signed-out failure is unknown. - The entry that listed these three with `sceNpEntitlementAccessGetAddcontEntitlementInfoIndividual` as having no credible prototype now names only that function. Nothing here is measured on a PS5. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - Linux: WSL2 Ubuntu 26.04 LTS, GCC 15.2.0, Release. Built the targets `libSceNpEntitlementAccess` and `guest_offline_imports_tests` with no warnings, then ran `ctest -R '^guest_offline_imports$'`: `guest_offline_imports` passed (1/1). Again at 17934e157 on `main` 2c4b116da: passed (1/1). - `guest_offline_imports` now calls the three functions with valid-looking arguments (user 1, service label 0, a unified entitlement label, a zeroed 72-byte transaction id, use count 1) and with null pointers, requires `0x80550006` from every call, and checks that the request id, the result and a 64-byte info buffer keep their fill values. - The new checks fail on `main`: with only the test file changed, the same build and ctest run aborts at the first new call with `sceNpEntitlementAccessRequestConsumeEntitlement not implemented`. - `tools/check_conventions.py --base origin/main` passes. `tools/progress.py --module libSceNpEntitlementAccess` counts the three functions as done: 24 of 25 (21 of 25 on `main`). - Windows: not built. - No title was run. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ycbuzi commented 2026-10-21 06:58:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T06:58:30Z.


Windows run of 1f53254d46 merged onto main ec7eacc62d (d2f1758db6, clean), the build the description lists as not done. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release, BUILD_TESTING=ON.

Built libSceNpEntitlementAccess and guest_offline_imports_tests with no errors or warnings; ctest --repeat until-fail:2 on guest_offline_imports: passes on both repeats. Not run: the negative control against main's library, a title.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6310061209 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8646#issuecomment-6310061209). Originally posted by [ycbuzi](https://github.com/ycbuzi) on 2026-10-21T06:58:30Z. --- Windows run of 1f53254d46 merged onto `main` ec7eacc62d (d2f1758db6, clean), the build the description lists as not done. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release, `BUILD_TESTING=ON`. Built `libSceNpEntitlementAccess` and `guest_offline_imports_tests` with no errors or warnings; `ctest --repeat until-fail:2` on `guest_offline_imports`: passes on both repeats. Not run: the negative control against `main`'s library, a title.
harisibrar1 commented 2026-10-24 15:32:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T15:32:43Z.

Review: COMMENTED


Checked against main b607bfdc8b, dlc_emu fcf69b16 (scenpentitlementaccess_exports.cpp L145-220) and idlesauce d1d1e0f0 (libSceNpEntitlementAccess.c L185-290):

  • The parameter lists match dlc_emu, and idlesauce's IDA prototypes agree on the argument counts (4, 3 and 6).
  • The 0x80550006 answer itself isn't measured, as the description says. CONTRIBUTING.md and AGENTS.md ask for unknown behaviour to throw; a silent stub is allowed only when it unblocks a named title and only affects the UI. This PR names no title, and consumable entitlements aren't UI. Is there a title that stops on these three? If so, naming it would make the stub admissible; otherwise keeping them throwing with the new signatures seems closer to the rules.
  • The one observation cited cuts the other way: idlesauce's note says sceNpEntitlementAccessRequestConsumeUnifiedEntitlement "returns ok even offline". That's PS4 and offline rather than PS5 signed out, so it isn't conclusive, but it suggests the request may succeed and the poll fail.
  • The branch conflicts with main in core/libs/tests/GuestOfflineImports.cpp, where the test prelude now uses typed signatures. Main also types transaction ids as NpEntitlementAccessTransactionId (Export.cpp:135, :144, :149; SceTypes.hpp:1520), so the const void* reasoning no longer applies to the transaction id.
  • Main's debt file already has an "Entitlement requests and polls" entry about the signed-out responses; the new entries could be folded into it.

Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638796047 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8646#pullrequestreview-5638796047). Originally posted by [harisibrar1](https://github.com/harisibrar1) on 2026-10-24T15:32:43Z. **Review:** COMMENTED --- Checked against main b607bfdc8b, dlc_emu fcf69b16 (`scenpentitlementaccess_exports.cpp` L145-220) and idlesauce d1d1e0f0 (`libSceNpEntitlementAccess.c` L185-290): - The parameter lists match dlc_emu, and idlesauce's IDA prototypes agree on the argument counts (4, 3 and 6). - The 0x80550006 answer itself isn't measured, as the description says. CONTRIBUTING.md and AGENTS.md ask for unknown behaviour to throw; a silent stub is allowed only when it unblocks a named title and only affects the UI. This PR names no title, and consumable entitlements aren't UI. Is there a title that stops on these three? If so, naming it would make the stub admissible; otherwise keeping them throwing with the new signatures seems closer to the rules. - The one observation cited cuts the other way: idlesauce's note says `sceNpEntitlementAccessRequestConsumeUnifiedEntitlement` "returns ok even offline". That's PS4 and offline rather than PS5 signed out, so it isn't conclusive, but it suggests the request may succeed and the poll fail. - The branch conflicts with main in `core/libs/tests/GuestOfflineImports.cpp`, where the test prelude now uses typed signatures. Main also types transaction ids as `NpEntitlementAccessTransactionId` (Export.cpp:135, :144, :149; SceTypes.hpp:1520), so the `const void*` reasoning no longer applies to the transaction id. - Main's debt file already has an "Entitlement requests and polls" entry about the signed-out responses; the new entries could be folded into it. Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!8646
No description provided.