am.h File Reference

AM (Application Manager) service. More...

`#include <3ds/services/fs.h>`

Go to the source code of this file.

## Data Structures

struct | AM_TitleEntry
| Contains basic information about a title. More...
struct | AM_PendingTitleEntry
struct | AM_TWLPartitionInfo
| Information about the TWL NAND partition. More...
struct | AM_ContentInfo
| Contains information about a title's content. More...

## Enumerations

enum | { AM_STATUS_MASK_INSTALLING = BIT(0) , AM_STATUS_MASK_AWAITING_FINALIZATION = BIT(1) }
| Pending title status mask values. More...
enum | AM_InstallStatus { AM_STATUS_ABORTED = 0x0002 , AM_STATUS_SAVED = 0x0003 , AM_STATUS_INSTALL_IN_PROGRESS = 0x0802 , AM_STATUS_AWAITING_FINALIZATION = 0x0803 }
| Pending title status values. More...
enum | { AM_DELETE_PENDING_NON_SYSTEM = BIT(0) , AM_DELETE_PENDING_SYSTEM = BIT(1) }
| Pending title deletion flags. More...
enum | AM_ContentInfoFlags { AM_CONTENT_DOWNLOADED = BIT(0) , AM_CONTENT_OWNED = BIT(1) }
| Title ContentInfo flags. More...

## Functions

Result | amInit (void)
| Initializes AM. This doesn't initialize with "am:app", see amAppInit().
Result | amAppInit (void)
| Initializes AM with a service which has access to the amapp-commands. This should only be used when using the amapp commands, not non-amapp AM commands.
void | amExit (void)
| Exits AM.
Handle * | amGetSessionHandle (void)
| Gets the current AM session handle.
Result | AM_GetTitleCount (FS_MediaType mediatype, u32 *count)
| Gets the number of titles for a given media type. More...
Result | AM_GetTitleList (u32 *titlesRead, FS_MediaType mediatype, u32 titleCount, u64 *titleIds)
| Gets a list of title IDs present in a mediatype. More...
Result | AM_GetTitleInfo (FS_MediaType mediatype, u32 titleCount, u64 *titleIds, AM_TitleEntry *titleInfo)
| Gets a list of details about installed titles. More...
Result | AM_GetTicketCount (u32 *count)
| Gets the number of tickets installed on the system. More...
Result | AM_GetTicketList (u32 *ticketsRead, u32 ticketCount, u32 skip, u64 *ticketIds)
| Gets a list of tickets installed on the system. More...
Result | AM_GetPendingTitleCount (u32 *count, FS_MediaType mediatype, u32 statusMask)
| Gets the number of pending titles on this system. More...
Result | AM_GetPendingTitleList (u32 *titlesRead, u32 titleCount, FS_MediaType mediatype, u32 statusMask, u64 *titleIds)
| Gets a list of pending titles on this system. More...
Result | AM_GetPendingTitleInfo (u32 titleCount, FS_MediaType mediatype, u64 *titleIds, AM_PendingTitleEntry *titleInfo)
| Gets information about pending titles on this system. More...
Result | AM_GetDeviceId (u32 *deviceID)
| Gets a 32-bit device-specific ID. More...
Result | AM_ExportTwlBackup (u64 titleID, u8 operation, void *workbuf, u32 workbuf_size, const char *filepath)
| Exports DSiWare to the specified filepath. More...
Result | AM_ImportTwlBackup (Handle filehandle, u8 operation, void *buffer, u32 size)
| Imports DSiWare from the specified file. More...
Result | AM_ReadTwlBackupInfo (Handle filehandle, void *outinfo, u32 outinfo_size, void *workbuf, u32 workbuf_size, void *banner, u32 banner_size)
| Reads info from the specified DSiWare export file. More...
Result | AM_GetTWLPartitionInfo (AM_TWLPartitionInfo *info)
| Retrieves information about the NAND TWL partition. More...
Result | AM_StartCiaInstall (FS_MediaType mediatype, Handle *ciaHandle)
| Initializes the CIA install process, returning a handle to write CIA data to. More...
Result | AM_StartDlpChildCiaInstall (Handle *ciaHandle)
| Initializes the CIA install process for Download Play CIAs, returning a handle to write CIA data to. More...
Result | AM_CancelCIAInstall (Handle ciaHandle)
| Aborts the CIA install process. More...
Result | AM_FinishCiaInstall (Handle ciaHandle)
| Finalizes the CIA install process. More...
Result | AM_FinishCiaInstallWithoutCommit (Handle ciaHandle)
| Finalizes the CIA install process without committing the title to title.db or tmp*.db. More...
Result | AM_CommitImportPrograms (FS_MediaType mediaType, u32 titleCount, bool temp, const u64 *titleIds)
| Commits installed CIAs. More...
Result | AM_DeleteTitle (FS_MediaType mediatype, u64 titleID)
| Deletes a title. More...
Result | AM_DeleteAppTitle (FS_MediaType mediatype, u64 titleID)
| Deletes a title, provided that it is not a system title. More...
Result | AM_DeleteTicket (u64 ticketId)
| Deletes a ticket. More...
Result | AM_DeletePendingTitle (FS_MediaType mediatype, u64 titleId)
| Deletes a pending title. More...
Result | AM_DeletePendingTitles (FS_MediaType mediatype, u32 flags)
| Deletes pending titles. More...
Result | AM_DeleteAllPendingTitles (FS_MediaType mediatype)
| Deletes all pending titles. More...
Result | AM_InstallNativeFirm (void)
| Installs the current NATIVE_FIRM title to NAND (firm0:/ & firm1:/)
Result | AM_InstallFirm (u64 titleID)
| Installs a NATIVE_FIRM title to NAND. More...
Result | AM_GetTitleProductCode (FS_MediaType mediatype, u64 titleId, char *productCode)
| Gets the product code of a title. More...
Result | AM_GetTitleExtDataId (u64 *extDataId, FS_MediaType mediatype, u64 titleId)
| Gets the ext data ID of a title. More...
Result | AM_GetCiaFileInfo (FS_MediaType mediatype, AM_TitleEntry *titleEntry, Handle fileHandle)
| Gets an AM_TitleEntry instance for a CIA file. More...
Result | AM_GetCiaIcon (void *icon, Handle fileHandle)
| Gets the SMDH icon data of a CIA file. More...
Result | AM_GetCiaDependencies (u64 *dependencies, Handle fileHandle)
| Gets the title ID dependency list of a CIA file. More...
Result | AM_GetCiaMetaOffset (u64 *metaOffset, Handle fileHandle)
| Gets the meta section offset of a CIA file. More...
Result | AM_GetCiaCoreVersion (u32 *coreVersion, Handle fileHandle)
| Gets the core version of a CIA file. More...
Result | AM_GetCiaRequiredSpace (u64 *requiredSpace, FS_MediaType mediaType, Handle fileHandle)
| Gets the free space, in bytes, required to install a CIA file. More...
Result | AM_GetCiaMetaSection (void *meta, u32 size, Handle fileHandle)
| Gets the full meta section of a CIA file. More...
Result | AM_InitializeExternalTitleDatabase (bool overwrite)
| Initializes the external (SD) title database. More...
Result | AM_QueryAvailableExternalTitleDatabase (bool *available)
| Queries whether the external title database is available. More...
Result | AM_InstallTicketBegin (Handle *ticketHandle)
| Begins installing a ticket. More...
Result | AM_InstallTicketAbort (Handle ticketHandle)
| Aborts installing a ticket. More...
Result | AM_InstallTicketFinish (Handle ticketHandle)
| Finishes installing a ticket. More...
Result | AM_InstallTitleBegin (FS_MediaType mediaType, u64 titleId, bool unk)
| Begins installing a title. More...
Result | AM_InstallTitleStop (void)
| Stops installing a title, generally to be resumed later.
Result | AM_InstallTitleResume (FS_MediaType mediaType, u64 titleId)
| Resumes installing a title. More...
Result | AM_InstallTitleAbort (void)
| Aborts installing a title.
Result | AM_InstallTitleFinish (void)
| Finishes installing a title.
Result | AM_CommitImportTitles (FS_MediaType mediaType, u32 titleCount, bool temp, const u64 *titleIds)
| Commits installed titles. More...
Result | AM_InstallTmdBegin (Handle *tmdHandle)
| Begins installing a TMD. More...
Result | AM_InstallTmdAbort (Handle tmdHandle)
| Aborts installing a TMD. More...
Result | AM_InstallTmdFinish (Handle tmdHandle, bool unk)
| Finishes installing a TMD. More...
Result | AM_CreateImportContentContexts (u32 contentCount, u16 *contentIndices)
| Prepares to import title contents. More...
Result | AM_InstallContentBegin (Handle *contentHandle, u16 index)
| Begins installing title content. More...
Result | AM_InstallContentStop (Handle contentHandle)
| Stops installing title content, generally to be resumed later. More...
Result | AM_InstallContentResume (Handle *contentHandle, u64 *resumeOffset, u16 index)
| Resumes installing title content. More...
Result | AM_InstallContentCancel (Handle contentHandle)
| Cancels installing title content. More...
Result | AM_InstallContentFinish (Handle contentHandle)
| Finishes installing title content. More...
Result | AM_ImportCertificates (u32 cert1Size, void *cert1, u32 cert2Size, void *cert2, u32 cert3Size, void *cert3, u32 cert4Size, void *cert4)
| Imports up to four certificates into the ticket certificate chain. More...
Result | AM_ImportCertificate (u32 certSize, void *cert)
| Imports a certificate into the ticket certificate chain. More...
Result | AM_CommitImportTitlesAndUpdateFirmwareAuto (FS_MediaType mediaType, u32 titleCount, bool temp, u64 *titleIds)
| Commits installed titles, and updates FIRM if necessary. More...
Result | AM_DeleteAllDemoLaunchInfos (void)
| Resets play count of all installed demos by deleting their launch info.
Result | AM_DeleteAllTemporaryTitles (void)
| Deletes temporary titles.
Result | AM_DeleteAllExpiredTitles (FS_MediaType mediatype)
| Deletes all expired titles. More...
Result | AM_DeleteAllTwlTitles (void)
| Deletes all TWL titles.
Result | AMAPP_GetDLCContentInfoCount (u32 *count, FS_MediaType mediatype, u64 titleID)
| Gets the number of content index installed under the specified DLC title. More...
Result | AMAPP_ListDLCContentInfos (u32 *contentInfoRead, FS_MediaType mediatype, u64 titleID, u32 contentInfoCount, u32 offset, AM_ContentInfo *contentInfos)
| Gets content infos installed under the specified DLC title. More...

## Detailed Description

AM (Application Manager) service.

## Enumeration Type Documentation

## anonymous enum

anonymous enum

Pending title status mask values.

Enumerator
AM_STATUS_MASK_INSTALLING | Titles currently installing.
AM_STATUS_MASK_AWAITING_FINALIZATION | Titles awaiting finalization.

## anonymous enum

anonymous enum

Pending title deletion flags.

Enumerator
AM_DELETE_PENDING_NON_SYSTEM | Non-system titles.
AM_DELETE_PENDING_SYSTEM | System titles.

## AM_ContentInfoFlags

enum AM_ContentInfoFlags

Title ContentInfo flags.

Enumerator
AM_CONTENT_DOWNLOADED | ?
AM_CONTENT_OWNED | ?

## AM_InstallStatus

enum AM_InstallStatus

Pending title status values.

Enumerator
AM_STATUS_ABORTED | Install aborted.
AM_STATUS_SAVED | Title saved, but not installed.
AM_STATUS_INSTALL_IN_PROGRESS | Install in progress.
AM_STATUS_AWAITING_FINALIZATION | Awaiting finalization.

## Function Documentation

## AM_CancelCIAInstall()

Result AM_CancelCIAInstall | ( | Handle | ciaHandle | ) |

Aborts the CIA install process.

Parameters

  ciaHandle | CIA handle to cancel.

## AM_CommitImportPrograms()

Result AM_CommitImportPrograms | ( | FS_MediaType | mediaType,
|  | u32 | titleCount,
|  | bool | temp,
|  | const u64 * | titleIds
| ) |  |

Commits installed CIAs.

Parameters

  mediaType | Location of the titles to finalize.
  titleCount | Number of titles to finalize.
  temp | Whether the titles being finalized are in the temporary database.
  titleIds | Title IDs to finalize.

## AM_CommitImportTitles()

Result AM_CommitImportTitles | ( | FS_MediaType | mediaType,
|  | u32 | titleCount,
|  | bool | temp,
|  | const u64 * | titleIds
| ) |  |

Commits installed titles.

Parameters

  mediaType | Location of the titles to finalize.
  titleCount | Number of titles to finalize.
  temp | Whether the titles being finalized are in the temporary database.
  titleIds | Title IDs to finalize.

## AM_CommitImportTitlesAndUpdateFirmwareAuto()

Result AM_CommitImportTitlesAndUpdateFirmwareAuto | ( | FS_MediaType | mediaType,
|  | u32 | titleCount,
|  | bool | temp,
|  | u64 * | titleIds
| ) |  |

Commits installed titles, and updates FIRM if necessary.

Parameters

  mediaType | Location of the titles to finalize.
  titleCount | Number of titles to finalize.
  temp | Whether the titles being finalized are in the temporary database.
  titleIds | Title IDs to finalize.

## AM_CreateImportContentContexts()

Result AM_CreateImportContentContexts | ( | u32 | contentCount,
|  | u16 * | contentIndices
| ) |  |

Prepares to import title contents.

Parameters

  contentCount | Number of contents to be imported.
  contentIndices | Indices of the contents to be imported.

## AM_DeleteAllExpiredTitles()

Result AM_DeleteAllExpiredTitles | ( | FS_MediaType | mediatype | ) |

Deletes all expired titles.

Parameters

  mediatype | Media type to delete from.

## AM_DeleteAllPendingTitles()

Result AM_DeleteAllPendingTitles | ( | FS_MediaType | mediatype | ) |

Deletes all pending titles.

Parameters

  mediatype | Media type to delete from.

## AM_DeleteAppTitle()

Result AM_DeleteAppTitle | ( | FS_MediaType | mediatype,
|  | u64 | titleID
| ) |  |

Deletes a title, provided that it is not a system title.

Parameters

  mediatype | Media type to delete from.
  titleID | ID of the title to delete.

## AM_DeletePendingTitle()

Result AM_DeletePendingTitle | ( | FS_MediaType | mediatype,
|  | u64 | titleId
| ) |  |

Deletes a pending title.

Parameters

  mediatype | Media type to delete from.
  titleId | ID of the pending title to delete.

## AM_DeletePendingTitles()

Result AM_DeletePendingTitles | ( | FS_MediaType | mediatype,
|  | u32 | flags
| ) |  |

Deletes pending titles.

Parameters

  mediatype | Media type to delete from.
  flags | Flags used to select pending titles.

## AM_DeleteTicket()

Result AM_DeleteTicket | ( | u64 | ticketId | ) |

Deletes a ticket.

Parameters

  titleID | ID of the ticket to delete.

## AM_DeleteTitle()

Result AM_DeleteTitle | ( | FS_MediaType | mediatype,
|  | u64 | titleID
| ) |  |

Deletes a title.

Parameters

  mediatype | Media type to delete from.
  titleID | ID of the title to delete.

## AM_ExportTwlBackup()

Result AM_ExportTwlBackup | ( | u64 | titleID,
|  | u8 | operation,
|  | void * | workbuf,
|  | u32 | workbuf_size,
|  | const char * | filepath
| ) |  |

Exports DSiWare to the specified filepath.

Parameters

  titleID | TWL titleID.
  operation | DSiWare operation type.
  workbuf | Work buffer.
  workbuf_size | Work buffer size, must be >=0x20000.
  filepath | UTF-8 filepath(converted to UTF-16 internally).

## AM_FinishCiaInstall()

Result AM_FinishCiaInstall | ( | Handle | ciaHandle | ) |

Finalizes the CIA install process.

Parameters

  ciaHandle | CIA handle to finalize.

## AM_FinishCiaInstallWithoutCommit()

Result AM_FinishCiaInstallWithoutCommit | ( | Handle | ciaHandle | ) |

Finalizes the CIA install process without committing the title to title.db or tmp*.db.

Parameters

  ciaHandle | CIA handle to finalize.

## AM_GetCiaCoreVersion()

Result AM_GetCiaCoreVersion | ( | u32 * | coreVersion,
|  | Handle | fileHandle
| ) |  |

Gets the core version of a CIA file.

Parameters

  [out] | coreVersion | Pointer to output the core version to.
  | fileHandle | Handle of the CIA file.

## AM_GetCiaDependencies()

Result AM_GetCiaDependencies | ( | u64 * | dependencies,
|  | Handle | fileHandle
| ) |  |

Gets the title ID dependency list of a CIA file.

Parameters

  dependencies | Buffer to store dependency title IDs in. Must be of size 0x300 bytes.
  fileHandle | Handle of the CIA file.

## AM_GetCiaFileInfo()

Result AM_GetCiaFileInfo | ( | FS_MediaType | mediatype,
|  | AM_TitleEntry * | titleEntry,
|  | Handle | fileHandle
| ) |  |

Gets an AM_TitleEntry instance for a CIA file.

Parameters

  | mediatype | Media type that this CIA would be installed to.
  [out] | titleEntry | Pointer to write the AM_TitleEntry instance to.
  | fileHandle | Handle of the CIA file.

## AM_GetCiaIcon()

Result AM_GetCiaIcon | ( | void * | icon,
|  | Handle | fileHandle
| ) |  |

Gets the SMDH icon data of a CIA file.

Parameters

  icon | Buffer to store the icon data in. Must be of size 0x36C0 bytes.
  fileHandle | Handle of the CIA file.

## AM_GetCiaMetaOffset()

Result AM_GetCiaMetaOffset | ( | u64 * | metaOffset,
|  | Handle | fileHandle
| ) |  |

Gets the meta section offset of a CIA file.

Parameters

  [out] | metaOffset | Pointer to output the meta section offset to.
  | fileHandle | Handle of the CIA file.

## AM_GetCiaMetaSection()

Result AM_GetCiaMetaSection | ( | void * | meta,
|  | u32 | size,
|  | Handle | fileHandle
| ) |  |

Gets the full meta section of a CIA file.

Parameters

  meta | Buffer to store the meta section in.
  size | Size of the buffer. Must be greater than or equal to the actual section data's size.
  fileHandle | Handle of the CIA file.

## AM_GetCiaRequiredSpace()

Result AM_GetCiaRequiredSpace | ( | u64 * | requiredSpace,
|  | FS_MediaType | mediaType,
|  | Handle | fileHandle
| ) |  |

Gets the free space, in bytes, required to install a CIA file.

Parameters

  [out] | requiredSpace | Pointer to output the required free space to.
  | mediaType | Media type to check free space needed to install to.
  | fileHandle | Handle of the CIA file.

## AM_GetDeviceId()

Result AM_GetDeviceId | ( | u32 * | deviceID | ) |

Gets a 32-bit device-specific ID.

Parameters

  deviceID | Pointer to write the device ID to.

## AM_GetPendingTitleCount()

Result AM_GetPendingTitleCount | ( | u32 * | count,
|  | FS_MediaType | mediatype,
|  | u32 | statusMask
| ) |  |

Gets the number of pending titles on this system.

Parameters

  [out] | count | Pointer to output the pending title count to.
  | mediatype | Media type of pending titles to count.
  | statusMask | Bit mask of status values to include.

## AM_GetPendingTitleInfo()

Result AM_GetPendingTitleInfo | ( | u32 | titleCount,
|  | FS_MediaType | mediatype,
|  | u64 * | titleIds,
|  | AM_PendingTitleEntry * | titleInfo
| ) |  |

Gets information about pending titles on this system.

Parameters

  titleCount | Number of pending titles to read.
  mediatype | Media type of pending titles to get information on.
  titleIds | IDs of the titles to get information about.
  titleInfo | Buffer to output the retrieved pending title info to.

## AM_GetPendingTitleList()

Result AM_GetPendingTitleList | ( | u32 * | titlesRead,
|  | u32 | titleCount,
|  | FS_MediaType | mediatype,
|  | u32 | statusMask,
|  | u64 * | titleIds
| ) |  |

Gets a list of pending titles on this system.

Parameters

  [out] | titlesRead | Pointer to output the number of read pending titles to.
  | titleCount | Number of pending titles to read.
  | mediatype | Media type of pending titles to list.
  | statusMask | Bit mask of status values to include.
  | titleIds | Buffer to output the retrieved pending title IDs to.

## AM_GetTicketCount()

Result AM_GetTicketCount | ( | u32 * | count | ) |

Gets the number of tickets installed on the system.

Parameters

  [out] | count | Pointer to output the ticket count to.

## AM_GetTicketList()

Result AM_GetTicketList | ( | u32 * | ticketsRead,
|  | u32 | ticketCount,
|  | u32 | skip,
|  | u64 * | ticketIds
| ) |  |

Gets a list of tickets installed on the system.

Parameters

  [out] | ticketsRead | Pointer to output the number of read tickets to.
  | ticketCount | Number of tickets to read.
  | skip | Number of tickets to skip.
  | ticketIds | Buffer to output the retrieved ticket IDs to.

## AM_GetTitleCount()

Result AM_GetTitleCount | ( | FS_MediaType | mediatype,
|  | u32 * | count
| ) |  |

Gets the number of titles for a given media type.

Parameters

  | mediatype | Media type to get titles from.
  [out] | count | Pointer to write the title count to.

## AM_GetTitleExtDataId()

Result AM_GetTitleExtDataId | ( | u64 * | extDataId,
|  | FS_MediaType | mediatype,
|  | u64 | titleId
| ) |  |

Gets the ext data ID of a title.

Parameters

  [out] | extDataId | Pointer to output the ext data ID to.
  | mediatype | Media type of the title.
  | titleID | ID of the title.

## AM_GetTitleInfo()

Result AM_GetTitleInfo | ( | FS_MediaType | mediatype,
|  | u32 | titleCount,
|  | u64 * | titleIds,
|  | AM_TitleEntry * | titleInfo
| ) |  |

Gets a list of details about installed titles.

Parameters

  mediatype | Media type to get titles from.
  titleCount | Number of titles to list.
  titleIds | List of title IDs to retrieve details for.
  titleInfo | Buffer to write AM_TitleEntry's to.

## AM_GetTitleList()

Result AM_GetTitleList | ( | u32 * | titlesRead,
|  | FS_MediaType | mediatype,
|  | u32 | titleCount,
|  | u64 * | titleIds
| ) |  |

Gets a list of title IDs present in a mediatype.

Parameters

  [out] | titlesRead | Pointer to output the number of read titles to.
  | mediatype | Media type to get titles from.
  | titleCount | Number of title IDs to get.
  | titleIds | Buffer to output the retrieved title IDs to.

## AM_GetTitleProductCode()

Result AM_GetTitleProductCode | ( | FS_MediaType | mediatype,
|  | u64 | titleId,
|  | char * | productCode
| ) |  |

Gets the product code of a title.

Parameters

  | mediatype | Media type of the title.
  | titleID | ID of the title.
  [out] | productCode | Pointer to output the product code to. (length = 16)

## AM_GetTWLPartitionInfo()

Result AM_GetTWLPartitionInfo | ( | AM_TWLPartitionInfo * | info | ) |

Retrieves information about the NAND TWL partition.

Parameters

  [out] | info | Pointer to output the TWL partition info to.

## AM_ImportCertificate()

Result AM_ImportCertificate | ( | u32 | certSize,
|  | void * | cert
| ) |  |

Imports a certificate into the ticket certificate chain.

Parameters

  certSize | Size of the certificate.
  cert | Data of the certificate.

## AM_ImportCertificates()

Result AM_ImportCertificates | ( | u32 | cert1Size,
|  | void * | cert1,
|  | u32 | cert2Size,
|  | void * | cert2,
|  | u32 | cert3Size,
|  | void * | cert3,
|  | u32 | cert4Size,
|  | void * | cert4
| ) |  |

Imports up to four certificates into the ticket certificate chain.

Parameters

  cert1Size | Size of the first certificate.
  cert1 | Data of the first certificate.
  cert2Size | Size of the second certificate.
  cert2 | Data of the second certificate.
  cert3Size | Size of the third certificate.
  cert3 | Data of the third certificate.
  cert4Size | Size of the fourth certificate.
  cert4 | Data of the fourth certificate.

## AM_ImportTwlBackup()

Result AM_ImportTwlBackup | ( | Handle | filehandle,
|  | u8 | operation,
|  | void * | buffer,
|  | u32 | size
| ) |  |

Imports DSiWare from the specified file.

Parameters

  filehandle | FSUSER file handle.
  operation | DSiWare operation type.
  buffer | Work buffer.
  size | Buffer size, must be >=0x20000.

## AM_InitializeExternalTitleDatabase()

Result AM_InitializeExternalTitleDatabase | ( | bool | overwrite | ) |

Initializes the external (SD) title database.

Parameters

  overwrite | Overwrites the database if it already exists.

## AM_InstallContentBegin()

Result AM_InstallContentBegin | ( | Handle * | contentHandle,
|  | u16 | index
| ) |  |

Begins installing title content.

Parameters

  [out] | contentHandle | Pointer to output a handle to write content data to.
  | index | Index of the content to install.

## AM_InstallContentCancel()

Result AM_InstallContentCancel | ( | Handle | contentHandle | ) |

Cancels installing title content.

Parameters

  contentHandle | Handle of the installation to finalize.

## AM_InstallContentFinish()

Result AM_InstallContentFinish | ( | Handle | contentHandle | ) |

Finishes installing title content.

Parameters

  contentHandle | Handle of the installation to finalize.

## AM_InstallContentResume()

Result AM_InstallContentResume | ( | Handle * | contentHandle,
|  | u64 * | resumeOffset,
|  | u16 | index
| ) |  |

Resumes installing title content.

Parameters

  [out] | contentHandle | Pointer to output a handle to write content data to.
  [out] | resumeOffset | Pointer to write the offset to resume content installation at to.
  | index | Index of the content to install.

## AM_InstallContentStop()

Result AM_InstallContentStop | ( | Handle | contentHandle | ) |

Stops installing title content, generally to be resumed later.

Parameters

  contentHandle | Handle of the installation to abort.

## AM_InstallFirm()

Result AM_InstallFirm | ( | u64 | titleID | ) |

Installs a NATIVE_FIRM title to NAND.

Accepts 0004013800000002 or 0004013820000002 (N3DS).

Parameters

  titleID | Title ID of the NATIVE_FIRM to install.

## AM_InstallTicketAbort()

Result AM_InstallTicketAbort | ( | Handle | ticketHandle | ) |

Aborts installing a ticket.

Parameters

  ticketHandle | Handle of the installation to abort.

## AM_InstallTicketBegin()

Result AM_InstallTicketBegin | ( | Handle * | ticketHandle | ) |

Begins installing a ticket.

Parameters

  [out] | ticketHandle | Pointer to output a handle to write ticket data to.

## AM_InstallTicketFinish()

Result AM_InstallTicketFinish | ( | Handle | ticketHandle | ) |

Finishes installing a ticket.

Parameters

  ticketHandle | Handle of the installation to finalize.

## AM_InstallTitleBegin()

Result AM_InstallTitleBegin | ( | FS_MediaType | mediaType,
|  | u64 | titleId,
|  | bool | unk
| ) |  |

Begins installing a title.

Parameters

  mediaType | Destination to install to.
  titleId | ID of the title to install.
  unk | Unknown. (usually false)

## AM_InstallTitleResume()

Result AM_InstallTitleResume | ( | FS_MediaType | mediaType,
|  | u64 | titleId
| ) |  |

Resumes installing a title.

Parameters

  mediaType | Destination to install to.
  titleId | ID of the title to install.

## AM_InstallTmdAbort()

Result AM_InstallTmdAbort | ( | Handle | tmdHandle | ) |

Aborts installing a TMD.

Parameters

  tmdHandle | Handle of the installation to abort.

## AM_InstallTmdBegin()

Result AM_InstallTmdBegin | ( | Handle * | tmdHandle | ) |

Begins installing a TMD.

Parameters

  [out] | tmdHandle | Pointer to output a handle to write TMD data to.

## AM_InstallTmdFinish()

Result AM_InstallTmdFinish | ( | Handle | tmdHandle,
|  | bool | unk
| ) |  |

Finishes installing a TMD.

Parameters

  tmdHandle | Handle of the installation to finalize.
  unk | Unknown. (usually true)

## AM_QueryAvailableExternalTitleDatabase()

Result AM_QueryAvailableExternalTitleDatabase | ( | bool * | available | ) |

Queries whether the external title database is available.

Parameters

  [out] | available | Pointer to output the availability status to.

## AM_ReadTwlBackupInfo()

Result AM_ReadTwlBackupInfo | ( | Handle | filehandle,
|  | void * | outinfo,
|  | u32 | outinfo_size,
|  | void * | workbuf,
|  | u32 | workbuf_size,
|  | void * | banner,
|  | u32 | banner_size
| ) |  |

Reads info from the specified DSiWare export file.

This can only be used with DSiWare exported with certain operation value(s).

Parameters

  filehandle | FSUSER file handle.
  outinfo | Output info buffer.
  outinfo_size | Output info buffer size.
  workbuf | Work buffer.
  workbuf_size | Work buffer size.
  banner | Output banner buffer.
  banner_size | Output banner buffer size.

## AM_StartCiaInstall()

Result AM_StartCiaInstall | ( | FS_MediaType | mediatype,
|  | Handle * | ciaHandle
| ) |  |

Initializes the CIA install process, returning a handle to write CIA data to.

Parameters

  | mediatype | Media type to install the CIA to.
  [out] | ciaHandle | Pointer to write the CIA handle to.

## AM_StartDlpChildCiaInstall()

Result AM_StartDlpChildCiaInstall | ( | Handle * | ciaHandle | ) |

Initializes the CIA install process for Download Play CIAs, returning a handle to write CIA data to.

Parameters

  [out] | ciaHandle | Pointer to write the CIA handle to.

## AMAPP_GetDLCContentInfoCount()

Result AMAPP_GetDLCContentInfoCount | ( | u32 * | count,
|  | FS_MediaType | mediatype,
|  | u64 | titleID
| ) |  |

Gets the number of content index installed under the specified DLC title.

Parameters

  [out] | count | Pointer to output the number of content indices to.
  | mediatype | Media type of the title.
  | titleID | Title ID to retrieve the count for (high-id is 0x0004008C).

## AMAPP_ListDLCContentInfos()

Result AMAPP_ListDLCContentInfos | ( | u32 * | contentInfoRead,
|  | FS_MediaType | mediatype,
|  | u64 | titleID,
|  | u32 | contentInfoCount,
|  | u32 | offset,
|  | AM_ContentInfo * | contentInfos
| ) |  |

Gets content infos installed under the specified DLC title.

Parameters

  [out] | contentInfoRead | Pointer to output the number of content infos read to.
  | mediatype | Media type of the title.
  | titleID | Title ID to retrieve the content infos for (high-id is 0x0004008C).
  | contentInfoCount | Number of content infos to retrieve.
  | offset | Offset from the first content index the count starts at.
  [out] | contentInfos | Pointer to output the content infos read to.