Merge pull request #10526 from YossiYad/feat/share-play-connection-info

feat(libSceSharePlay): implement sceSharePlayGetCurrentConnectionInfo
This commit is contained in:
Dean authored and GitHub committed 2026-10-26 11:03:32 +13:00
commit f2a89261e3
5 files changed
+29 -5

No files matched your search

+9
View File
@@ -1502,6 +1502,15 @@ struct SharePlayConnectionInfoA {
std::int32_t visitorUserId;
};
static_assert(sizeof(SharePlayConnectionInfoA) == 72 && offsetof(SharePlayConnectionInfoA, hostAccountId) == 48 && offsetof(SharePlayConnectionInfoA, hostUserId) == 64);
struct SharePlayConnectionInfo {
std::int32_t status;
std::int32_t mode;
NpOnlineId hostOnlineId;
NpOnlineId visitorOnlineId;
std::int32_t hostUserId;
std::int32_t visitorUserId;
};
static_assert(sizeof(SharePlayConnectionInfo) == 56 && offsetof(SharePlayConnectionInfo, hostUserId) == 48);
struct NpId { NpOnlineId online_id; std::uint8_t opaque[4]; };
struct NpCreateAsyncRequestParameter { std::uint8_t opaque[64]; };
struct NpCheckPremiumParameter { std::uint8_t opaque[64]; };
+7 -2
View File
@@ -51,8 +51,13 @@ int APS5_VABI sceSharePlayCrashDaemon(void) {
return 0;
}
int APS5_VABI sceSharePlayGetCurrentConnectionInfo(void) {
NotImplemented_nid_no_patch(__func__);
int APS5_VABI sceSharePlayGetCurrentConnectionInfo(SharePlayConnectionInfo* info) {
std::lock_guard lock(g_mutex);
if (!g_initialized) return SCE_SHARE_PLAY_ERROR_NOT_INITIALIZED;
if (info == nullptr) return SCE_SHARE_PLAY_ERROR_INVALID_ARGS;
*info = {};
info->hostUserId = SCE_USER_SERVICE_USER_ID_INVALID;
info->visitorUserId = SCE_USER_SERVICE_USER_ID_INVALID;
return 0;
}
@@ -9,7 +9,7 @@ int APS5_VABI sceSharePlayTerminate(void);
int APS5_VABI sceSharePlayGetCurrentConnectionInfoA(SharePlayConnectionInfoA* info);
int APS5_VABI sceSharePlayProhibitController(std::uint8_t prohibited);
int APS5_VABI sceSharePlayCrashDaemon(void);
int APS5_VABI sceSharePlayGetCurrentConnectionInfo(void);
int APS5_VABI sceSharePlayGetCurrentConnectionInfo(SharePlayConnectionInfo* info);
int APS5_VABI sceSharePlayGetCurrentInfo(void);
int APS5_VABI sceSharePlayGetEvent(void);
int APS5_VABI sceSharePlayNotifyDialogOpen(void);
+10 -1
View File
@@ -1,4 +1,4 @@
#include "prx/libSceSharePlay/include/Api.hpp"
#include "prx/libSceSharePlay/libSceSharePlay.hpp"
#include "SceTypes.hpp"
#include "prx/libc/include/general/VabiMacros.hpp"
#include <cstddef>
@@ -26,6 +26,7 @@ int main() {
constexpr int invalidArgument = static_cast<int>(0x810E0001);
Require(sceSharePlayTerminate() == notInitialized);
Require(sceSharePlayGetCurrentConnectionInfoA(nullptr) == notInitialized);
Require(sceSharePlayGetCurrentConnectionInfo(nullptr) == notInitialized);
Require(sceSharePlayProhibitController(2) == notInitialized);
Require(sceSharePlayInitialize(nullptr, sizeof(heap)) == 0);
Require(sceSharePlayInitialize(heap, 0) == alreadyInitialized);
@@ -41,6 +42,14 @@ int main() {
Require(info.hostOnlineId.data[0] == 0 && info.visitorOnlineId.data[0] == 0 && info.hostOnlineId.pad[2] == 0);
Require(info.hostUserId == -1 && info.visitorUserId == -1);
Require(sceSharePlayGetCurrentConnectionInfoA(nullptr) == static_cast<int>(0x810E0001));
unsigned char plain[sizeof(SharePlayConnectionInfo) + 8];
std::memset(plain, 0x5a, sizeof(plain));
auto* plainInfo = reinterpret_cast<SharePlayConnectionInfo*>(plain);
Require(sceSharePlayGetCurrentConnectionInfo(plainInfo) == 0);
Require(plainInfo->status == 0 && plainInfo->mode == 0 && plainInfo->hostOnlineId.data[0] == 0 && plainInfo->visitorOnlineId.pad[2] == 0);
Require(plainInfo->hostUserId == -1 && plainInfo->visitorUserId == -1);
for (std::size_t i = sizeof(SharePlayConnectionInfo); i < sizeof(plain); ++i) Require(plain[i] == 0x5a);
Require(sceSharePlayGetCurrentConnectionInfo(nullptr) == invalidArgument);
Require(sceSharePlayProhibitController(1) == 0);
Require(sceSharePlayProhibitController(1) == 0);
Require(sceSharePlayProhibitController(0) == 0);
+2 -1
View File
@@ -2,11 +2,12 @@
### Unknown function info
- [sceSharePlayCrashDaemon, sceSharePlayGetCurrentConnectionInfo, sceSharePlayGetCurrentInfo, sceSharePlayGetEvent, sceSharePlayNotifyDialogOpen, sceSharePlayNotifyForceCloseForCdlg, sceSharePlayResumeScreenForCdlg, sceSharePlayServerLock](../../../core/libs/prx/libSceSharePlay/Export.cpp) (libSceSharePlay) - the list is the intersection of the export table of the console's [libSceSharePlay](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceSharePlay.c) (function symbols only), the pinned [aerolib names](https://github.com/zecoxao/sce_symbols/blob/2883963a0a514ba6e77407a08ef4730a65e88254/aerolib.csv) and the functions not yet defined anywhere in the repo. No credible prototypes were found; they are declared without parameters solely to resolve known imports, not as an ABI claim, and callers must not call them until signatures are verified.
- [sceSharePlayCrashDaemon, sceSharePlayGetCurrentInfo, sceSharePlayGetEvent, sceSharePlayNotifyDialogOpen, sceSharePlayNotifyForceCloseForCdlg, sceSharePlayResumeScreenForCdlg, sceSharePlayServerLock](../../../core/libs/prx/libSceSharePlay/Export.cpp) (libSceSharePlay) - the list is the intersection of the export table of the console's [libSceSharePlay](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceSharePlay.c) (function symbols only), the pinned [aerolib names](https://github.com/zecoxao/sce_symbols/blob/2883963a0a514ba6e77407a08ef4730a65e88254/aerolib.csv) and the functions not yet defined anywhere in the repo. No credible prototypes were found; they are declared without parameters solely to resolve known imports, not as an ABI claim, and callers must not call them until signatures are verified.
- [sceSharePlayServerUnLock, sceSharePlaySetMode, sceSharePlaySetProhibition, sceSharePlaySetProhibitionModeWithAppId, sceSharePlayStartStandby, sceSharePlayStartStreaming, sceSharePlayStopStandby, sceSharePlayStopStreaming](../../../core/libs/prx/libSceSharePlay/Export.cpp) (libSceSharePlay) - the list is the intersection of the export table of the console's [libSceSharePlay](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceSharePlay.c) (function symbols only), the pinned [aerolib names](https://github.com/zecoxao/sce_symbols/blob/2883963a0a514ba6e77407a08ef4730a65e88254/aerolib.csv) and the functions not yet defined anywhere in the repo. No credible prototypes were found; they are declared without parameters solely to resolve known imports, not as an ABI claim, and callers must not call them until signatures are verified.
### Functional
- [sceSharePlayInitialize and sceSharePlayTerminate](../../../core/libs/prx/libSceSharePlay/Export.cpp) - native heap validation and initialization state are recovered: a null heap ignores the supplied size, a supplied heap requires at least 0x1800 bytes, repeated initialization returns 0x810E0003 and termination before initialization returns 0x810E0004. The host does not allocate the native internal heap, connect to the Share Play service or reproduce its failures.
- [sceSharePlayGetCurrentConnectionInfoA](../../../core/libs/prx/libSceSharePlay/Export.cpp) - the native module confirms a 72-byte result, initial zero fields and both user IDs -1. Initialization is checked before the output pointer. The host retains this initial disconnected state; native event draining, cached updates and service reconnection are unimplemented.
- [sceSharePlayGetCurrentConnectionInfo](../../../core/libs/prx/libSceSharePlay/Export.cpp) - the 56-byte layout without account IDs is from [shadPS4's shareplay.h](https://github.com/shadps4-emu/shadPS4/blob/396c2a09a38d22eaa02aab32c1967263dceab95f/src/core/libraries/share_play/shareplay.h); the checks and values copy `sceSharePlayGetCurrentConnectionInfoA`, while shadPS4 leaves both user IDs 0 and checks nothing. Not measured on a console.
- [sceSharePlayProhibitController](../../../core/libs/prx/libSceSharePlay/Export.cpp) - the argument is one byte, forwarded unchanged to the service. The host checks initialization, accepts 0/1 without a visitor controller, and returns 0x810E0001 (SCE_SHARE_PLAY_ERROR_INVALID_ARGS) for other values; dynamic service communication and controller state remain unimplemented.