feat(libSceSystemService): convert between the running title's app id and title id #8354
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8354"
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 MarrasFederico on 2026-10-20T10:57:25Z.
What
sceSystemServiceGetAppId,sceSystemServiceGetAppTitleIdandsceLncUtilGetAppTitleIdwere parameterless throwing stubs among the firmware 3.20 pending exports. SharpProsperoSystemService.csdocuments them:int sceSystemServiceGetAppId(const char* titleId)converts a title id to its application id;int sceSystemServiceGetAppTitleId(int appId, char* titleId)writes the NUL-terminated title id into a buffer of at least 10 bytes;sceLncUtilGetAppTitleId(appId, titleId)does the same through the launcher utility. SharpProspero declares itvoid, butmainnow declares itint sceLncUtilGetAppTitleId(std::int32_t appId, char* titleId)among the pending exports. It takes that signature and returns 0 on success, likesceSystemServiceGetAppTitleId.AnyPS5 runs one title, whose app id is
SYSTEM_SERVICE_RUNNING_APP_ID(whatsceSystemServiceGetAppIdOfRunningBigAppreturns) and whose title id comes fromparam.jsonorparam.sfo. The three calls now move between the two for that title, next tosceSystemServiceGetAppIdOfRunningBigApp:sceSystemServiceGetAppIdreturns the running app id for exactly the running title id.sceSystemServiceGetAppTitleId/sceLncUtilGetAppTitleIdwrite the running title id and its NUL for the running app id, and nothing past them.sceSystemServiceKillAppdoes for another application: another title id or app id, a null pointer, and a running title id that does not fit the 10-byte buffer. SharpProspero namesErrorNoAppInfoonly forsceSystemServiceGetAppFocusedAppStatus, so it is not used here.The debt file records these throwing cases, and the pending-exports count drops from 477 to 474.
Tested
Ubuntu 26.04.1, kernel 7.0.0-38, GCC 15.2.0, Release, full build with
BUILD_TESTING=ON. Windows was not compiled. No title was run.guest_system_service_app_title_id, run three times, each in its own directory:known(param.jsonwithPPSA00000):GetAppId("PPSA00000")returns the running app id, and both title id calls writePPSA00000and its NUL for it, leaving the bytes after the 10-byte window untouched.GetAppIdthrows forPPSA00001, a lowercase, shorter or longer id, leading or trailing spaces,CUSA00000and an empty string.INT_MIN,INT_MAX, the running id plus one and0xFFFFFFFF, and for null buffers, without writing.long(a 10-character title id):GetAppIdworks, and both title id calls throw without writing.missing(noparam.jsonorparam.sfo): all three throw without writing.main,knownandlongfail, since every call throws. Writing the id without its NUL, matching a prefix of the title id, accepting any app id, or letting a 10-character id through makes the test fail.guest_system_service,guest_system_service_languageandguest_system_service_time_zonestill pass.main524398151f. It takesmain's new pending-export signatures and removes its three stubs of these functions. The test now also requiressceLncUtilGetAppTitleIdto return 0. All 10guest_system_service*tests pass. The pending-exports debt entry ismain's new text, which no longer carries a count.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pyreports #8335, which also edits the pending-exports count on line 19 of the debt file: whichever is merged second updates that number. It could not compare #6044 (test reorganization) and #7201 (macOS port), which conflict withmain; neither touches these three calls.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)Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T07:46:31Z.
Windows run of
7c83407e11merged ontomainb77bd58806(690a8ebc1e), 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.The merge conflicts only in
docs/dev/debt/libSceSystemService.md, as GitHub shows; for this run I took this PR's side of that, and the code merged without conflicts. BuiltlibSceSystemServiceandguest_system_service_app_title_id_testswith no errors. The build also rebuildslibSceAgcDriver, which prints twomemcmpbound warnings, asmaindoes fromGraphics/src/PipelineLibrary.cpp.ctest --repeat until-fail:2onguest_system_service_app_title_id_known,_longand_missing: all pass on both repeats. Not run: the negative control againstmain's library, a title.Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-22T08:34:25Z.
Windows run of
e0e231ef3f, the update since my earlier run, merged ontomaind6eafa54d0(8a7389d16c, clean). Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release,BUILD_TESTING=ON.Built
libSceSystemServiceandguest_system_service_app_title_id_testswith no errors. The build also rebuildslibSceAgcDriver, which prints twomemcmpbound warnings, asmaindoes fromGraphics/src/PipelineLibrary.cpp.ctest --repeat until-fail:2onguest_system_service_app_title_id_known,_longand_missing: all pass on both repeats. The negative control, which my earlier run left out: withExport.cppandPendingExports.cppoflibSceSystemServicetaken frommain,_knownand_longabort withsceSystemServiceGetAppId not implemented(exit code0xc0000409), and_missingstill passes. Not run: a title.