mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-07 13:39:55 +00:00
fix(libSceNpSnsFacebookDialog): return ARG_NULL from sceNpSnsFacebookDialogGetResult for unwritable result
This commit is contained in:
1 parent
c4469b60da
commit
98abcac686
3 files changed
+13
-2
No files matched your search
@@ -1,5 +1,6 @@
|
||||
#include "prx/libSceNpSnsFacebookDialog/include/Api.hpp"
|
||||
#include <atomic>
|
||||
#include <cerrno>
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
@@ -57,7 +58,10 @@ int APS5_VABI sceNpSnsFacebookDialogGetResult(void* result) {
|
||||
if (result == nullptr) return COMMON_DIALOG_ERROR_ARG_NULL;
|
||||
if (status != COMMON_DIALOG_STATUS_FINISHED) return COMMON_DIALOG_ERROR_NOT_FINISHED;
|
||||
const std::int32_t canceled = COMMON_DIALOG_RESULT_USER_CANCELED;
|
||||
std::memcpy(result, &canceled, sizeof(canceled));
|
||||
const int savedErrno = errno;
|
||||
const bool copied = GuestCopyOut_nid_no_patch(result, &canceled, sizeof(canceled));
|
||||
errno = savedErrno;
|
||||
if (!copied) return COMMON_DIALOG_ERROR_ARG_NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "prx/libSceIme/include/ModalDialog.hpp"
|
||||
#include "prx/libSceIme/include/PsnDialogNotice.hpp"
|
||||
#include <atomic>
|
||||
#include <cerrno>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <thread>
|
||||
@@ -99,6 +100,9 @@ int main() {
|
||||
Require(sceNpSnsFacebookDialogUpdateStatus() == kStatusFinished);
|
||||
|
||||
Require(sceNpSnsFacebookDialogGetResult(nullptr) == kErrArgNull);
|
||||
errno = 71;
|
||||
Require(sceNpSnsFacebookDialogGetResult(reinterpret_cast<void*>(0x10)) == kErrArgNull);
|
||||
Require(errno == 71);
|
||||
Require(sceNpSnsFacebookDialogGetResult(result) == 0);
|
||||
Require(result[0] == kResultUserCanceled);
|
||||
Require(result[1] == -1);
|
||||
@@ -121,6 +125,9 @@ int main() {
|
||||
result[0] = -1;
|
||||
Require(sceNpSnsFacebookDialogGetResult(result) == 0);
|
||||
Require(result[0] == kResultUserCanceled);
|
||||
errno = 71;
|
||||
Require(sceNpSnsFacebookDialogGetResult(reinterpret_cast<void*>(0x10)) == kErrArgNull);
|
||||
Require(errno == 71);
|
||||
Require(sceNpSnsFacebookDialogTerminate() == 0);
|
||||
Require(sceNpSnsFacebookDialogTerminate() == kErrNotInitialized);
|
||||
Require(sceNpSnsFacebookDialogOpen(nullptr) == kErrNotInitialized);
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
### Silent stubs
|
||||
|
||||
- [sceNpSnsFacebookDialogOpen](../../../core/libs/prx/libSceNpSnsFacebookDialog/Export.cpp) (libSceNpSnsFacebookDialog) - with `ANYPS5_PSN_DIALOGS=show`, a successful open shows AnyPS5's notice that the feature needs PlayStation Network; the console's own display without PlayStation Network is not measured, and the notice wording is AnyPS5's.
|
||||
- [libSceNpSnsFacebookDialog](../../../core/libs/prx/libSceNpSnsFacebookDialog/Export.cpp) - the Facebook dialog runs the common-dialog state machine but shows nothing and reports the user as having cancelled, as there is no Facebook account link. 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.
|
||||
- [libSceNpSnsFacebookDialog](../../../core/libs/prx/libSceNpSnsFacebookDialog/Export.cpp) - the Facebook dialog runs the common-dialog state machine but shows nothing and reports the user as having cancelled, as there is no Facebook account link. 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. Returning `0x80B8000D` for an unwritable result pointer is a host-safety fallback with console behavior unmeasured.
|
||||
Reference in new issue
Block a user