mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Added appletHolderActive and appletHolderCheckFinished.
This commit is contained in:
parent
f589310ef2
commit
82e526c72f
@ -234,6 +234,9 @@ Result appletCreateLibraryAppletSelf(AppletHolder *h, AppletId id, LibAppletMode
|
||||
/// Closes an AppletHolder object.
|
||||
void appletHolderClose(AppletHolder *h);
|
||||
|
||||
/// Returns whether the AppletHolder object was initialized.
|
||||
bool appletHolderActive(AppletHolder *h);
|
||||
|
||||
/**
|
||||
* @brief Gets the IndirectLayerConsumerHandle loaded during \ref appletCreateLibraryApplet, on 2.0.0+.
|
||||
* @note Only available when \ref LibAppletMode is \ref LibAppletMode_Unknown3.
|
||||
@ -254,6 +257,12 @@ Result appletHolderStart(AppletHolder *h);
|
||||
*/
|
||||
void appletHolderJoin(AppletHolder *h);
|
||||
|
||||
/**
|
||||
* @brief Waits on the LibraryApplet StateChangedEvent with timeout=0, and returns whether it was successful.
|
||||
* @param h AppletHolder object.
|
||||
*/
|
||||
bool appletHolderCheckFinished(AppletHolder *h);
|
||||
|
||||
/**
|
||||
* @brief Gets the \ref LibAppletExitReason set by \ref appletHolderJoin.
|
||||
* @param h AppletHolder object.
|
||||
|
@ -1642,6 +1642,10 @@ void appletHolderClose(AppletHolder *h) {
|
||||
memset(h, 0, sizeof(AppletHolder));
|
||||
}
|
||||
|
||||
bool appletHolderActive(AppletHolder *h) {
|
||||
return serviceIsActive(&h->s);
|
||||
}
|
||||
|
||||
Result appletHolderGetIndirectLayerConsumerHandle(AppletHolder *h, u64 *out) {
|
||||
if (!serviceIsActive(&h->s))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||
@ -1690,6 +1694,10 @@ void appletHolderJoin(AppletHolder *h) {
|
||||
h->exitreason = res;
|
||||
}
|
||||
|
||||
bool appletHolderCheckFinished(AppletHolder *h) {
|
||||
return R_SUCCEEDED(eventWait(&h->StateChangedEvent, 0));
|
||||
}
|
||||
|
||||
u32 appletHolderGetExitReason(AppletHolder *h) {
|
||||
return h->exitreason;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user