mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 08:33:12 -05:00
sceVoiceQoSInit accepted only app type 0x20000000 and threw for every other value. PPSA26344 v1.008 passes 0x10000000 at both of its call sites, so its initialization threw. Accept 0x10000000 as a second known app type. Its meaning is unknown, so the constant is named after the value, and it is handled like 0x20000000; the block stays unused. A null or empty block, a second initialization and every other app type still throw. guest_voice_qos_tests now takes the app type as its argument and runs in ctest once per accepted value, because sceVoiceQoSEnd still throws and one process can initialize only once.
34 lines
1.2 KiB
C++
34 lines
1.2 KiB
C++
#include "prx/libc/include/general/VabiMacros.hpp"
|
|
#include <cstdint>
|
|
#include <cstdlib>
|
|
#include <stdexcept>
|
|
#include <vector>
|
|
|
|
extern "C" {
|
|
int APS5_VABI sceVoiceQoSInit(void*, std::uint32_t, std::int32_t);
|
|
}
|
|
|
|
static void Require(bool value) { if (!value) std::abort(); }
|
|
|
|
template<typename TException, typename TFunction>
|
|
static bool Throws(TFunction function) {
|
|
try {
|
|
function();
|
|
} catch (const TException&) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
int main(int argc, char** argv) {
|
|
Require(argc == 2);
|
|
const auto appType = static_cast<std::int32_t>(std::strtoul(argv[1], nullptr, 16));
|
|
std::vector<std::uint8_t> memory(0x40000);
|
|
Require(Throws<std::invalid_argument>([&] { sceVoiceQoSInit(nullptr, 0x40000, appType); }));
|
|
Require(Throws<std::invalid_argument>([&] { sceVoiceQoSInit(memory.data(), 0, appType); }));
|
|
Require(Throws<std::invalid_argument>([&] { sceVoiceQoSInit(memory.data(), 0x40000, 0); }));
|
|
Require(Throws<std::invalid_argument>([&] { sceVoiceQoSInit(memory.data(), 0x40000, 0x30000000); }));
|
|
Require(sceVoiceQoSInit(memory.data(), 0x40000, appType) == 0);
|
|
Require(Throws<std::runtime_error>([&] { sceVoiceQoSInit(memory.data(), 0x40000, appType); }));
|
|
}
|