test(libSceSocialScreenDialog): cover null result precedence in sceSocialScreenDialogGetResult matching firmware 13.42

In sceSocialScreenDialogGetResult, verify that a null result pointer returns COMMON_DIALOG_ERROR_ARG_NULL before checking NOT_FINISHED when initialized, matching PS5 firmware 13.42 module disassembly (offset 0x360) and native execution data.

Assert this error precedence and sentinel preservation in GuestSocialScreenDialog.cpp, and cite the native firmware evidence in docs/dev/debt/libSceSocialScreenDialog.md.
This commit is contained in:
Omar Elmahy committed 2026-10-29 16:33:45 +00:00
1 parent bb04a4f1ea
commit 487d0ff1fa
2 files changed
+12 -4

No files matched your search

+11 -3
View File
@@ -2,6 +2,7 @@
#include "prx/libc/include/general/VabiMacros.hpp"
#include <cstdint>
#include <cstdlib>
#include <cstring>
namespace {
@@ -15,12 +16,14 @@ constexpr int kErrAlreadyInitialized = static_cast<int>(0x80B80004);
constexpr int kErrNotFinished = static_cast<int>(0x80B80005);
constexpr int kErrArgNull = static_cast<int>(0x80B8000D);
constexpr int kResultUserCanceled = 1;
constexpr std::int32_t kSentinel = static_cast<std::int32_t>(0x5a5a5a5a);
}
int main() {
std::int64_t param = 0;
std::int32_t result[2] = {-1, -1};
std::int32_t result[2];
std::memset(result, 0x5a, sizeof(result));
Require(sceSocialScreenDialogTerminate() == kErrNotInitialized);
Require(sceSocialScreenDialogOpen(nullptr) == kErrNotInitialized);
@@ -37,7 +40,11 @@ int main() {
Require(sceSocialScreenDialogUpdateStatus() == kStatusInitialized);
Require(sceSocialScreenDialogOpen(nullptr) == kErrArgNull);
std::memset(result, 0x5a, sizeof(result));
Require(sceSocialScreenDialogGetResult(nullptr) == kErrArgNull);
Require(sceSocialScreenDialogGetResult(result) == kErrNotFinished);
Require(result[0] == kSentinel);
Require(result[1] == kSentinel);
Require(sceSocialScreenDialogOpen(&param) == 0);
Require(sceSocialScreenDialogGetStatus() == kStatusFinished);
@@ -46,7 +53,7 @@ int main() {
Require(sceSocialScreenDialogGetResult(nullptr) == kErrArgNull);
Require(sceSocialScreenDialogGetResult(result) == 0);
Require(result[0] == kResultUserCanceled);
Require(result[1] == -1);
Require(result[1] == kSentinel);
Require(sceSocialScreenDialogClose() == 0);
Require(sceSocialScreenDialogTerminate() == 0);
@@ -60,9 +67,10 @@ int main() {
Require(sceSocialScreenDialogUpdateStatus() == kStatusInitialized);
Require(sceSocialScreenDialogClose() == 0);
Require(sceSocialScreenDialogUpdateStatus() == kStatusFinished);
result[0] = -1;
std::memset(result, 0x5a, sizeof(result));
Require(sceSocialScreenDialogGetResult(result) == 0);
Require(result[0] == kResultUserCanceled);
Require(result[1] == kSentinel);
Require(sceSocialScreenDialogTerminate() == 0);
Require(sceSocialScreenDialogTerminate() == kErrNotInitialized);
Require(sceSocialScreenDialogOpen(nullptr) == kErrNotInitialized);
+1 -1
View File
@@ -2,4 +2,4 @@
### Silent stubs
- [libSceSocialScreenDialog](../../../core/libs/prx/libSceSocialScreenDialog/Export.cpp) - the social screen dialog runs the common-dialog state machine but shows nothing and reports the user as having cancelled, as there is no second-screen viewer. The signatures are from [Orbital's type database](https://github.com/AlexAltea/orbital/blob/b321fcdbd700cc02da1cb1ad25412781d5ec73c6/tools/ida/db_types.json); the result layout beyond the leading `int32_t` result code is not known, so nothing else is written.
- [libSceSocialScreenDialog](../../../core/libs/prx/libSceSocialScreenDialog/Export.cpp) - the social screen dialog runs the common-dialog state machine but shows nothing and reports the user as having cancelled, as there is no second-screen viewer. In `sceSocialScreenDialogGetResult`, PS5 firmware 13.42 module disassembly (offset 0x360) and native execution data confirm that a null result pointer is checked before NOT_FINISHED (returning COMMON_DIALOG_ERROR_ARG_NULL). The signatures are from [Orbital's type database](https://github.com/AlexAltea/orbital/blob/b321fcdbd700cc02da1cb1ad25412781d5ec73c6/tools/ida/db_types.json); the result layout beyond the leading `int32_t` result code is not known, so nothing else is written.