From 8f8ecc7ef7af559c899ff0f85ce683069d4df87c Mon Sep 17 00:00:00 2001 From: Alexandre Figueiredo Date: Sun, 25 Oct 2026 09:38:49 +0000 Subject: [PATCH] fix(libSceVoiceChat): declare the handler registration arguments a title passes --- core/libs/prx/libSceVoiceChat/Export.cpp | 4 ++-- core/libs/prx/libSceVoiceChat/include/Api.hpp | 4 ++-- core/libs/tests/GuestVoiceChat.cpp | 4 ++-- docs/dev/debt/libSceVoiceChat.md | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/libs/prx/libSceVoiceChat/Export.cpp b/core/libs/prx/libSceVoiceChat/Export.cpp index b1fde4c767..9f3c11f943 100644 --- a/core/libs/prx/libSceVoiceChat/Export.cpp +++ b/core/libs/prx/libSceVoiceChat/Export.cpp @@ -31,8 +31,8 @@ extern "C" { int APS5_VABI sceVoiceChatInitialize(void* param) { (void)param; return 0; } int APS5_VABI sceVoiceChatTerminate(void) { return 0; } -int APS5_VABI sceVoiceChatRegisterHandlers(void* a) { (void)a; return 0; } -int APS5_VABI sceVoiceChatRegisterMicEventHandler(void* a, void* b) { (void)a; (void)b; return 0; } +int APS5_VABI sceVoiceChatRegisterHandlers(void* handlers, void* userArg) { (void)handlers; (void)userArg; return 0; } +int APS5_VABI sceVoiceChatRegisterMicEventHandler(std::int32_t userId, void* handler, void* userArg) { (void)userId; (void)handler; (void)userArg; return 0; } int APS5_VABI sceVoiceChatProcessEvent(void) { return 0; } int APS5_VABI sceVoiceChatDeleteRequest(int requestId) { (void)requestId; return 0; } diff --git a/core/libs/prx/libSceVoiceChat/include/Api.hpp b/core/libs/prx/libSceVoiceChat/include/Api.hpp index 5d5676dff3..3b3df314de 100644 --- a/core/libs/prx/libSceVoiceChat/include/Api.hpp +++ b/core/libs/prx/libSceVoiceChat/include/Api.hpp @@ -6,8 +6,8 @@ extern "C" { int APS5_VABI sceVoiceChatInitialize(void* param); int APS5_VABI sceVoiceChatTerminate(void); -int APS5_VABI sceVoiceChatRegisterHandlers(void* a); -int APS5_VABI sceVoiceChatRegisterMicEventHandler(void* a, void* b); +int APS5_VABI sceVoiceChatRegisterHandlers(void* handlers, void* userArg); +int APS5_VABI sceVoiceChatRegisterMicEventHandler(std::int32_t userId, void* handler, void* userArg); int APS5_VABI sceVoiceChatProcessEvent(void); int APS5_VABI sceVoiceChatDeleteRequest(int requestId); int APS5_VABI sceVoiceChatCreateRequest(void* a, void* b); diff --git a/core/libs/tests/GuestVoiceChat.cpp b/core/libs/tests/GuestVoiceChat.cpp index 0b80ea67e8..c9390b63dd 100644 --- a/core/libs/tests/GuestVoiceChat.cpp +++ b/core/libs/tests/GuestVoiceChat.cpp @@ -22,8 +22,8 @@ int main() { Require(sceVoiceChatInitialize(nullptr) == 0, "initialization failed"); Require(sceVoiceChatProcessEvent() == 0, "event processing failed"); - Require(sceVoiceChatRegisterHandlers(nullptr) == 0, "register handlers failed"); - Require(sceVoiceChatRegisterMicEventHandler(nullptr, nullptr) == 0, "register mic event handler failed"); + Require(sceVoiceChatRegisterHandlers(nullptr, nullptr) == 0, "register handlers failed"); + Require(sceVoiceChatRegisterMicEventHandler(0, nullptr, nullptr) == 0, "register mic event handler failed"); Require(sceVoiceChatRegisterChannelEventHandler(nullptr, nullptr) == 0, "register channel event handler failed"); Require(sceVoiceChatUnregisterMicEventHandler(nullptr) == 0, "unregister mic event handler failed"); Require(sceVoiceChatStartChannelEvent(nullptr) == 0, "start channel event failed"); diff --git a/docs/dev/debt/libSceVoiceChat.md b/docs/dev/debt/libSceVoiceChat.md index 60ad4dc3bb..98557e7eed 100644 --- a/docs/dev/debt/libSceVoiceChat.md +++ b/docs/dev/debt/libSceVoiceChat.md @@ -3,6 +3,7 @@ ### Silent stubs - [sceVoiceChatAbortRequest, sceVoiceChatRegisterChannelEventHandler, sceVoiceChatRegisterDaemonEventHandler, sceVoiceChatRegisterMemberEventHandler, sceVoiceChatRegisterPartyUserStateChangedHandler, sceVoiceChatRegisterVoiceEventHandler, sceVoiceChatStartAccessibilityEvent, sceVoiceChatStartChannelEvent, sceVoiceChatStartDaemonEvent, sceVoiceChatStartMemberEvent, sceVoiceChatStartRangedMemberEvent, sceVoiceChatStartVoiceEvent, sceVoiceChatStopAccessibilityEvent, sceVoiceChatStopChannelEvent, sceVoiceChatStopDaemonEvent, sceVoiceChatStopMemberEvent, sceVoiceChatStopRangedMemberEvent, sceVoiceChatStopVoiceEvent, sceVoiceChatUnregisterAccessibilityEventHandler, sceVoiceChatUnregisterChannelEventHandler, sceVoiceChatUnregisterDaemonEventHandler, sceVoiceChatUnregisterMemberEventHandler, sceVoiceChatUnregisterMicEventHandler, sceVoiceChatUnregisterPartyUserStateChangedHandler, sceVoiceChatUnregisterRangedMemberEventHandler, sceVoiceChatUnregisterVoiceEventHandler](../../../core/libs/prx/libSceVoiceChat/Export.cpp) (libSceVoiceChat) - offline handler registration and event controls return 0 without connecting to a voice chat daemon, because the host environment does not run a PSN voice chat service; titles that register event listeners or start/stop audio capture events proceed safely without throwing +- [sceVoiceChatRegisterHandlers and sceVoiceChatRegisterMicEventHandler](../../../core/libs/prx/libSceVoiceChat/Export.cpp) (libSceVoiceChat) - they keep no handler and return 0 without connecting to a voice chat daemon, so no handler is ever called; the handler table's layout and the handlers' prototypes are not identified. The signatures come from one disassembled title (PPSA21564 01.007.000), not from a console: it calls `sceVoiceChatRegisterHandlers` (0x2e473c) with a 0x30-byte structure of six function addresses and a user argument, then `sceVoiceChatRegisterMicEventHandler` (0x2e4751) with the 32-bit value it also passes as the user id of `sceNpWebApi2CreateUserContext`, a function address and the same user argument, and treats a negative result from either as failure ### Unknown function info