Skip to content

Commit

Permalink
capsc: Pass CapsApplicationId/u64 for input as required by sysver.
Browse files Browse the repository at this point in the history
  • Loading branch information
yellows8 committed Nov 24, 2024
1 parent 58f1fc6 commit 6c430b2
Showing 1 changed file with 45 additions and 15 deletions.
60 changes: 45 additions & 15 deletions nx/source/services/capsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,41 @@ Result capscNotifyAlbumStorageIsUnAvailable(CapsAlbumStorage storage) {
Result capscRegisterAppletResourceUserId(u64 appletResourceUserId, const CapsApplicationId *application_id) {
if (hosversionBefore(2,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
const struct {
u64 appletResourceUserId;
CapsApplicationId applicationId;
} in = { appletResourceUserId, *application_id };
return serviceDispatchIn(&g_capscSrv, 2011, in);

if (hosversionAtLeast(19,0,0)) {
const struct {
u64 appletResourceUserId;
CapsApplicationId applicationId;
} in = { appletResourceUserId, *application_id };
return serviceDispatchIn(&g_capscSrv, 2011, in);
}
else {
const struct {
u64 appletResourceUserId;
u64 applicationId;
} in = { appletResourceUserId, application_id->application_id };
return serviceDispatchIn(&g_capscSrv, 2011, in);
}
}

Result capscUnregisterAppletResourceUserId(u64 appletResourceUserId, const CapsApplicationId *application_id) {
if (hosversionBefore(2,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
const struct {
u64 appletResourceUserId;
CapsApplicationId applicationId;
} in = { appletResourceUserId, *application_id };
return serviceDispatchIn(&g_capscSrv, 2012, in);

if (hosversionAtLeast(19,0,0)) {
const struct {
u64 appletResourceUserId;
CapsApplicationId applicationId;
} in = { appletResourceUserId, *application_id };
return serviceDispatchIn(&g_capscSrv, 2012, in);
}
else {
const struct {
u64 appletResourceUserId;
u64 applicationId;
} in = { appletResourceUserId, application_id->application_id };
return serviceDispatchIn(&g_capscSrv, 2012, in);
}
}

Result capscGetApplicationIdFromAruid(CapsApplicationId *application_id, u64 aruid) {
Expand All @@ -93,11 +113,21 @@ Result capscCheckApplicationIdRegistered(u64 application_id) {
Result capscGenerateCurrentAlbumFileId(const CapsApplicationId *application_id, CapsAlbumFileContents contents, CapsAlbumFileId *file_id) {
if (hosversionBefore(2,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
const struct {
u8 type;
CapsApplicationId applicationId;
} in = { contents, *application_id };
return serviceDispatchInOut(&g_capscSrv, 2101, in, *file_id);

if (hosversionAtLeast(19,0,0)) {
const struct {
u8 type;
CapsApplicationId applicationId;
} in = { contents, *application_id };
return serviceDispatchInOut(&g_capscSrv, 2101, in, *file_id);
}
else {
const struct {
u8 type;
u64 applicationId;
} in = { contents, application_id->application_id };
return serviceDispatchInOut(&g_capscSrv, 2101, in, *file_id);
}
}

Result capscGenerateApplicationAlbumEntry(CapsApplicationAlbumEntry *appEntry, const CapsAlbumEntry *entry, u64 application_id) {
Expand Down

0 comments on commit 6c430b2

Please sign in to comment.