Files
AnyPS5/core/libs/prx/libSceCommonDialog/Export.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 <noreply@anthropic.com>
2026-10-22 09:24:22 +01:00

25 lines
541 B
C++

#include <atomic>
#include <cstdint>
#include <cstddef>
#include "SceTypes.hpp"
#include "prx/libSceCommonDialog/CommonDialog.hpp"
#include "prx/libc/include/General.hpp"
static std::atomic<bool> g_initialized{false};
extern "C" {
int APS5_VABI sceCommonDialogInitialize(void) {
bool expected = false;
if (!g_initialized.compare_exchange_strong(expected, true)) {
return COMMON_DIALOG_ERROR_ALREADY_SYSTEM_INITIALIZED;
}
return COMMON_DIALOG_OK;
}
bool APS5_VABI sceCommonDialogIsUsed(void) {
return false;
}
}