feat(signindialog): implement close, get-result and get-status #560

Closed
Phi1ow wants to merge 2 commits from upstream-pr/560 into main
Phi1ow commented 2026-10-04 20:46:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-04T20:46:42Z.


What

sceSigninDialogClose, sceSigninDialogGetResult and sceSigninDialogGetStatus were the three
remaining throwing stubs in libSceSigninDialog; the other four exports already implement the
common-dialog state machine. They now complete it:

  • sceSigninDialogGetStatus -> the status.
  • sceSigninDialogClose -> ok, or 0x80B80003 when not initialized.
  • sceSigninDialogGetResult -> once FINISHED, reports the user-cancelled outcome (no PSN
    sign-in UI exists, so middleware takes its offline path); otherwise 0x80B80003 /
    0x80B8000D (null) / 0x80B80005 (not finished).

Uses the shared common-dialog status and error codes already defined in the file, and the
user-cancelled result value already used by libSceWebBrowserDialog. Adds a CMakeLists.txt
so the library can carry its guest test.

Tested

New test core/libs/tests/GuestSigninDialog.cpp (registered as guest_signin_dialog) drives
the full state machine including the three new functions.

Built with MinGW-w64 GCC 15.2.0 (the CI toolchain) on Windows 11; ctest -R guest_signin_dialog
passes. On main the three functions throw not implemented, so the test aborts without the
change.

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:4737502381 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/560). Originally posted by [Phi1ow](https://github.com/Phi1ow) on 2026-10-04T20:46:42Z. --- ### What `sceSigninDialogClose`, `sceSigninDialogGetResult` and `sceSigninDialogGetStatus` were the three remaining throwing stubs in `libSceSigninDialog`; the other four exports already implement the common-dialog state machine. They now complete it: - `sceSigninDialogGetStatus` -> the status. - `sceSigninDialogClose` -> ok, or `0x80B80003` when not initialized. - `sceSigninDialogGetResult` -> once `FINISHED`, reports the user-cancelled outcome (no PSN sign-in UI exists, so middleware takes its offline path); otherwise `0x80B80003` / `0x80B8000D` (null) / `0x80B80005` (not finished). Uses the shared common-dialog status and error codes already defined in the file, and the user-cancelled result value already used by `libSceWebBrowserDialog`. Adds a `CMakeLists.txt` so the library can carry its guest test. ### Tested New test `core/libs/tests/GuestSigninDialog.cpp` (registered as `guest_signin_dialog`) drives the full state machine including the three new functions. Built with MinGW-w64 GCC 15.2.0 (the CI toolchain) on Windows 11; `ctest -R guest_signin_dialog` passes. On `main` the three functions throw `not implemented`, so the test aborts without the change. ### 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-04 21:19:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T21:19:45Z.


Thanks. Reporting USER_CANCELED matches main's libSceWebBrowserDialog, and it's consistent with libSceNpManager, which treats the user as signed out. sceSigninDialogOpen (which PPSA21564 calls) is unchanged.

One small change: sceSigninDialogGetResult zeroes 16 bytes of the caller's buffer, but nothing says the result struct is that size. sceWebBrowserDialogGetResult only writes the leading int32 result. Could you do the same here, or point to where the 16 bytes come from? Please also add the dialog to the "Silent stubs" list in docs/dev/TechnicalDebt.md, since it finishes without any UI (the same line can cover #559).

The CI run on this PR still needs approval; I'll check it once it has run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5984498574 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/560#issuecomment-5984498574). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T21:19:45Z. --- Thanks. Reporting `USER_CANCELED` matches main's `libSceWebBrowserDialog`, and it's consistent with `libSceNpManager`, which treats the user as signed out. `sceSigninDialogOpen` (which PPSA21564 calls) is unchanged. One small change: `sceSigninDialogGetResult` zeroes 16 bytes of the caller's buffer, but nothing says the result struct is that size. `sceWebBrowserDialogGetResult` only writes the leading `int32` result. Could you do the same here, or point to where the 16 bytes come from? Please also add the dialog to the "Silent stubs" list in docs/dev/TechnicalDebt.md, since it finishes without any UI (the same line can cover #559). The CI run on this PR still needs approval; I'll check it once it has run.
github-actions[bot] commented 2026-10-04 22:29:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T22:29:52Z.


Progress report (5fc8755 → 43eba76)

📈 System libraries: 87.18% (+0.1%, +3 implemented functions)

✅ 3 implemented
Library Name
libSceSigninDialog sceSigninDialogClose
libSceSigninDialog sceSigninDialogGetResult
libSceSigninDialog sceSigninDialogGetStatus
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985156634 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/560#issuecomment-5985156634). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-04T22:29:52Z. --- <!-- progress-report --> ### Progress report (5fc8755 → 43eba76) 📈 **System libraries**: 87.18% (+0.1%, +3 implemented functions) <details> <summary>✅ 3 implemented</summary> | Library | Name | | - | - | | libSceSigninDialog | `sceSigninDialogClose` | | libSceSigninDialog | `sceSigninDialogGetResult` | | libSceSigninDialog | `sceSigninDialogGetStatus` | </details>
Phi1ow commented 2026-10-04 22:34:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-04T22:34:24Z.


Done. sceSigninDialogGetResult now writes only the leading int32 result instead of zeroing 16 bytes, and added the dialog to the "Silent stubs" list.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985191742 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/560#issuecomment-5985191742). Originally posted by [Phi1ow](https://github.com/Phi1ow) on 2026-10-04T22:34:24Z. --- Done. `sceSigninDialogGetResult` now writes only the leading `int32` result instead of zeroing 16 bytes, and added the dialog to the "Silent stubs" list.
oneandonlydean commented 2026-10-04 23:43:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T23:43:55Z.


Thanks, sceSigninDialogGetResult now writes only the leading int32 and the test checks that the rest of the buffer is left alone, and the dialog is in the silent stubs list. guest_signin_dialog passes here and CI is green. Ready to merge from my side (the TechnicalDebt line sits next to #558's and #559's, so a one-line rebase may be needed depending on order).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5985701929 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/560#issuecomment-5985701929). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T23:43:55Z. --- Thanks, `sceSigninDialogGetResult` now writes only the leading int32 and the test checks that the rest of the buffer is left alone, and the dialog is in the silent stubs list. `guest_signin_dialog` passes here and CI is green. Ready to merge from my side (the TechnicalDebt line sits next to #558's and #559's, so a one-line rebase may be needed depending on order).
oneandonlydean commented 2026-10-05 01:18:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T01:18:19Z.


#558 is on main now, and its libSceErrorDialog line sits where this one goes in the silent stubs list of docs/dev/TechnicalDebt.md, so this needs a one-line rebase that keeps both lines. #559 adds its line at the same spot, so whichever of the two lands second will need the same. Ready to merge from my side after that.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5986480870 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/560#issuecomment-5986480870). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-05T01:18:19Z. --- #558 is on main now, and its libSceErrorDialog line sits where this one goes in the silent stubs list of docs/dev/TechnicalDebt.md, so this needs a one-line rebase that keeps both lines. #559 adds its line at the same spot, so whichever of the two lands second will need the same. Ready to merge from my side after that.
oneandonlydean commented 2026-10-06 21:20:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T21:20:53Z.


Are you still working on this? It still needs the one-line docs/dev/TechnicalDebt.md rebase from 10-05; the code was ready from my side then. If you'd rather not continue, please say so, and it can be closed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6025675380 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/560#issuecomment-6025675380). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-06T21:20:53Z. --- Are you still working on this? It still needs the one-line `docs/dev/TechnicalDebt.md` rebase from 10-05; the code was ready from my side then. If you'd rather not continue, please say so, and it can be closed.
Phi1ow commented 2026-10-06 21:52:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Phi1ow on 2026-10-06T21:52:18Z.


Rebased, same as #559: kept the libSceErrorDialog line that's on main and added the libSceSigninDialog one. guest_signin_dialog passes here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6026126416 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/560#issuecomment-6026126416). Originally posted by [Phi1ow](https://github.com/Phi1ow) on 2026-10-06T21:52:18Z. --- Rebased, same as #559: kept the libSceErrorDialog line that's on main and added the libSceSigninDialog one. guest_signin_dialog passes here.
Saalik commented 2026-10-06 22:30:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Saalik on 2026-10-06T22:30:02Z.


Since the result-struct size came up earlier: the 16-byte figure comes from SharpProspero's SigninDialog.cs, which defines SceSigninDialogResult as an int32 result followed by three reserved int32s — the same on-device interop source the player invitation dialog's 40-byte layout is taken from in docs/dev/TechnicalDebt.md. No change suggested here; the leading-int32-only write is the safer ABI either way. Just leaving the provenance on record.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6026632047 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/560#issuecomment-6026632047). Originally posted by [Saalik](https://github.com/Saalik) on 2026-10-06T22:30:02Z. --- Since the result-struct size came up earlier: the 16-byte figure comes from SharpProspero's [SigninDialog.cs](https://github.com/SvenGDK/SharpProspero/blob/main/src/SharpProspero/Interop/Dialog/SigninDialog.cs), which defines SceSigninDialogResult as an int32 result followed by three reserved int32s — the same on-device interop source the player invitation dialog's 40-byte layout is taken from in docs/dev/TechnicalDebt.md. No change suggested here; the leading-int32-only write is the safer ABI either way. Just leaving the provenance on record.
oneandonlydean commented 2026-10-06 22:42:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T22:42:26Z.


Thanks for the rebase. #559 is merged now, and both add their line next to libSceErrorDialog in the silent stubs list, so this branch conflicts with main in docs/dev/TechnicalDebt.md again. Could you rebase once more? Nothing else needs to change.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6026787983 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/560#issuecomment-6026787983). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-06T22:42:26Z. --- Thanks for the rebase. #559 is merged now, and both add their line next to libSceErrorDialog in the silent stubs list, so this branch conflicts with main in `docs/dev/TechnicalDebt.md` again. Could you rebase once more? Nothing else needs to change.
adriadam10 commented 2026-10-07 15:47:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T15:47:06Z.

Review: CHANGES_REQUESTED


Thanks. Checked against the references before the rebase; one thing to fix (cc @oneandonlydean, since this was ready from your side):

  • Error codes: the new returns use the common-dialog family (0x80B8xxxx), but KytyPS5 (src/libs/dialog.cpp, SIGNIN_ERROR_*, and its SigninDialog test) uses SigninDialog's own codes: NOT_INITIALIZED 0x81350001, ALREADY_INITIALIZED 0x81350002, PARAM_INVALID 0x81350003, INVALID_STATE 0x81350005. So Export.cpp:28 and :34 should return 0x81350001, :35 0x81350003 and :36 0x81350005 (there's no NOT_FINISHED 0x80B80005 for this library). The existing Initialize/Terminate/Open returns have the same problem, and GuestSigninDialog.cpp:21-24 pins them. Could you switch the whole file to the SigninDialog codes in this PR? It's the same topic and your test already covers it.
  • Close: KytyPS5 and prosper (np.cpp, s_signin_dialog_close) both set the status to FINISHED in sceSigninDialogClose, and KytyPS5's test checks that Initialize → Close → UpdateStatus returns 3. Here Export.cpp:28 leaves the status unchanged. A test row for Close from INITIALIZED would cover it.
  • GetResult order: KytyPS5 checks the state before the null pointer (INVALID_STATE before PARAM_INVALID); Export.cpp:35-36 does it the other way round.
  • It also needs the TechnicalDebt rebase from the earlier comment (#559 is on main). Keep both lines.

Build, ctest and the negative check (the test fails without the change) all pass here. Writing only the leading int32 of the result is right.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5444768555 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/560#pullrequestreview-5444768555). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-07T15:47:06Z. **Review:** CHANGES_REQUESTED --- Thanks. Checked against the references before the rebase; one thing to fix (cc @oneandonlydean, since this was ready from your side): - **Error codes**: the new returns use the common-dialog family (`0x80B8xxxx`), but KytyPS5 (`src/libs/dialog.cpp`, `SIGNIN_ERROR_*`, and its SigninDialog test) uses SigninDialog's own codes: `NOT_INITIALIZED` `0x81350001`, `ALREADY_INITIALIZED` `0x81350002`, `PARAM_INVALID` `0x81350003`, `INVALID_STATE` `0x81350005`. So `Export.cpp:28` and `:34` should return `0x81350001`, `:35` `0x81350003` and `:36` `0x81350005` (there's no `NOT_FINISHED` `0x80B80005` for this library). The existing `Initialize`/`Terminate`/`Open` returns have the same problem, and `GuestSigninDialog.cpp:21-24` pins them. Could you switch the whole file to the SigninDialog codes in this PR? It's the same topic and your test already covers it. - **Close**: KytyPS5 and prosper (`np.cpp`, `s_signin_dialog_close`) both set the status to `FINISHED` in `sceSigninDialogClose`, and KytyPS5's test checks that `Initialize` → `Close` → `UpdateStatus` returns 3. Here `Export.cpp:28` leaves the status unchanged. A test row for Close from `INITIALIZED` would cover it. - **GetResult order**: KytyPS5 checks the state before the null pointer (`INVALID_STATE` before `PARAM_INVALID`); `Export.cpp:35-36` does it the other way round. - It also needs the TechnicalDebt rebase from the earlier comment (#559 is on main). Keep both lines. Build, ctest and the negative check (the test fails without the change) all pass here. Writing only the leading `int32` of the result is right.
oneandonlydean commented 2026-10-10 18:08:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T18:08:13Z.


Closing for now: the points from 2026-10-07 are still open. If you pick it back up, please comment here and it can be reopened.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6100603192 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/560#issuecomment-6100603192). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T18:08:13Z. --- Closing for now: the points from 2026-10-07 are still open. If you pick it back up, please comment here and it can be reopened.

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