libSceSharePlay: sceSharePlayGetCurrentConnectionInfoA (RE4) with the layout and error code from KytyPS5 and fpPS4; branch ready #3210

Closed
opened 2026-10-11 01:27:05 +00:00 by Silverash-i8 · 4 comments
Silverash-i8 commented 2026-10-11 01:27:05 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-11T01:27:05Z.


Follow-up to #3144, which closed with the SystemGesture half (#3174). The SharePlay half was left out because its result was a guess with no reference. There are two references now, and they agree, so here is that half again with the layout and error code filled in.

Title: RE4 (PPSA07411) stops on sceSharePlayGetCurrentConnectionInfoA, which main doesn't export (xXPBSXx's report in #3144).

References

  • KytyPS5 libNet.cpp: SharePlayConnectionInfoA is status, mode, two 20-byte online IDs, two 64-bit account IDs and two user IDs, with static_asserts for size 72, host_account_id at 48 and host_user_id at 64. A null pointer returns SHARE_PLAY_ERROR_INVALID_ARGS (-2129788927, 0x810E0001); otherwise it writes status 0 and both user IDs -1.
  • fpPS4 ps4_libsceshareplay.pas: the same fields in the same order, SCE_SHARE_PLAY_ERROR_INVALID_ARGS = 0x810E0001, DORMANT = 0, INVALID_ARGS for null and a zeroed struct otherwise.

Branch: Silverash-i8/AnyPS5-fork:fix/shareplay-connection-info-layout, on main 06da1176: xXPBSXx's 691b0d50 (their authorship kept) plus 027ebf97.

  • SharePlayConnectionInfoA in SceTypes.hpp next to NpOnlineId, with the size and offset asserts.
  • The call reports no session: status DORMANT, mode 0, empty online IDs, account IDs 0, user IDs -1 (SCE_USER_SERVICE_USER_ID_INVALID, as KytyPS5 does). Null returns 0x810E0001.
  • TechnicalDebt cites both sources and lists what isn't settled: the user IDs (-1 in KytyPS5, 0 in fpPS4) and KytyPS5's NOT_INITIALIZED check before sceSharePlayInitialize, which this library keeps no state for.
  • guest_share_play fills the struct with 0x5a first, checks every field, and checks the null case.

Tested on Windows 11, WinLibs GCC 15.2.0 r7, Release: guest_share_play and patched_libraries pass, and tools/check_conventions.py --base upstream/main passes. I don't have RE4. xXPBSXx's run in #3144 showed the title stops on the missing export and runs past the call once it exists; xXPBSXx then ran RE4 with this branch (comment): it no longer stops on sceSharePlayGetCurrentConnectionInfoA and continues to the next, unrelated stop (scan conversion mode is unsupported (register 0x292 = 0x00000003), #2776), with no SharePlay output in the log. What the title does with the struct beyond that wasn't examined.

AI-assisted (Claude Code); I read both sources and ran the tests on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5796947735 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3210). Originally posted by [Silverash-i8](https://github.com/Silverash-i8) on 2026-10-11T01:27:05Z. --- Follow-up to #3144, which closed with the SystemGesture half (#3174). The SharePlay half was left out because its result was a guess with no reference. There are two references now, and they agree, so here is that half again with the layout and error code filled in. **Title:** RE4 (PPSA07411) stops on `sceSharePlayGetCurrentConnectionInfoA`, which `main` doesn't export (xXPBSXx's report in #3144). **References** - [KytyPS5 `libNet.cpp`](https://github.com/KytyPS5/KytyPS5/blob/main/src/libs/libNet.cpp): `SharePlayConnectionInfoA` is `status`, `mode`, two 20-byte online IDs, two 64-bit account IDs and two user IDs, with `static_assert`s for size 72, `host_account_id` at 48 and `host_user_id` at 64. A null pointer returns `SHARE_PLAY_ERROR_INVALID_ARGS` (-2129788927, 0x810E0001); otherwise it writes status 0 and both user IDs -1. - [fpPS4 `ps4_libsceshareplay.pas`](https://github.com/red-prig/fpPS4/blob/trunk/src/ps4_libsceshareplay.pas): the same fields in the same order, `SCE_SHARE_PLAY_ERROR_INVALID_ARGS = 0x810E0001`, DORMANT = 0, INVALID_ARGS for null and a zeroed struct otherwise. **Branch:** [`Silverash-i8/AnyPS5-fork:fix/shareplay-connection-info-layout`](https://github.com/Silverash-i8/AnyPS5-fork/tree/fix/shareplay-connection-info-layout), on `main` 06da1176: xXPBSXx's `691b0d50` (their authorship kept) plus `027ebf97`. - `SharePlayConnectionInfoA` in `SceTypes.hpp` next to `NpOnlineId`, with the size and offset asserts. - The call reports no session: status DORMANT, mode 0, empty online IDs, account IDs 0, user IDs -1 (`SCE_USER_SERVICE_USER_ID_INVALID`, as KytyPS5 does). Null returns 0x810E0001. - TechnicalDebt cites both sources and lists what isn't settled: the user IDs (-1 in KytyPS5, 0 in fpPS4) and KytyPS5's NOT_INITIALIZED check before `sceSharePlayInitialize`, which this library keeps no state for. - `guest_share_play` fills the struct with 0x5a first, checks every field, and checks the null case. **Tested** on Windows 11, WinLibs GCC 15.2.0 r7, Release: `guest_share_play` and `patched_libraries` pass, and `tools/check_conventions.py --base upstream/main` passes. I don't have RE4. xXPBSXx's run in #3144 showed the title stops on the missing export and runs past the call once it exists; xXPBSXx then ran RE4 with this branch ([comment](https://github.com/boykopovar/AnyPS5/issues/3210#issuecomment-6106484575)): it no longer stops on `sceSharePlayGetCurrentConnectionInfoA` and continues to the next, unrelated stop (`scan conversion mode is unsupported (register 0x292 = 0x00000003)`, #2776), with no SharePlay output in the log. What the title does with the struct beyond that wasn't examined. AI-assisted (Claude Code); I read both sources and ran the tests on my machine.
xXPBSXx commented 2026-10-11 06:53:02 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T06:53:02Z.


@Silverash-i8 thank you, this is better than my version: mine only returned 0 and wrote nothing, with no reference behind it (I said that in the TechnicalDebt entry), and yours has the layout, the error code and two sources that agree. Please treat your branch as the one to carry and mine (fix/shareplay-connection-info) as superseded.

One correction to the wording above: "the in-title check is xXPBSXx's from #3144" is more than I measured. On RE4 I only saw that the title stopped on the missing export and that it ran past the call once the export existed. I did not check what it does with the struct afterwards (it reads a field at offset 0x40 of its own stack structure, which I could not tie to this call). I can rerun RE4 with your branch and report whether it still gets past that point; I will do that in the next session with the title and post the result here.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106417725 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3210#issuecomment-6106417725). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T06:53:02Z. --- @Silverash-i8 thank you, this is better than my version: mine only returned 0 and wrote nothing, with no reference behind it (I said that in the TechnicalDebt entry), and yours has the layout, the error code and two sources that agree. Please treat your branch as the one to carry and mine (`fix/shareplay-connection-info`) as superseded. One correction to the wording above: "the in-title check is xXPBSXx's from #3144" is more than I measured. On RE4 I only saw that the title stopped on the missing export and that it ran past the call once the export existed. I did not check what it does with the struct afterwards (it reads a field at offset 0x40 of its own stack structure, which I could not tie to this call). I can rerun RE4 with your branch and report whether it still gets past that point; I will do that in the next session with the title and post the result here. AI-assisted (Claude Code).
Silverash-i8 commented 2026-10-11 06:53:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-11T06:53:41Z.


@xXPBSXx thanks, and you're right, I overstated it. I've changed the issue text to say only what you measured: RE4 stops on the missing export and runs past the call once it exists, and what it does with the struct isn't checked yet.

On the read at offset 0x40: in the layout KytyPS5 asserts (static_assert(offsetof(SharePlayConnectionInfoA, host_user_id) == 64)), 0x40 is hostUserId, which this branch sets to -1 and your version left as whatever the stack held. If that stack structure turns out to be the info buffer RE4 passes to the call, your rerun would show directly whether it's happy with -1 there. That's only a guess from the offset, though.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106422523 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3210#issuecomment-6106422523). Originally posted by [Silverash-i8](https://github.com/Silverash-i8) on 2026-10-11T06:53:41Z. --- @xXPBSXx thanks, and you're right, I overstated it. I've changed the issue text to say only what you measured: RE4 stops on the missing export and runs past the call once it exists, and what it does with the struct isn't checked yet. On the read at offset 0x40: in the layout KytyPS5 asserts (`static_assert(offsetof(SharePlayConnectionInfoA, host_user_id) == 64)`), 0x40 is `hostUserId`, which this branch sets to -1 and your version left as whatever the stack held. If that stack structure turns out to be the info buffer RE4 passes to the call, your rerun would show directly whether it's happy with -1 there. That's only a guess from the offset, though. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-11 07:02:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-11T07:02:19Z.


RE4 (PPSA07411) result with your fix/shareplay-connection-info-layout (027ebf97) merged into a local test branch with my other branches (current main 06da1176, the library-skip branch from #2591, my RE4 export stubs): the import audit shows 0 absent imports, and the title no longer stops on sceSharePlayGetCurrentConnectionInfoA. In a 100 s run it goes on to the video-out check I described on #2776 (scan conversion mode is unsupported (register 0x292 = 0x00000003)), so it gets past the SharePlay call, and I saw no SharePlay-related output in the log. I did not examine what the title does with the returned struct beyond that.

One thing to know when this is carried together with my RE4 export branch: guest_ppsa07411_exports there still lists sceSharePlayGetCurrentConnectionInfoA as an export that throws, so that list needs the entry removed once your implementation is in (it failed for me on the combined branch for that reason). That test is not on main.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106484575 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3210#issuecomment-6106484575). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-11T07:02:19Z. --- RE4 (PPSA07411) result with your `fix/shareplay-connection-info-layout` (`027ebf97`) merged into a local test branch with my other branches (current `main` 06da1176, the library-skip branch from #2591, my RE4 export stubs): the import audit shows 0 absent imports, and the title no longer stops on `sceSharePlayGetCurrentConnectionInfoA`. In a 100 s run it goes on to the video-out check I described on #2776 (`scan conversion mode is unsupported (register 0x292 = 0x00000003)`), so it gets past the SharePlay call, and I saw no SharePlay-related output in the log. I did not examine what the title does with the returned struct beyond that. One thing to know when this is carried together with my RE4 export branch: `guest_ppsa07411_exports` there still lists `sceSharePlayGetCurrentConnectionInfoA` as an export that throws, so that list needs the entry removed once your implementation is in (it failed for me on the combined branch for that reason). That test is not on `main`. AI-assisted (Claude Code).
reyani-dev commented 2026-10-11 08:14:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T08:14:27Z.


Carried as #3341 with both commits unchanged (@xXPBSXx's export and @Silverash-i8's layout). On Windows 11 / GCC 15.2, guest_share_play passes 3/3 and doesn't link without the export; the CPU suite passes 428/428.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6107027479 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3210#issuecomment-6107027479). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-11T08:14:27Z. --- Carried as #3341 with both commits unchanged (@xXPBSXx's export and @Silverash-i8's layout). On Windows 11 / GCC 15.2, `guest_share_play` passes 3/3 and doesn't link without the export; the CPU suite passes 428/428.
Sign in to join this conversation.
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#3210
No description provided.