Files
Yossi Yadgar 12e33a68ab feat(libSceNpParty): report the user as not in a party from sceNpPartyGetState
There is no party service, so the 16-bit state is NOT_IN_PARTY; a null state returns INVALID_ARGUMENT.
2026-10-20 10:18:20 +03:00

27 lines
841 B
C++

#include "prx/libc/include/general/VabiMacros.hpp"
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
extern "C" int APS5_VABI sceNpPartyGetState(std::uint16_t* state);
int main() {
std::uint16_t states[3];
std::memset(states, 0xa5, sizeof(states));
if (sceNpPartyGetState(nullptr) != static_cast<int>(0x80552504u)) {
std::fprintf(stderr, "a null state was not refused with INVALID_ARGUMENT\n");
return 1;
}
if (sceNpPartyGetState(&states[1]) != 0 || states[1] != 2) {
std::fprintf(stderr, "the state is not NOT_IN_PARTY\n");
return 1;
}
if (states[0] != 0xa5a5 || states[2] != 0xa5a5) {
std::fprintf(stderr, "sceNpPartyGetState wrote past its 16-bit state\n");
return 1;
}
std::puts("NpParty state tests passed");
return 0;
}