Files
AnyPS5/core/libs/tests/GuestCommonDialog.cpp
T
Lindamea1andClaude Opus 5.5 93170e6049 fix(libSceCommonDialog): return ALREADY_SYSTEM_INITIALIZED from a second sceCommonDialogInitialize
A second sceCommonDialogInitialize returned 0x80B80004
(ALREADY_INITIALIZED), the code each dialog's own Initialize returns.
The common-dialog system initializer returns 0x80B80002
(ALREADY_SYSTEM_INITIALIZED), as shadPS4 and the SDK error names have
it, so callers that accept only SCE_OK or ALREADY_SYSTEM_INITIALIZED
treated a second call as a failure. The header keeps
ALREADY_INITIALIZED for the dialog libraries that return it. The test
pins the literal instead of the header constant, and the debt entry
records that a repeated call's value is not measured on a console.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 09:24:22 +01:00

28 lines
723 B
C++

#include "prx/libc/include/general/VabiMacros.hpp"
#include "prx/libSceCommonDialog/CommonDialog.hpp"
#include <cstdlib>
extern "C" {
int APS5_VABI sceCommonDialogInitialize(void);
bool APS5_VABI sceCommonDialogIsUsed(void);
}
namespace {
void Require(bool value) {
if (!value) std::abort();
}
constexpr int kErrAlreadySystemInitialized = static_cast<int>(0x80B80002);
}
int main() {
Require(!sceCommonDialogIsUsed());
Require(sceCommonDialogInitialize() == COMMON_DIALOG_OK);
Require(!sceCommonDialogIsUsed());
Require(sceCommonDialogInitialize() == kErrAlreadySystemInitialized);
Require(sceCommonDialogInitialize() == kErrAlreadySystemInitialized);
Require(!sceCommonDialogIsUsed());
}