mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 16:43:05 -05:00
No additional content is installed, so sceAppContentAddcontMount returns SCE_APP_CONTENT_ERROR_NOT_FOUND with the mount point untouched, and sceAppContentAddcontUnmount finds no mount to release. A missing label or mount point is a parameter error. The library gets its own CMakeLists for the new guest_appcontent test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
1.2 KiB
C++
28 lines
1.2 KiB
C++
#include "SceTypes.hpp"
|
|
#include <cstdlib>
|
|
#include <cstring>
|
|
|
|
extern "C" {
|
|
int APS5_VABI sceAppContentAddcontMount(uint32_t, const NpUnifiedEntitlementLabel*, AppContentMountPoint*);
|
|
int APS5_VABI sceAppContentAddcontUnmount(const AppContentMountPoint*);
|
|
}
|
|
|
|
static constexpr int ErrorParameter = static_cast<int>(0x80D90002);
|
|
static constexpr int ErrorNotFound = static_cast<int>(0x80D90005);
|
|
static void Require(bool value) { if (!value) std::abort(); }
|
|
|
|
int main() {
|
|
NpUnifiedEntitlementLabel label{};
|
|
std::memcpy(&label, "ADDCONT000000001", 16);
|
|
AppContentMountPoint mountPoint{};
|
|
std::memset(&mountPoint, 0x5a, sizeof(mountPoint));
|
|
const AppContentMountPoint untouched = mountPoint;
|
|
Require(sceAppContentAddcontMount(0, &label, &mountPoint) == ErrorNotFound);
|
|
Require(std::memcmp(&mountPoint, &untouched, sizeof(mountPoint)) == 0);
|
|
Require(sceAppContentAddcontMount(0, nullptr, &mountPoint) == ErrorParameter);
|
|
Require(sceAppContentAddcontMount(0, &label, nullptr) == ErrorParameter);
|
|
std::memcpy(mountPoint.data, "/addcont0", 10);
|
|
Require(sceAppContentAddcontUnmount(&mountPoint) == ErrorNotFound);
|
|
Require(sceAppContentAddcontUnmount(nullptr) == ErrorParameter);
|
|
}
|