From 35e3b69a2bab370262ec8a6b8fd2ad6284cfe96d Mon Sep 17 00:00:00 2001 From: Gjon Gojcevic Date: Wed, 7 Oct 2026 20:21:26 -0400 Subject: [PATCH] feat(libSceShare): report no running share feature in sceShareGetRunningStatus The host never records or broadcasts, so the first status word is cleared and the call succeeds; a null status is rejected. --- core/libs/prx/libSceShare/Export.cpp | 7 +++++-- core/libs/tests/GuestShare.cpp | 5 +++++ docs/dev/TechnicalDebt.md | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/libs/prx/libSceShare/Export.cpp b/core/libs/prx/libSceShare/Export.cpp index afd98addc..4545d4f8e 100644 --- a/core/libs/prx/libSceShare/Export.cpp +++ b/core/libs/prx/libSceShare/Export.cpp @@ -110,8 +110,11 @@ int APS5_VABI sceShareCaptureVideoClipExtended(void) { return 0; } -int APS5_VABI sceShareGetRunningStatus(void) { - NotImplemented_nid_no_patch(__func__); +int APS5_VABI sceShareGetRunningStatus(uint32_t* status) { + if (status == nullptr) { + return ERROR_INVALID_PARAM; + } + *status = 0; return 0; } diff --git a/core/libs/tests/GuestShare.cpp b/core/libs/tests/GuestShare.cpp index f45247047..6e062efd8 100644 --- a/core/libs/tests/GuestShare.cpp +++ b/core/libs/tests/GuestShare.cpp @@ -10,6 +10,7 @@ int APS5_VABI sceShareCaptureScreenshot(const void* param, std::int32_t* req_id) int APS5_VABI sceShareCaptureVideoClip(const void* param, std::int32_t* req_id); int APS5_VABI sceShareGetCurrentStatus(std::uint32_t feature_flag, void* status); int APS5_VABI sceShareOpenMenuForContent(const void* content_id); +int APS5_VABI sceShareGetRunningStatus(std::uint32_t* status); } namespace { @@ -59,5 +60,9 @@ int main() { Require(sceShareGetCurrentStatus(0, status) == invalidParam); Require(status[0] == 0x5a); Require(sceShareGetCurrentStatus(1, nullptr) == invalidParam); + std::uint32_t running[2]{0xffffffffu, 0x5a5a5a5au}; + Require(sceShareGetRunningStatus(running) == 0); + Require(running[0] == 0 && running[1] == 0x5a5a5a5au); + Require(sceShareGetRunningStatus(nullptr) == invalidParam); return 0; } diff --git a/docs/dev/TechnicalDebt.md b/docs/dev/TechnicalDebt.md index 084451064..3f4813bc7 100644 --- a/docs/dev/TechnicalDebt.md +++ b/docs/dev/TechnicalDebt.md @@ -199,6 +199,7 @@ Throughout the project, every function at every stage either **does exactly what - [LinuxProtFromSce](../../core/libs/prx/libkernel/DirectMemory/DirectMemory.cpp) (libkernel) - protection bits 0x100 and 0x200 are accepted and assumed not to affect host CPU access; host protection is derived only from the read, write and execute bits - [_sceUlobjmgrRegisterObject](../../core/libs/prx/ulobjmgr/Export.cpp) (ulobjmgr) - parameters taken from shadPS4 (PS4): a nonzero 64-bit object, a nonzero 32-bit kind and a 32-bit id output; the meaning of the first two and the PS5 signature are unverified. The id bound of `_sceUlobjmgrUnregisterObject` (below 0x4000) and the raw `EINVAL` (22) return also come from shadPS4 - [sceShareGetCurrentStatus](../../core/libs/prx/libSceShare/Export.cpp) (libSceShare) - validation (feature flag non-zero, status non-null) and the all-zero 16-byte status taken from the [KytyPS5](https://github.com/KytyPS5/KytyPS5) reimplementation, not confirmed on a PS5 title; the meaning of the recording status values is unknown +- [sceShareGetRunningStatus](../../core/libs/prx/libSceShare/Export.cpp) (libSceShare) - only the first 32-bit word of the status is known: PPSA01317 treats bits 0x3c of it as a running share feature and gives the call a 40-byte buffer. The host never records or broadcasts, so it stores 0 in that word and leaves the rest untouched; a null status returns `INVALID_PARAM` by analogy with `sceShareGetCurrentStatus` - [sceAgcDcbSetZPassPredicationEnableGetSize, sceAgcDcbSetPredicationDisableGetSize, sceAgcDcbSetBoolPredicationEnableGetSize](../../core/libs/prx/libSceAgc/DcbState/src/Predication.cpp) (libSceAgc) - the builders are inline in the SDK and not exported; the size is assumed to be that of the SET_PREDICATION packet `sceAgcDcbSetPredication` writes (16 bytes) - [Resource registration](../../core/libs/prx/libSceAgcDriver/Resource/src/Registration.cpp) (libSceAgcDriver) - registration always fails with `RESOURCE_REGISTRATION_UNAVAILABLE`, so the owner and resource queries, `sceAgcDriverSetResourceUserData`, `sceAgcDriverFindResourcesPublic` and `sceAgcDriverUnregisterAllResourcesForOwner` return the same error without reading their arguments. Their parameter lists follow the libSceGnmDriver counterparts and are unverified. `sceAgcDriverGetResourceRegistrationMaxNameLength` writes 0xfc and returns 0, as [prosper](https://github.com/mattias800/prosper) does from a title's registration configuration; the `uint32_t*` parameter matches the SDK wrapper `sce::Agc::ResourceRegistration::getMaxNameLength(unsigned int*)`. sharpemu writes 256 and KytyPS5 returns `RESOURCE_REGISTRATION_UNAVAILABLE`, so the value is unverified; a null output throws - [Shader registration](../../core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp) (libSceAgcDriver) - a shader header is accepted at any address: PPSA26344 passes headers 4 and 1 bytes past an 8-byte boundary; whether the console refuses an alignment is unknown