mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
fix(logindialog): report user-cancelled and write only the leading result int32
sceLoginDialogGetResult zeroed 8 bytes of a result struct of unknown size and reported result 0 with user id 0. It now writes only the leading int32 (USER_CANCELED), like sceWebBrowserDialogGetResult and like the sign-in dialog, so a title takes its "no user chosen" path instead of reading an invalid user id. Records the dialog in the silent-stubs list in docs/dev/TechnicalDebt.md.
This commit is contained in:
@@ -16,8 +16,7 @@ constexpr int COMMON_DIALOG_ERROR_ALREADY_INITIALIZED = static_cast<int>(0x80B80
|
||||
constexpr int COMMON_DIALOG_ERROR_NOT_FINISHED = static_cast<int>(0x80B80005u);
|
||||
constexpr int COMMON_DIALOG_ERROR_BUSY = static_cast<int>(0x80B80007u);
|
||||
constexpr int COMMON_DIALOG_ERROR_ARG_NULL = static_cast<int>(0x80B8000Du);
|
||||
|
||||
constexpr std::size_t LOGIN_DIALOG_RESULT_SIZE = 8;
|
||||
constexpr int COMMON_DIALOG_RESULT_USER_CANCELED = 1;
|
||||
|
||||
std::atomic<int> g_status{COMMON_DIALOG_STATUS_NONE};
|
||||
|
||||
@@ -53,7 +52,8 @@ int APS5_VABI sceLoginDialogGetResult(void* result) {
|
||||
if (status == COMMON_DIALOG_STATUS_NONE) return COMMON_DIALOG_ERROR_NOT_INITIALIZED;
|
||||
if (result == nullptr) return COMMON_DIALOG_ERROR_ARG_NULL;
|
||||
if (status != COMMON_DIALOG_STATUS_FINISHED) return COMMON_DIALOG_ERROR_NOT_FINISHED;
|
||||
std::memset(result, 0, LOGIN_DIALOG_RESULT_SIZE);
|
||||
const std::int32_t canceled = COMMON_DIALOG_RESULT_USER_CANCELED;
|
||||
std::memcpy(result, &canceled, sizeof(canceled));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,30 +21,32 @@ constexpr int kErrNotInitialized = static_cast<int>(0x80B80003);
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
int main() {
|
||||
std::int64_t param = 0;
|
||||
std::int64_t result = -1;
|
||||
std::int32_t result[2] = {-1, -1};
|
||||
|
||||
Require(sceLoginDialogTerminate() == kErrNotInitialized);
|
||||
Require(sceLoginDialogOpen(¶m) == kErrNotInitialized);
|
||||
Require(sceLoginDialogGetResult(&result) == kErrNotInitialized);
|
||||
Require(sceLoginDialogGetResult(result) == kErrNotInitialized);
|
||||
|
||||
Require(sceLoginDialogInitialize() == 0);
|
||||
Require(sceLoginDialogInitialize() == kErrAlreadyInitialized);
|
||||
|
||||
Require(sceLoginDialogOpen(nullptr) == kErrArgNull);
|
||||
Require(sceLoginDialogGetResult(&result) == kErrNotFinished);
|
||||
Require(sceLoginDialogGetResult(result) == kErrNotFinished);
|
||||
|
||||
Require(sceLoginDialogOpen(¶m) == 0);
|
||||
Require(sceLoginDialogGetStatus() == kStatusFinished);
|
||||
Require(sceLoginDialogUpdateStatus() == kStatusFinished);
|
||||
|
||||
Require(sceLoginDialogGetResult(nullptr) == kErrArgNull);
|
||||
Require(sceLoginDialogGetResult(&result) == 0);
|
||||
Require(result == 0);
|
||||
Require(sceLoginDialogGetResult(result) == 0);
|
||||
Require(result[0] == kResultUserCanceled);
|
||||
Require(result[1] == -1);
|
||||
|
||||
Require(sceLoginDialogClose() == 0);
|
||||
Require(sceLoginDialogTerminate() == 0);
|
||||
|
||||
@@ -15,6 +15,7 @@ Throughout the project, every function at every stage either **does exactly what
|
||||
- [libSceMsgDialog.native](../../core/libs/prx/libSceMsgDialog.native/Export.cpp) - dialogs finish at `sceMsgDialogOpen` without UI and answer with button 1, so `sceMsgDialogClose` returns `NOT_RUNNING`; its result before `sceMsgDialogInitialize` follows libSceMsgDialog
|
||||
- [libSceCommonDialog](../../core/libs/prx/libSceCommonDialog/Export.cpp)
|
||||
- [libSceErrorDialog](../../core/libs/prx/libSceErrorDialog/Export.cpp) - the error dialog runs the state machine but shows nothing; the error code passed to `sceErrorDialogOpen` is only logged
|
||||
- [libSceLoginDialog](../../core/libs/prx/libSceLoginDialog/Export.cpp) - the login dialog runs the common-dialog state machine but shows nothing and reports the user as having cancelled
|
||||
- [libSceHmd](../../core/libs/prx/libSceHmd/Export.cpp) implements only the disconnected-headset path: initialization succeeds, device queries report `NotDetected`, and opening a device returns `DeviceDisconnected`. Headset support, tracking, rendering and additional HMD exports are not implemented; SDK-level ABI compatibility and in-game behaviour remain unverified.
|
||||
- [libSceAudioPropagation](../../core/libs/prx/libSceAudioPropagation/Export.cpp) implements only the no-acoustic-propagation path: the system keeps a 16-byte header in the title's CPU memory (no GPU memory), rooms, portals, sources and materials are tracked handles, attributes are validated and have no effect, no rays are requested and sources report no audio paths. Ray results, path calculation and audio paths are accepted only when empty and throw otherwise; `sceAudioPropagationSourceRender` writes silence (zeroes) to each source's output buffer for the given size, without a dry signal. Objects still alive when their system is destroyed become unusable, and their later destroy or unregister is a no-op: PPSA21567 releases its reference-counted room, portal and source owners just before `sceAudioPropagationSystemDestroy`, so the order for every object is not proven. Occlusion, reflections and reverb from level geometry are absent; in-game behaviour remains unverified.
|
||||
- [libSceNpCommerce](../../core/libs/prx/libSceNpCommerce/Export.cpp) - the PS Store icon show/hide calls and `sceNpCommerceSetPsStoreIconLayout` do nothing
|
||||
|
||||
Reference in New Issue
Block a user