feat(libSceInvitationDialog): finish the PS4 invitation dialog as canceled without a window #11379
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11379"
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 Terminev on 2026-10-26T09:57:26Z.
What
Implements the six libSceInvitationDialog (PS4) exports, which all threw, the way libSceNpProfileDialog handles a dialog it cannot show: no window opens and no invitation is sent, the dialog finishes at once as canceled by the user.
Initialize,Terminate,UpdateStatus: the common dialog state (NOT_SYSTEM_INITIALIZED,ALREADY_INITIALIZED,BUSY,NOT_INITIALIZED), see below.Open(param):ARG_NULLfor a null param, then the dialog goes straight toFINISHEDand keeps the param'scallbackArg.GetResult(result):NOT_INITIALIZED,NOT_FINISHED,ARG_NULL, then returns 0 witherrorCode0,resultUSER_CANCELED, thecallbackArgof the lastOpen, and a recipient count of 0 when the result carries a recipient list.Close:NOT_INITIALIZED; otherwise the dialog is never running here, and the error for that is unsettled, so it throws.Layouts:
InvitationDialogParam(144 bytes) and the field names ofInvitationDialogResultcome from shadPS4's header. They agree with what the debt entry already recorded fromlibSceInvitationDialog.sprx: the eight bytes copied from the open parameter to 0x00 arecallbackArg, and 0x0C isresult. The fields are renamed accordingly ininclude/Api.hpp; the offsets are unchanged and still asserted.Cases no source settles throw, as in libSceNpProfileDialog:
OpenbeforeInitialize, a param whosesizeis not 144 or whosemodeis neither send nor receive,Closeon a dialog that is not running, and a result with a non-zero reserved byte (the module checks 0x18..0x37, the error is unknown).baseParam,userIdanddataParamare not checked. Everything is recorded indocs/dev/debt/libSceInvitationDialog.md; the old "every call throws" entry forCloseis replaced.Initializechecks the common dialog system through libSceCommonDialog, which now records whether a dialog holds it:sceCommonDialogIsUsedreturns that instead of always false, andinclude/DialogUse.hppdeclares the host helpers that check, take and free it.InitializereturnsNOT_SYSTEM_INITIALIZEDbeforesceCommonDialogInitialize, thenALREADY_INITIALIZED, thenBUSYwhile the system is held, in shadPS4's order, andTerminatefrees it. Only this library takes the system so far; both debt files record that.The library gets a
CMakeLists.txtwith its test, like libSceNpProfileDialog, and links libSceCommonDialog.Tested
Linux x86-64 (Intel Xeon @ 2.10GHz with AVX2, FMA, F16C, BMI1, BMI2, LZCNT and MOVBE), GCC 13.3, Release, on
aac9d6470based on main at5b5d24cb2:ctest -R '^guest_invitation_dialog$',ctest -R '^guest_common_dialog$', the tests of the other dialog libraries andctest -R public_headers(65/65) pass. The patchedlibSceInvitationDialog.prxexports the six NIDs shadPS4 lists for these functions and imports the three libSceCommonDialog helpers by name. Breaking the code on purpose (an accepted instead of canceled result, a lostcallbackArg, a recipient count left as is, an invalid mode accepted, a secondInitializeaccepted, the system check, the busy check or the release removed) makes the test fail. SDL was configured with its XRandR and audio checks disabled locally, since that machine lacks those headers; these libraries and their tests do not use SDL.python3 tools/check_conventions.py --base origin/mainandgit diff --checkpass. Not built on Windows. No title tested.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
https://claude.ai/code/session_01RoucYS7mQpV23WDUEwXLuU
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T10:00:01Z.
Review: CHANGES_REQUESTED
The parameter layout and callback/result offsets are supported by the supplied module analysis, and the exact-head test report exercises the canceled-result and state transitions. I found one blocking mismatch with the repository’s implementation rule in
AGENTS.md: the PR’s own Functional debt entry saysInitializedoes not returnNOT_SYSTEM_INITIALIZEDorBUSY, butsceInvitationDialogInitialize()unconditionally succeeds whenever this dialog’s local status isNONE. The current CommonDialog implementation has separate initialization state andsceCommonDialogIsUsed()currently always returns false, so this PR cannot safely infer that the common-dialog system is ready or available. Please either add a shared state/query that models those preconditions and test uninitialized/busy calls, or keep the unsupported initialization path throwing and documented instead of reporting success. TheClosepath afterOpenremains an explicitly documented unknown and throws; I have not treated its unmeasured return code as an implementation defect. Hosted conventions, intake, eligibility, labels and report checks pass; product jobs are path-skipped. My local configure did not reach the target test: system-deps configuration lacks SDL2, and bundled configuration stops because the SDL2 submodule is absent and XRandR is unavailable. The reported Linux focused test is therefore the available execution result.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T10:18:00Z.
Review: APPROVED
Reviewed updated head
aac9d6470c76921edf91260c929fa1c96f4aa191. The previous blocker is resolved:Initializenow checks common-system initialization, returns BUSY when the shared acquire fails, and records local state only after acquiring;Terminatereleases the shared state.GuestInvitationDialogcovers the uninitialized, occupied, acquired and released paths, andGuestCommonDialogchecks the shared state transitions. The debt notes accurately limit the current shared-state coverage to this dialog. Hosted eligibility, conventions, labels and progress-report checks pass; product jobs are path-skipped.