fix descriptions

don't let user supply aruid
don't use temp values for _capscCmdInU8NoOut
This commit is contained in:
HookedBehemoth 2020-02-19 18:55:21 +01:00
parent b9c5bb89ae
commit 171d9b8a3d
4 changed files with 31 additions and 27 deletions

View File

@ -333,13 +333,13 @@ Result capsaGetAlbumCache(CapsAlbumStorage storage, CapsAlbumCache *cache);
Result capsaGetAlbumCacheEx(CapsAlbumStorage storage, CapsAlbumFileContents contents, CapsAlbumCache *cache); Result capsaGetAlbumCacheEx(CapsAlbumStorage storage, CapsAlbumFileContents contents, CapsAlbumCache *cache);
/** /**
* @brief Load an \ref CapsAlbumEntry from a \ref CapsApplicationAlbumEntry and an Applet Resource User Id. * @brief Load an \ref CapsAlbumEntry from a \ref CapsApplicationAlbumEntry and an AppletResourceUserId.
* @note Only available on [2.0.0+]. * @note Only available on [2.0.0+].
* @param[out] entry \ref CapsAlbumEntry * @param[out] entry \ref CapsAlbumEntry
* @param[in] application_entry \ref CapsApplicationAlbumEntry * @param[in] application_entry \ref CapsApplicationAlbumEntry
* @param[in] appletResourceUserId Application Resouce User Id * @param[in] appletResourceUserId AppletResourceUserId
*/ */
Result capsaGetAlbumEntryFromApplicationAlbumEntryAruid(CapsAlbumEntry *entry, const CapsApplicationAlbumEntry *application_entry, u64 appletResourceUserId); Result capsaGetAlbumEntryFromApplicationAlbumEntryAruid(CapsAlbumEntry *entry, const CapsApplicationAlbumEntry *application_entry);
/** /**
* @brief Opens an AlbumMovieStream. * @brief Opens an AlbumMovieStream.

View File

@ -34,49 +34,55 @@ Result capscNotifyAlbumStorageIsUnAvailable(CapsAlbumStorage storage);
/** /**
* @brief Register an applet for later usage. * @brief Register an applet for later usage.
* @note Called at application launch. * @note Called at application launch by the system.
* @note Will generate a random AES-256 key for this application for use on Shim-Version 0. * @note Will generate a random AES-256 key for this application for use on Shim-Version 0.
* @param[in] appletResourceUserId Session unique applet identifier. * @note Only available on [2.0.0+].
* @param[in] application_id Title unique identifier. * @param[in] appletResourceUserId AppletResourceUserId.
* @param[in] application_id ApplicationId.
*/ */
Result capscRegisterAppletResourceUserId(u64 appletResourceUserId, u64 application_id); Result capscRegisterAppletResourceUserId(u64 appletResourceUserId, u64 application_id);
/** /**
* @brief Unregister an applet. * @brief Unregister an applet.
* @note Called at application exit. * @note Called at application exit by the system.
* @param[in] appletResourceUserId Session unique applet identifier. * @note Only available on [2.0.0+].
* @param[in] application_id Title unique identifier. * @param[in] appletResourceUserId AppletResourceUserId.
* @param[in] application_id ApplicationId.
*/ */
Result capscUnregisterAppletResourceUserId(u64 appletResourceUserId, u64 application_id); Result capscUnregisterAppletResourceUserId(u64 appletResourceUserId, u64 application_id);
/** /**
* @brief Get an Application ID that corresponse to an Application Resource User ID. * @brief Get an ApplicationId that corresponse to an AppletResourceUserId.
* @note Returns value set by \ref capscRegisterAppletResourceUserId. * @note Returns value set by \ref capscRegisterAppletResourceUserId.
* @param[out] application_id Title unique identifier. * @note Only available on [2.0.0+].
* @param[in] appletResourceUserId Session unique applet identifier. * @param[out] application_id ApplicationId.
* @param[in] appletResourceUserId AppletResourceUserId.
*/ */
Result capscGetApplicationIdFromAruid(u64 *application_id, u64 aruid); Result capscGetApplicationIdFromAruid(u64 *application_id, u64 aruid);
/** /**
* @brief Checks whether an Application ID is registered. * @brief Checks whether an ApplicationId is registered.
* @param[in] application_id Title unique identifier. * @note Only available on [2.0.0+].
* @param[in] application_id ApplicationId.
*/ */
Result capscCheckApplicationIdRegistered(u64 application_id); Result capscCheckApplicationIdRegistered(u64 application_id);
/** /**
* @brief Generate an Album File ID based of parameters and current time. * @brief Generate an AlbumFileId based of parameters and current time.
* @param[in] application_id Title unique identifier. * @param[in] application_id ApplicationId.
* @note Only available on [2.0.0+].
* @param[in] contents \ref CapsAlbumFileContents * @param[in] contents \ref CapsAlbumFileContents
* @param[out] file_id \ref CapsAlbumFileId * @param[out] file_id \ref CapsAlbumFileId
*/ */
Result capscGenerateCurrentAlbumFileId(u64 application_id, CapsAlbumFileContents contents, CapsAlbumFileId *file_id); Result capscGenerateCurrentAlbumFileId(u64 application_id, CapsAlbumFileContents contents, CapsAlbumFileId *file_id);
/** /**
* @brief Generate an Application Album Entry based of parameters. * @brief Generate an ApplicationAlbumEntry based of parameters.
* @note Output will be different between Shim Version 0 and 1. * @note Output will be different between Shim Version 0 and 1.
* @note Only available on [2.0.0+].
* @param[out] appEntry \ref CapsApplicationAlbumEntry * @param[out] appEntry \ref CapsApplicationAlbumEntry
* @param[in] entry \ref CapsAlbumEntry * @param[in] entry \ref CapsAlbumEntry
* @param[in] application_id Title unique identifier. * @param[in] application_id ApplicationId.
*/ */
Result capscGenerateApplicationAlbumEntry(CapsApplicationAlbumEntry *appEntry, const CapsAlbumEntry *entry, u64 application_id); Result capscGenerateApplicationAlbumEntry(CapsApplicationAlbumEntry *appEntry, const CapsAlbumEntry *entry, u64 application_id);
@ -104,7 +110,7 @@ Result capscSaveAlbumScreenShotFileEx(const CapsAlbumFileId *file_id, u64 versio
/** /**
* @brief Sets thumbnail data for the last taken screenshot. * @brief Sets thumbnail data for the last taken screenshot.
* @note 96×54x4 Image will get saved. * @note 96×54 Image will get saved.
* @param[in] file_id \ref CapsAlbumFileId * @param[in] file_id \ref CapsAlbumFileId
* @param[in] image RGBA8 image buffer. * @param[in] image RGBA8 image buffer.
* @param[in] image_size size of the RGBA8 image buffer. * @param[in] image_size size of the RGBA8 image buffer.
@ -114,7 +120,7 @@ Result capscSetOverlayScreenShotThumbnailData(const CapsAlbumFileId *file_id, co
/** /**
* @brief Sets thumbnail data for the last recorded movie. * @brief Sets thumbnail data for the last recorded movie.
* @note Only availabe on [4.0.0+]. * @note Only availabe on [4.0.0+].
* @note 96×54x4 Image will get saved. * @note 96×54 Image will get saved.
* @param[in] file_id \ref CapsAlbumFileId * @param[in] file_id \ref CapsAlbumFileId
* @param[in] image RGBA8 image buffer. * @param[in] image RGBA8 image buffer.
* @param[in] image_size size of the RGBA8 image buffer. * @param[in] image_size size of the RGBA8 image buffer.
@ -123,7 +129,7 @@ Result capscSetOverlayMovieThumbnailData(const CapsAlbumFileId *file_id, const v
/** /**
* @brief Opens an AlbumMovieReadStream. * @brief Opens an AlbumMovieReadStream.
* @note This opens IAlbumControlSession if not previously opened, it's closed during \ref capsaExit. * @note This opens IAlbumControlSession if not previously opened, it's closed during \ref capscExit.
* @note Up to 4 streams can be open at the same time. Multiple streams can be open at the same time for the same \ref CapsAlbumFileId. * @note Up to 4 streams can be open at the same time. Multiple streams can be open at the same time for the same \ref CapsAlbumFileId.
* @note Only available on [4.0.0+]. * @note Only available on [4.0.0+].
* @param[out] stream Stream handle. * @param[out] stream Stream handle.

View File

@ -350,13 +350,13 @@ Result capsaGetAlbumCacheEx(CapsAlbumStorage storage, CapsAlbumFileContents cont
return serviceDispatchInOut(&g_capsaSrv, 8013, in, *cache); return serviceDispatchInOut(&g_capsaSrv, 8013, in, *cache);
} }
Result capsaGetAlbumEntryFromApplicationAlbumEntryAruid(CapsAlbumEntry *entry, const CapsApplicationAlbumEntry *application_entry, u64 appletResourceUserId) { Result capsaGetAlbumEntryFromApplicationAlbumEntryAruid(CapsAlbumEntry *entry, const CapsApplicationAlbumEntry *application_entry) {
if (hosversionBefore(2,0,0)) if (hosversionBefore(2,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
const struct { const struct {
CapsApplicationAlbumEntry application_entry; CapsApplicationAlbumEntry application_entry;
u64 aruid; u64 aruid;
} in = { *application_entry, appletResourceUserId }; } in = { *application_entry, appletGetAppletResourceUserId() };
return serviceDispatchInOut(&g_capsaSrv, 8021, in, *entry, .in_send_pid = true); return serviceDispatchInOut(&g_capsaSrv, 8021, in, *entry, .in_send_pid = true);
} }

View File

@ -47,13 +47,11 @@ static Result _capscCmdInU8NoOut(Service *srv, u32 cmd_id, u64 inval) {
} }
Result capscNotifyAlbumStorageIsAvailable(CapsAlbumStorage storage) { Result capscNotifyAlbumStorageIsAvailable(CapsAlbumStorage storage) {
u8 inval = storage; return _capscCmdInU8NoOut(&g_capscSrv, 2001, storage);
return _capscCmdInU8NoOut(&g_capscSrv, 2001, inval);
} }
Result capscNotifyAlbumStorageIsUnAvailable(CapsAlbumStorage storage) { Result capscNotifyAlbumStorageIsUnAvailable(CapsAlbumStorage storage) {
u8 inval = storage; return _capscCmdInU8NoOut(&g_capscSrv, 2002, storage);
return _capscCmdInU8NoOut(&g_capscSrv, 2002, inval);
} }
Result capscRegisterAppletResourceUserId(u64 appletResourceUserId, u64 application_id) { Result capscRegisterAppletResourceUserId(u64 appletResourceUserId, u64 application_id) {