mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
ns: Added NsApplicationRightsOnClient/nsGetApplicationRightsOnClient().
This commit is contained in:
parent
d8d931fe25
commit
c570cd0a2f
@ -143,6 +143,15 @@ typedef struct {
|
|||||||
u8 hmac[0x20]; ///< HMAC-SHA256 over the above data.
|
u8 hmac[0x20]; ///< HMAC-SHA256 over the above data.
|
||||||
} NsApplicationDeliveryInfo;
|
} NsApplicationDeliveryInfo;
|
||||||
|
|
||||||
|
/// NsApplicationRightsOnClient
|
||||||
|
typedef struct {
|
||||||
|
u64 application_id; ///< ApplicationId.
|
||||||
|
AccountUid uid; ///< \ref AccountUid
|
||||||
|
u8 flags_x18; ///< qlaunch uses bit0-bit4 and bit7 from here.
|
||||||
|
u8 flags_x19; ///< qlaunch uses bit0 from here.
|
||||||
|
u8 unk_x1a[0x6]; ///< Unknown.
|
||||||
|
} NsApplicationRightsOnClient;
|
||||||
|
|
||||||
/// Default size for \ref nssuControlSetupCardUpdate / \ref nssuControlSetupCardUpdateViaSystemUpdater. This is the size used by qlaunch for SetupCardUpdate.
|
/// Default size for \ref nssuControlSetupCardUpdate / \ref nssuControlSetupCardUpdateViaSystemUpdater. This is the size used by qlaunch for SetupCardUpdate.
|
||||||
#define NSSU_CARDUPDATE_TMEM_SIZE_DEFAULT 0x100000
|
#define NSSU_CARDUPDATE_TMEM_SIZE_DEFAULT 0x100000
|
||||||
|
|
||||||
@ -737,6 +746,18 @@ Result nsGetApplicationDeliveryInfoHash(const NsApplicationDeliveryInfo *info, s
|
|||||||
*/
|
*/
|
||||||
Result nsGetApplicationTerminateResult(u64 application_id, Result *res);
|
Result nsGetApplicationTerminateResult(u64 application_id, Result *res);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief GetApplicationRightsOnClient
|
||||||
|
* @note Only available on [6.0.0+].
|
||||||
|
* @param[out] rights Output array of \ref NsApplicationRightsOnClient.
|
||||||
|
* @param[in] count Size of the rights array in entries. qlaunch uses value 3 for this.
|
||||||
|
* @param[in] application_id ApplicationId
|
||||||
|
* @param[in] uid \ref AccountUid, can optionally be all-zero.
|
||||||
|
* @param[in] flags Flags. Official sw hard-codes this to value 0x3.
|
||||||
|
* @param[out] total_out Total output entries.
|
||||||
|
*/
|
||||||
|
Result nsGetApplicationRightsOnClient(NsApplicationRightsOnClient *rights, s32 count, u64 application_id, AccountUid uid, u32 flags, s32 *total_out);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief RequestNoDownloadRightsErrorResolution
|
* @brief RequestNoDownloadRightsErrorResolution
|
||||||
* @note \ref nifmInitialize must be used prior to this. Before using the cmd, this calls \ref nifmIsAnyInternetRequestAccepted with the output from \ref nifmGetClientId, an error is returned when that returns false.
|
* @note \ref nifmInitialize must be used prior to this. Before using the cmd, this calls \ref nifmIsAnyInternetRequestAccepted with the output from \ref nifmGetClientId, an error is returned when that returns false.
|
||||||
|
@ -940,6 +940,23 @@ Result nsGetApplicationTerminateResult(u64 application_id, Result *res) {
|
|||||||
return serviceDispatchInOut(&g_nsAppManSrv, 2100, application_id, *res);
|
return serviceDispatchInOut(&g_nsAppManSrv, 2100, application_id, *res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result nsGetApplicationRightsOnClient(NsApplicationRightsOnClient *rights, s32 count, u64 application_id, AccountUid uid, u32 flags, s32 *total_out) {
|
||||||
|
if (hosversionBefore(6,0,0))
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
|
|
||||||
|
const struct {
|
||||||
|
u32 flags;
|
||||||
|
u32 pad;
|
||||||
|
u64 application_id;
|
||||||
|
AccountUid uid;
|
||||||
|
} in = { flags, 0, application_id, uid };
|
||||||
|
|
||||||
|
return serviceDispatchInOut(&g_nsAppManSrv, 2050, in, *total_out,
|
||||||
|
.buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out },
|
||||||
|
.buffers = { { rights, count*sizeof(NsApplicationRightsOnClient) } },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Result nsRequestNoDownloadRightsErrorResolution(AsyncValue *a, u64 application_id) {
|
Result nsRequestNoDownloadRightsErrorResolution(AsyncValue *a, u64 application_id) {
|
||||||
if (hosversionBefore(9,0,0))
|
if (hosversionBefore(9,0,0))
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
|
Loading…
Reference in New Issue
Block a user