mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 08:33:12 -05:00
PRAGMATA (PPSA02530) imports sceSharePlayProhibitController (NID FzQS6DREDfk), which no library exports on main, so the load fails on the unresolved import. It is one of the "six declared-only imports" of xXPBSXx's branch in #3043 (comment 6107100345): "These only stop the load failure; as described above, the title calls some of them later and needs their real behavior." sharpemu src/SharpEmu.Libs/Share/SharePlayExports.cs:9-31 (a2983692930564815a77f81e74c151268f5b935f, used as a source of facts) takes one value, accepts 0 and 1 and returns 0. Nothing here would read the setting, as no Share Play session or visitor controller exists, so it is not stored. sharpemu rejects other values with its synthetic 0x80020003, not a Share Play code, so they throw, as sceSharePlayInitialize does for its unknown error. Like the other exports of the library it does not check initialization. The NID hashes from the name and is in aerolib. Unverified points are in TechnicalDebt. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
48 lines
1.8 KiB
C++
48 lines
1.8 KiB
C++
#include "SceTypes.hpp"
|
|
#include "prx/libc/include/general/VabiMacros.hpp"
|
|
#include <cstddef>
|
|
#include <cstdlib>
|
|
#include <cstring>
|
|
#include <exception>
|
|
|
|
extern "C" {
|
|
int APS5_VABI sceSharePlayInitialize(void*, std::size_t);
|
|
int APS5_VABI sceSharePlayTerminate(void);
|
|
int APS5_VABI sceSharePlayGetCurrentConnectionInfoA(SharePlayConnectionInfoA*);
|
|
int APS5_VABI sceSharePlayProhibitController(int);
|
|
}
|
|
|
|
static void Require(bool value) { if (!value) std::abort(); }
|
|
|
|
template <typename TCall>
|
|
static bool Throws(TCall call) {
|
|
try {
|
|
call();
|
|
} catch (const std::exception&) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
int main() {
|
|
alignas(16) static unsigned char heap[0x1800];
|
|
Require(sceSharePlayInitialize(nullptr, sizeof(heap)) == 0);
|
|
Require(sceSharePlayTerminate() == 0);
|
|
Require(sceSharePlayInitialize(heap, sizeof(heap)) == 0);
|
|
Require(sceSharePlayTerminate() == 0);
|
|
Require(Throws([&] { sceSharePlayInitialize(heap, 0); }));
|
|
Require(Throws([&] { sceSharePlayInitialize(nullptr, 0); }));
|
|
SharePlayConnectionInfoA info;
|
|
std::memset(&info, 0x5a, sizeof(info));
|
|
Require(sceSharePlayGetCurrentConnectionInfoA(&info) == 0);
|
|
Require(info.status == 0 && info.mode == 0 && info.hostAccountId == 0 && info.visitorAccountId == 0);
|
|
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));
|
|
Require(sceSharePlayProhibitController(1) == 0);
|
|
Require(sceSharePlayProhibitController(1) == 0);
|
|
Require(sceSharePlayProhibitController(0) == 0);
|
|
Require(Throws([] { sceSharePlayProhibitController(2); }));
|
|
Require(Throws([] { sceSharePlayProhibitController(-1); }));
|
|
}
|