mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Added appletIsSystemBufferSharingEnabled, appletGetSystemSharedLayerHandle, and appletGetSystemSharedBufferHandle.
This commit is contained in:
parent
974f5b9a1b
commit
ed2f4a68f7
@ -519,6 +519,27 @@ Result appletSetDesirableKeyboardLayout(u32 layout);
|
||||
|
||||
Result appletCreateManagedDisplayLayer(u64 *out);
|
||||
|
||||
/**
|
||||
* @brief Checks whether SystemBufferSharing is enabled, throwing an error otherwise.
|
||||
* @note Only available with [4.0.0+]. Not usable with AppletType_*Application.
|
||||
*/
|
||||
Result appletIsSystemBufferSharingEnabled(void);
|
||||
|
||||
/**
|
||||
* @brief Gets the System SharedBufferHandle and SharedLayerHandle.
|
||||
* @note Only available with [4.0.0+]. Not usable with AppletType_*Application.
|
||||
* @param[out] SharedBufferHandle Output System SharedBufferHandle.
|
||||
* @param[out] SharedLayerHandle Output System SharedLayerHandle.
|
||||
*/
|
||||
Result appletGetSystemSharedLayerHandle(u64 *SharedBufferHandle, u64 *SharedLayerHandle);
|
||||
|
||||
/**
|
||||
* @brief Same as \ref appletGetSystemSharedLayerHandle except this just gets the SharedBufferHandle.
|
||||
* @note Only available with [5.0.0+]. Not usable with AppletType_*Application.
|
||||
* @param[out] SharedBufferHandle Output System SharedBufferHandle.
|
||||
*/
|
||||
Result appletGetSystemSharedBufferHandle(u64 *SharedBufferHandle);
|
||||
|
||||
/**
|
||||
* @brief Sets whether ::AppletNotificationMessage_RequestToDisplay is enabled.
|
||||
* @note Sets an internal state flag. When the input flag is 0, this will in additional run the same code as \ref appletApproveToDisplay.
|
||||
|
@ -2242,7 +2242,6 @@ Result appletSetScreenShotAppletIdentityInfo(AppletIdentityInfo *info) {
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 result;
|
||||
AppletIdentityInfo info;
|
||||
} *resp;
|
||||
|
||||
serviceIpcParse(&g_appletISelfController, &r, sizeof(*resp));
|
||||
@ -2290,6 +2289,60 @@ Result appletCreateManagedDisplayLayer(u64 *out) {
|
||||
return _appletCmdNoInOut64(&g_appletISelfController, out, 40);
|
||||
}
|
||||
|
||||
Result appletIsSystemBufferSharingEnabled(void) {
|
||||
if (hosversionBefore(4,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
return _appletCmdNoIO(&g_appletISelfController, 41);
|
||||
}
|
||||
|
||||
Result appletGetSystemSharedLayerHandle(u64 *SharedBufferHandle, u64 *SharedLayerHandle) {
|
||||
if (hosversionBefore(4,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 cmd_id;
|
||||
} *raw;
|
||||
|
||||
raw = serviceIpcPrepareHeader(&g_appletISelfController, &c, sizeof(*raw));
|
||||
|
||||
raw->magic = SFCI_MAGIC;
|
||||
raw->cmd_id = 42;
|
||||
|
||||
Result rc = serviceIpcDispatch(&g_appletISelfController);
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
IpcParsedCommand r;
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 result;
|
||||
u64 SharedBufferHandle;
|
||||
u64 SharedLayerHandle;
|
||||
} *resp;
|
||||
|
||||
serviceIpcParse(&g_appletISelfController, &r, sizeof(*resp));
|
||||
resp = r.Raw;
|
||||
|
||||
rc = resp->result;
|
||||
|
||||
if (R_SUCCEEDED(rc) && SharedBufferHandle) *SharedBufferHandle = resp->SharedBufferHandle;
|
||||
if (R_SUCCEEDED(rc) && SharedLayerHandle) *SharedLayerHandle = resp->SharedLayerHandle;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result appletGetSystemSharedBufferHandle(u64 *SharedBufferHandle) {
|
||||
if (hosversionBefore(5,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
return _appletCmdNoInOut64(&g_appletISelfController, SharedBufferHandle, 43);
|
||||
}
|
||||
|
||||
Result appletSetHandlesRequestToDisplay(bool flag) {
|
||||
return _appletCmdInBool(&g_appletISelfController, flag, 50);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user