feat(libSceContentSearch): implement sceContentSearchOpenMetadata, CloseMetadata, GetMetadataFieldInfo, GetMetadataValue, SearchContent #1564

Closed
Deses wants to merge 1 commit from upstream-pr/1564 into main
Deses commented 2026-10-08 12:43:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Deses on 2026-10-08T12:43:43Z.


What

Gives sceContentSearchOpenMetadata, sceContentSearchCloseMetadata, sceContentSearchGetMetadataFieldInfo, sceContentSearchGetMetadataValue and sceContentSearchSearchContent their real signatures (they were declared without parameters) and implements the empty content library the host has.

  • SearchContent (9 arguments, 3 on the stack) returns 0 with numOfContent 0 and lastUpdateId 0 (when given). A limit above 92 returns 0x809D100A. Null numOfContent, a null column set, order-by list or info array with a non-zero length or limit, and calls before Init throw, as Init and Term already do.
  • OpenMetadata throws: no path is in the library, and the console's error for that is unknown. The id taken by CloseMetadata, GetMetadataFieldInfo and GetMetadataValue can therefore never be valid, so they validate their arguments and throw.
  • Search and sort conditions and the 0x960-byte SceContentSearchContentInfo are not read or written, so no structures are added to SceTypes.hpp.
  • Recorded in TechnicalDebt (Unknown function info). New CMakeLists.txt for the library to register the test.

Signatures and NIDs (recomputed with tools/nid_names.py, all match):

  • AlexAltea/orbital tools/ida/db_types.json lines 555-569
  • SharpProspero ContentSearch.cs lines 267-316 (signatures; limit 92 and 0x809D100A at lines 262-265; ContentLibrary.cs reads numOfContent after a successful call and builds an empty list for 0)
  • NIDs: OpenMetadata G13HF1z-e4o, CloseMetadata -YbpaF0XS-I, GetMetadataFieldInfo EbNufIY0Zvc, GetMetadataValue ruNe-FgCzO8, SearchContent TEW3IKxYfXc (also in the ChonkyStation4 and ps5rs NID lists)

Unconfirmed: the console's result for an empty library (inferred from SharpProspero only), the update id value, and the error for a path or metadata id that is not in the library. shadPS4, OpenOrbis and Kyty have no implementation of these calls.

Tested

Windows 11, GCC 15.2.0 (WinLibs), Release, build of this branch's worktree rebased on current upstream/main (full build, libs target, ctest): ctest -R guest_content_search passes (empty search result and update id, limit 92 accepted and 93 rejected without touching the output, argument checks, calls before Init and after Term throw, OpenMetadata and CloseMetadata throw). check_conventions.py and check_test_registration.py clean. No title tested.

CI: the upstream runs for this head are waiting for approval (#1631). The same Build workflow ran on the fork for head 79f12242: https://github.com/Deses/AnyPS5/actions/runs/37804522863, Linux and Windows (full build, libs, ctest) green.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4786973635 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1564). Originally posted by [Deses](https://github.com/Deses) on 2026-10-08T12:43:43Z. --- ### What Gives `sceContentSearchOpenMetadata`, `sceContentSearchCloseMetadata`, `sceContentSearchGetMetadataFieldInfo`, `sceContentSearchGetMetadataValue` and `sceContentSearchSearchContent` their real signatures (they were declared without parameters) and implements the empty content library the host has. - `SearchContent` (9 arguments, 3 on the stack) returns 0 with `numOfContent` 0 and `lastUpdateId` 0 (when given). A limit above 92 returns `0x809D100A`. Null `numOfContent`, a null column set, order-by list or info array with a non-zero length or limit, and calls before `Init` throw, as `Init` and `Term` already do. - `OpenMetadata` throws: no path is in the library, and the console's error for that is unknown. The id taken by `CloseMetadata`, `GetMetadataFieldInfo` and `GetMetadataValue` can therefore never be valid, so they validate their arguments and throw. - Search and sort conditions and the 0x960-byte `SceContentSearchContentInfo` are not read or written, so no structures are added to `SceTypes.hpp`. - Recorded in TechnicalDebt (Unknown function info). New `CMakeLists.txt` for the library to register the test. Signatures and NIDs (recomputed with `tools/nid_names.py`, all match): - AlexAltea/orbital [`tools/ida/db_types.json` lines 555-569](https://github.com/AlexAltea/orbital/blob/b321fcdbd700cc02da1cb1ad25412781d5ec73c6/tools/ida/db_types.json#L555-L569) - SharpProspero [`ContentSearch.cs` lines 267-316](https://github.com/SvenGDK/SharpProspero/blob/c183fb1b3d83083fce9ae671c3486800ab2f174e/src/SharpProspero/Interop/Content/ContentSearch.cs#L267-L316) (signatures; limit 92 and `0x809D100A` at lines 262-265; `ContentLibrary.cs` reads `numOfContent` after a successful call and builds an empty list for 0) - NIDs: OpenMetadata `G13HF1z-e4o`, CloseMetadata `-YbpaF0XS-I`, GetMetadataFieldInfo `EbNufIY0Zvc`, GetMetadataValue `ruNe-FgCzO8`, SearchContent `TEW3IKxYfXc` (also in the ChonkyStation4 and ps5rs NID lists) Unconfirmed: the console's result for an empty library (inferred from SharpProspero only), the update id value, and the error for a path or metadata id that is not in the library. shadPS4, OpenOrbis and Kyty have no implementation of these calls. ### Tested Windows 11, GCC 15.2.0 (WinLibs), Release, build of this branch's worktree rebased on current upstream/main (full build, `libs` target, ctest): `ctest -R guest_content_search` passes (empty search result and update id, limit 92 accepted and 93 rejected without touching the output, argument checks, calls before `Init` and after `Term` throw, `OpenMetadata` and `CloseMetadata` throw). `check_conventions.py` and `check_test_registration.py` clean. No title tested. CI: the upstream runs for this head are waiting for approval (#1631). The same Build workflow ran on the fork for head `79f12242`: https://github.com/Deses/AnyPS5/actions/runs/37804522863, Linux and Windows (full build, `libs`, ctest) green. ### Checklist - [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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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: none - [x] AI-assisted: yes
oneandonlydean commented 2026-10-09 08:57:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:57:25Z.


Same as #1582.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077744001 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1564#issuecomment-6077744001). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T08:57:25Z. --- Same as #1582.

Pull request closed

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!1564
No description provided.