mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-25 14:22:40 +02:00
Added storage pushing for AppletHolder. Verify that the input storage is initialized in _appletCmdInStorage().
This commit is contained in:
parent
5874a272d0
commit
a6e1413712
@ -237,6 +237,30 @@ void appletHolderJoin(AppletHolder *h);
|
||||
*/
|
||||
LibAppletExitReason appletHolderGetExitReason(AppletHolder *h);
|
||||
|
||||
/**
|
||||
* @brief Pushes a storage for LibraryApplet input.
|
||||
* @note This uses \ref appletStorageClose automatically.
|
||||
* @param h AppletHolder object.
|
||||
* @param s Storage object.
|
||||
*/
|
||||
Result appletHolderPushInData(AppletHolder *h, AppletStorage *s);
|
||||
|
||||
/**
|
||||
* @brief Pushes a storage for LibraryApplet Extra storage input.
|
||||
* @note This uses \ref appletStorageClose automatically.
|
||||
* @param h AppletHolder object.
|
||||
* @param s Storage object.
|
||||
*/
|
||||
Result appletHolderPushExtraStorage(AppletHolder *h, AppletStorage *s);
|
||||
|
||||
/**
|
||||
* @brief Pushes a storage for LibraryApplet Interactive input.
|
||||
* @note This uses \ref appletStorageClose automatically.
|
||||
* @param h AppletHolder object.
|
||||
* @param s Storage object.
|
||||
*/
|
||||
Result appletHolderPushInteractiveInData(AppletHolder *h, AppletStorage *s);
|
||||
|
||||
/**
|
||||
* @brief Creates a storage.
|
||||
* @param s Storage object.
|
||||
|
@ -743,7 +743,13 @@ static Result _appletCmdInSession(Service* srv, Service* srv_in, u64 cmd_id) {
|
||||
}
|
||||
|
||||
static Result _appletCmdInStorage(Service* srv, AppletStorage* s, u64 cmd_id) {
|
||||
Result rc = _appletCmdInSession(srv, &s->s, cmd_id);
|
||||
Result rc=0;
|
||||
|
||||
if (!serviceIsActive(&s->s))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||
|
||||
rc =_appletCmdInSession(srv, &s->s, cmd_id);
|
||||
|
||||
appletStorageClose(s);
|
||||
return rc;
|
||||
}
|
||||
@ -1627,6 +1633,18 @@ u32 appletHolderGetExitReason(AppletHolder *h) {
|
||||
return h->exitreason;
|
||||
}
|
||||
|
||||
Result appletHolderPushInData(AppletHolder *h, AppletStorage *s) {
|
||||
return _appletCmdInStorage(&h->s, s, 100);
|
||||
}
|
||||
|
||||
Result appletHolderPushExtraStorage(AppletHolder *h, AppletStorage *s) {
|
||||
return _appletCmdInStorage(&h->s, s, 102);
|
||||
}
|
||||
|
||||
Result appletHolderPushInteractiveInData(AppletHolder *h, AppletStorage *s) {
|
||||
return _appletCmdInStorage(&h->s, s, 103);
|
||||
}
|
||||
|
||||
Result appletCreateStorage(AppletStorage *s, s64 size) {
|
||||
memset(s, 0, sizeof(AppletStorage));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user