fspxi.h File Reference

Service interface for PxiFS services. More...

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

Go to the source code of this file.

## Typedefs

typedef u64 | FSPXI_Archive
typedef u64 | FSPXI_File
typedef u64 | FSPXI_Directory

## Functions

Result | FSPXI_OpenFile (Handle serviceHandle, FSPXI_File *out, FSPXI_Archive archive, FS_Path path, u32 flags, u32 attributes)
| Opens a file. More...
Result | FSPXI_DeleteFile (Handle serviceHandle, FSPXI_Archive archive, FS_Path path)
| Deletes a file. More...
Result | FSPXI_RenameFile (Handle serviceHandle, FSPXI_Archive srcArchive, FS_Path srcPath, FSPXI_Archive dstArchive, FS_Path dstPath)
| Renames a file. More...
Result | FSPXI_DeleteDirectory (Handle serviceHandle, FSPXI_Archive archive, FS_Path path)
| Deletes a directory. More...
Result | FSPXI_CreateFile (Handle serviceHandle, FSPXI_Archive archive, FS_Path path, u32 attributes, u64 fileSize)
| Creates a file. More...
Result | FSPXI_CreateDirectory (Handle serviceHandle, FSPXI_Archive archive, FS_Path path, u32 attributes)
| Creates a directory. More...
Result | FSPXI_RenameDirectory (Handle serviceHandle, FSPXI_Archive srcArchive, FS_Path srcPath, FSPXI_Archive dstArchive, FS_Path dstPath)
| Renames a directory. More...
Result | FSPXI_OpenDirectory (Handle serviceHandle, FSPXI_Directory *out, FSPXI_Archive archive, FS_Path path)
| Opens a directory. More...
Result | FSPXI_ReadFile (Handle serviceHandle, FSPXI_File file, u32 *bytesRead, u64 offset, void *buffer, u32 size)
| Reads from a file. More...
Result | FSPXI_CalculateFileHashSHA256 (Handle serviceHandle, FSPXI_File file, void *buffer, u32 size)
| Calculate SHA256 of a file. More...
Result | FSPXI_WriteFile (Handle serviceHandle, FSPXI_File file, u32 *bytesWritten, u64 offset, const void *buffer, u32 size, u32 flags)
| Writes to a file. More...
Result | FSPXI_CalcSavegameMAC (Handle serviceHandle, FSPXI_File file, const void *inBuffer, u32 inSize, void *outBuffer, u32 outSize)
| Calculates the MAC used in a DISA/DIFF header? More...
Result | FSPXI_GetFileSize (Handle serviceHandle, FSPXI_File file, u64 *size)
| Get size of a file. More...
Result | FSPXI_SetFileSize (Handle serviceHandle, FSPXI_File file, u64 size)
| Set size of a file. More...
Result | FSPXI_CloseFile (Handle serviceHandle, FSPXI_File file)
| Close a file. More...
Result | FSPXI_ReadDirectory (Handle serviceHandle, FSPXI_Directory directory, u32 *entriesRead, u32 entryCount, FS_DirectoryEntry *entries)
| Reads one or more directory entries. More...
Result | FSPXI_CloseDirectory (Handle serviceHandle, FSPXI_Directory directory)
| Close a directory. More...
Result | FSPXI_OpenArchive (Handle serviceHandle, FSPXI_Archive *archive, FS_ArchiveID archiveID, FS_Path path)
| Opens an archive. More...
Result | FSPXI_HasFile (Handle serviceHandle, FSPXI_Archive archive, bool *out, FS_Path path)
| Checks if the archive contains a file at path. More...
Result | FSPXI_HasDirectory (Handle serviceHandle, FSPXI_Archive archive, bool *out, FS_Path path)
| Checks if the archive contains a directory at path. More...
Result | FSPXI_CommitSaveData (Handle serviceHandle, FSPXI_Archive archive, u32 id)
| Commits an archive's save data. More...
Result | FSPXI_CloseArchive (Handle serviceHandle, FSPXI_Archive archive)
| Close an archive. More...
Result | FSPXI_Unknown0x17 (Handle serviceHandle, FSPXI_Archive archive, bool *out)
| Unknown 0x17. More...
Result | FSPXI_GetCardType (Handle serviceHandle, FS_CardType *out)
| Gets the inserted card type. More...
Result | FSPXI_GetSdmcArchiveResource (Handle serviceHandle, FS_ArchiveResource *out)
| Gets the SDMC archive resource information. More...
Result | FSPXI_GetNandArchiveResource (Handle serviceHandle, FS_ArchiveResource *out)
| Gets the NAND archive resource information. More...
Result | FSPXI_GetSdmcFatFsError (Handle serviceHandle, u32 *out)
| Gets the error code from the SDMC FatFS driver. More...
Result | FSPXI_IsSdmcDetected (Handle serviceHandle, bool *out)
| Gets whether PXIFS0 detects the SD. More...
Result | FSPXI_IsSdmcWritable (Handle serviceHandle, bool *out)
| Gets whether PXIFS0 can write to the SD. More...
Result | FSPXI_GetSdmcCid (Handle serviceHandle, void *out, u32 size)
| Gets the SDMC CID. More...
Result | FSPXI_GetNandCid (Handle serviceHandle, void *out, u32 size)
| Gets the NAND CID. More...
Result | FSPXI_GetSdmcSpeedInfo (Handle serviceHandle, FS_SdMmcSpeedInfo *out)
| Gets the SDMC speed info. More...
Result | FSPXI_GetNandSpeedInfo (Handle serviceHandle, FS_SdMmcSpeedInfo *out)
| Gets the NAND speed info. More...
Result | FSPXI_GetSdmcLog (Handle serviceHandle, void *out, u32 size)
| Gets the SDMC log. More...
Result | FSPXI_GetNandLog (Handle serviceHandle, void *out, u32 size)
| Gets the NAND log. More...
Result | FSPXI_ClearSdmcLog (Handle serviceHandle)
| Clears the SDMC log.
Result | FSPXI_ClearNandLog (Handle serviceHandle)
| Clears the NAND log.
Result | FSPXI_CardSlotIsInserted (Handle serviceHandle, bool *inserted)
| Gets whether a card is inserted. More...
Result | FSPXI_CardSlotPowerOn (Handle serviceHandle, bool *status)
| Powers on the card slot. More...
Result | FSPXI_CardSlotPowerOff (Handle serviceHandle, bool *status)
| Powers off the card slot. More...
Result | FSPXI_CardSlotGetCardIFPowerStatus (Handle serviceHandle, bool *status)
| Gets the card's power status. More...
Result | FSPXI_CardNorDirectCommand (Handle serviceHandle, u8 commandId)
| Executes a CARDNOR direct command. More...
Result | FSPXI_CardNorDirectCommandWithAddress (Handle serviceHandle, u8 commandId, u32 address)
| Executes a CARDNOR direct command with an address. More...
Result | FSPXI_CardNorDirectRead (Handle serviceHandle, u8 commandId, u32 size, void *output)
| Executes a CARDNOR direct read. More...
Result | FSPXI_CardNorDirectReadWithAddress (Handle serviceHandle, u8 commandId, u32 address, u32 size, void *output)
| Executes a CARDNOR direct read with an address. More...
Result | FSPXI_CardNorDirectWrite (Handle serviceHandle, u8 commandId, u32 size, const void *input)
| Executes a CARDNOR direct write. More...
Result | FSPXI_CardNorDirectWriteWithAddress (Handle serviceHandle, u8 commandId, u32 address, u32 size, const void *input)
| Executes a CARDNOR direct write with an address. More...
Result | FSPXI_CardNorDirectRead_4xIO (Handle serviceHandle, u8 commandId, u32 address, u32 size, void *output)
| Executes a CARDNOR 4xIO direct read. More...
Result | FSPXI_CardNorDirectCpuWriteWithoutVerify (Handle serviceHandle, u32 address, u32 size, const void *input)
| Executes a CARDNOR direct CPU write without verify. More...
Result | FSPXI_CardNorDirectSectorEraseWithoutVerify (Handle serviceHandle, u32 address)
| Executes a CARDNOR direct sector erase without verify. More...
Result | FSPXI_GetProductInfo (Handle serviceHandle, FS_ProductInfo *info, FSPXI_Archive archive)
| Gets an NCCH's product info. More...
Result | FSPXI_SetCardSpiBaudrate (Handle serviceHandle, FS_CardSpiBaudRate baudRate)
| Sets the CARDSPI baud rate. More...
Result | FSPXI_SetCardSpiBusMode (Handle serviceHandle, FS_CardSpiBusMode busMode)
| Sets the CARDSPI bus mode. More...
Result | FSPXI_SendInitializeInfoTo9 (Handle serviceHandle, u8 unk)
| Sends initialization info to ARM9. More...
Result | FSPXI_CreateExtSaveData (Handle serviceHandle, FS_ExtSaveDataInfo info)
| Creates ext save data. More...
Result | FSPXI_DeleteExtSaveData (Handle serviceHandle, FS_ExtSaveDataInfo info)
| Deletes ext save data. More...
Result | FSPXI_EnumerateExtSaveData (Handle serviceHandle, u32 *idsWritten, u32 idsSize, FS_MediaType mediaType, u32 idSize, bool shared, u8 *ids)
| Enumerates ext save data. More...
Result | FSPXI_GetSpecialContentIndex (Handle serviceHandle, u16 *index, FS_MediaType mediaType, u64 programId, FS_SpecialContentType type)
| Gets a special content's index. More...
Result | FSPXI_GetLegacyRomHeader (Handle serviceHandle, FS_MediaType mediaType, u64 programId, void *header)
| Gets the legacy ROM header of a program. More...
Result | FSPXI_GetLegacyBannerData (Handle serviceHandle, FS_MediaType mediaType, u64 programId, void *banner, u8 unk)
| Gets the legacy banner data of a program. More...
Result | FSPXI_FormatCardNorDevice (Handle serviceHandle, u32 unk)
| Formats the CARDNOR device. More...
Result | FSPXI_DeleteSdmcRoot (Handle serviceHandle)
| Deletes the 3DS SDMC root.
Result | FSPXI_DeleteAllExtSaveDataOnNand (Handle serviceHandle)
| Deletes all ext save data on the NAND.
Result | FSPXI_InitializeCtrFilesystem (Handle serviceHandle)
| Initializes the CTR file system.
Result | FSPXI_CreateSeed (Handle serviceHandle)
| Creates the FS seed.
Result | FSPXI_GetSdmcCtrRootPath (Handle serviceHandle, u16 *out, u32 length)
| Gets the CTR SDMC root path. More...
Result | FSPXI_GetArchiveResource (Handle serviceHandle, FS_ArchiveResource *archiveResource, FS_SystemMediaType mediaType)
| Gets an archive's resource information. More...
Result | FSPXI_ExportIntegrityVerificationSeed (Handle serviceHandle, FS_IntegrityVerificationSeed *seed)
| Exports the integrity verification seed. More...
Result | FSPXI_ImportIntegrityVerificationSeed (Handle serviceHandle, const FS_IntegrityVerificationSeed *seed)
| Imports an integrity verification seed. More...
Result | FSPXI_GetLegacySubBannerData (Handle serviceHandle, u32 bannerSize, FS_MediaType mediaType, u64 programId, void *banner)
| Gets the legacy sub banner data of a program. More...
Result | FSPXI_GenerateRandomBytes (Handle serviceHandle, void *buffer, u32 size)
| Generates random bytes. More...
Result | FSPXI_GetFileLastModified (Handle serviceHandle, FSPXI_Archive archive, u64 *out, const u16 *path, u32 size)
| Gets the last modified time of a file in an archive. More...
Result | FSPXI_ReadSpecialFile (Handle serviceHandle, u32 *bytesRead, u64 fileOffset, u32 size, void *data)
| Reads from a special file. More...
Result | FSPXI_GetSpecialFileSize (Handle serviceHandle, u64 *fileSize)
| Gets the size of a special file. More...
Result | FSPXI_StartDeviceMoveAsSource (Handle serviceHandle, FS_DeviceMoveContext *context)
| Initiates a device move as the source device. More...
Result | FSPXI_StartDeviceMoveAsDestination (Handle serviceHandle, FS_DeviceMoveContext context, bool clear)
| Initiates a device move as the destination device. More...
Result | FSPXI_ReadFileSHA256 (Handle serviceHandle, FSPXI_File file, u32 *bytesRead, u64 offset, void *readBuffer, u32 readBufferSize, void *hashtable, u32 hashtableSize, u32 unk)
| Reads data and stores SHA256 hashes of blocks. More...
Result | FSPXI_WriteFileSHA256 (Handle serviceHandle, FSPXI_File file, u32 *bytesWritten, u64 offset, const void *writeBuffer, u32 writeBufferSize, void *hashtable, u32 hashtableSize, u32 unk1, u32 unk2)
| Assumedly writes data and stores SHA256 hashes of blocks. More...
Result | FSPXI_SetCtrCardLatencyParameter (Handle serviceHandle, u64 latency)
| Configures CTRCARD latency emulation. More...
Result | FSPXI_SetPriority (Handle serviceHandle, u32 priority)
| Sets the file system priority. More...
Result | FSPXI_SwitchCleanupInvalidSaveData (Handle serviceHandle, bool enable)
| Toggles cleaning up invalid save data. More...
Result | FSPXI_EnumerateSystemSaveData (Handle serviceHandle, u32 *idsWritten, u32 idsSize, u32 *ids)
| Enumerates system save data. More...
Result | FSPXI_ReadNandReport (Handle serviceHandle, void *buffer, u32 size, u32 unk)
| Reads the NAND report. More...
Result | FSPXI_Unknown0x56 (Handle serviceHandle, u32 out[4], FS_Archive archive, FS_Path path)
| Unknown command 0x56. More...

## Detailed Description

Service interface for PxiFS services.

This is normally not accessible to userland apps. https://3dbrew.org/wiki/Filesystem_services_PXI

## Function Documentation

## FSPXI_CalcSavegameMAC()

Result FSPXI_CalcSavegameMAC | ( | Handle | serviceHandle,
|  | FSPXI_File | file,
|  | const void * | inBuffer,
|  | u32 | inSize,
|  | void * | outBuffer,
|  | u32 | outSize
| ) |  |

Calculates the MAC used in a DISA/DIFF header?

Parameters

  file | Unsure
  inBuffer | 0x100-byte DISA/DIFF input buffer.
  inSize | Size of inBuffer.
  outBuffer | Buffer to write MAC to.
  outSize | Size of outBuffer.

## FSPXI_CalculateFileHashSHA256()

Result FSPXI_CalculateFileHashSHA256 | ( | Handle | serviceHandle,
|  | FSPXI_File | file,
|  | void * | buffer,
|  | u32 | size
| ) |  |

Calculate SHA256 of a file.

Parameters

  file | File to calculate the hash of.
  buffer | Buffer to output the hash to.
  size | Size of the buffer.

## FSPXI_CardNorDirectCommand()

Result FSPXI_CardNorDirectCommand | ( | Handle | serviceHandle,
|  | u8 | commandId
| ) |  |

Executes a CARDNOR direct command.

Parameters

  commandId | ID of the command.

## FSPXI_CardNorDirectCommandWithAddress()

Result FSPXI_CardNorDirectCommandWithAddress | ( | Handle | serviceHandle,
|  | u8 | commandId,
|  | u32 | address
| ) |  |

Executes a CARDNOR direct command with an address.

Parameters

  commandId | ID of the command.
  address | Address to provide.

## FSPXI_CardNorDirectCpuWriteWithoutVerify()

Result FSPXI_CardNorDirectCpuWriteWithoutVerify | ( | Handle | serviceHandle,
|  | u32 | address,
|  | u32 | size,
|  | const void * | input
| ) |  |

Executes a CARDNOR direct CPU write without verify.

Parameters

  address | Address to provide.
  size | Size of the input buffer.
  output | Input buffer.

## FSPXI_CardNorDirectRead()

Result FSPXI_CardNorDirectRead | ( | Handle | serviceHandle,
|  | u8 | commandId,
|  | u32 | size,
|  | void * | output
| ) |  |

Executes a CARDNOR direct read.

Parameters

  commandId | ID of the command.
  size | Size of the output buffer.
  output | Output buffer.

## FSPXI_CardNorDirectRead_4xIO()

Result FSPXI_CardNorDirectRead_4xIO | ( | Handle | serviceHandle,
|  | u8 | commandId,
|  | u32 | address,
|  | u32 | size,
|  | void * | output
| ) |  |

Executes a CARDNOR 4xIO direct read.

Parameters

  commandId | ID of the command.
  address | Address to provide.
  size | Size of the output buffer.
  output | Output buffer.

## FSPXI_CardNorDirectReadWithAddress()

Result FSPXI_CardNorDirectReadWithAddress | ( | Handle | serviceHandle,
|  | u8 | commandId,
|  | u32 | address,
|  | u32 | size,
|  | void * | output
| ) |  |

Executes a CARDNOR direct read with an address.

Parameters

  commandId | ID of the command.
  address | Address to provide.
  size | Size of the output buffer.
  output | Output buffer.

## FSPXI_CardNorDirectSectorEraseWithoutVerify()

Result FSPXI_CardNorDirectSectorEraseWithoutVerify | ( | Handle | serviceHandle,
|  | u32 | address
| ) |  |

Executes a CARDNOR direct sector erase without verify.

Parameters

  address | Address to provide.

## FSPXI_CardNorDirectWrite()

Result FSPXI_CardNorDirectWrite | ( | Handle | serviceHandle,
|  | u8 | commandId,
|  | u32 | size,
|  | const void * | input
| ) |  |

Executes a CARDNOR direct write.

Parameters

  commandId | ID of the command.
  size | Size of the input buffer.
  output | Input buffer.

Remarks
  Stubbed in latest firmware, since ?.?.?

## FSPXI_CardNorDirectWriteWithAddress()

Result FSPXI_CardNorDirectWriteWithAddress | ( | Handle | serviceHandle,
|  | u8 | commandId,
|  | u32 | address,
|  | u32 | size,
|  | const void * | input
| ) |  |

Executes a CARDNOR direct write with an address.

Parameters

  commandId | ID of the command.
  address | Address to provide.
  size | Size of the input buffer.
  input | Input buffer.

## FSPXI_CardSlotGetCardIFPowerStatus()

Result FSPXI_CardSlotGetCardIFPowerStatus | ( | Handle | serviceHandle,
|  | bool * | status
| ) |  |

Gets the card's power status.

Parameters

  status | Pointer to output the power status to.

## FSPXI_CardSlotIsInserted()

Result FSPXI_CardSlotIsInserted | ( | Handle | serviceHandle,
|  | bool * | inserted
| ) |  |

Gets whether a card is inserted.

Parameters

  inserted | Pointer to output the insertion status to.

## FSPXI_CardSlotPowerOff()

Result FSPXI_CardSlotPowerOff | ( | Handle | serviceHandle,
|  | bool * | status
| ) |  |

Powers off the card slot.

Parameters

  status | Pointer to output the power status to.

## FSPXI_CardSlotPowerOn()

Result FSPXI_CardSlotPowerOn | ( | Handle | serviceHandle,
|  | bool * | status
| ) |  |

Powers on the card slot.

Parameters

  status | Pointer to output the power status to.

## FSPXI_CloseArchive()

Result FSPXI_CloseArchive | ( | Handle | serviceHandle,
|  | FSPXI_Archive | archive
| ) |  |

Close an archive.

Parameters

  archive | Archive to close.

## FSPXI_CloseDirectory()

Result FSPXI_CloseDirectory | ( | Handle | serviceHandle,
|  | FSPXI_Directory | directory
| ) |  |

Close a directory.

Parameters

  directory | Directory to close.

## FSPXI_CloseFile()

Result FSPXI_CloseFile | ( | Handle | serviceHandle,
|  | FSPXI_File | file
| ) |  |

Close a file.

Parameters

  file | File to close

## FSPXI_CommitSaveData()

Result FSPXI_CommitSaveData | ( | Handle | serviceHandle,
|  | FSPXI_Archive | archive,
|  | u32 | id
| ) |  |

Commits an archive's save data.

Parameters

  archive | Archive to commit.
  id | Archive action sent by FSUSER_ControlArchive. Must not be 0 or 0x789D

Remarks
  Unsure why id is sent. This appears to be the default action for FSUSER_ControlArchive, with every action other than 0 and 0x789D being sent to this command.

## FSPXI_CreateDirectory()

Result FSPXI_CreateDirectory | ( | Handle | serviceHandle,
|  | FSPXI_Archive | archive,
|  | FS_Path | path,
|  | u32 | attributes
| ) |  |

Creates a directory.

Parameters

  archive | Archive to create the directory in.
  path | Path of the directory.
  attributes | Attributes of the directory.

## FSPXI_CreateExtSaveData()

Result FSPXI_CreateExtSaveData | ( | Handle | serviceHandle,
|  | FS_ExtSaveDataInfo | info
| ) |  |

Creates ext save data.

Parameters

  info | Info of the save data.

## FSPXI_CreateFile()

Result FSPXI_CreateFile | ( | Handle | serviceHandle,
|  | FSPXI_Archive | archive,
|  | FS_Path | path,
|  | u32 | attributes,
|  | u64 | fileSize
| ) |  |

Creates a file.

Parameters

  archive | Archive to create the file in.
  path | Path of the file.
  attributes | Attributes of the file.
  size | Size of the file.

## FSPXI_DeleteDirectory()

Result FSPXI_DeleteDirectory | ( | Handle | serviceHandle,
|  | FSPXI_Archive | archive,
|  | FS_Path | path
| ) |  |

Deletes a directory.

Parameters

  archive | Archive containing the directory.
  path | Path of the directory.

## FSPXI_DeleteExtSaveData()

Result FSPXI_DeleteExtSaveData | ( | Handle | serviceHandle,
|  | FS_ExtSaveDataInfo | info
| ) |  |

Deletes ext save data.

Parameters

  info | Info of the save data.

## FSPXI_DeleteFile()

Result FSPXI_DeleteFile | ( | Handle | serviceHandle,
|  | FSPXI_Archive | archive,
|  | FS_Path | path
| ) |  |

Deletes a file.

Parameters

  archive | Archive containing the file.
  path | Path of the file.

## FSPXI_EnumerateExtSaveData()

Result FSPXI_EnumerateExtSaveData | ( | Handle | serviceHandle,
|  | u32 * | idsWritten,
|  | u32 | idsSize,
|  | FS_MediaType | mediaType,
|  | u32 | idSize,
|  | bool | shared,
|  | u8 * | ids
| ) |  |

Enumerates ext save data.

Parameters

  idsWritten | Pointer to output the number of IDs written to.
  idsSize | Size of the IDs buffer.
  mediaType | Media type to enumerate over.
  idSize | Size of each ID element.
  shared | Whether to enumerate shared ext save data.
  ids | Pointer to output IDs to.

## FSPXI_EnumerateSystemSaveData()

Result FSPXI_EnumerateSystemSaveData | ( | Handle | serviceHandle,
|  | u32 * | idsWritten,
|  | u32 | idsSize,
|  | u32 * | ids
| ) |  |

Enumerates system save data.

Parameters

  idsWritten | Pointer to output the number of IDs written to.
  idsSize | Size of the IDs buffer.
  ids | Pointer to output IDs to.

## FSPXI_ExportIntegrityVerificationSeed()

Result FSPXI_ExportIntegrityVerificationSeed | ( | Handle | serviceHandle,
|  | FS_IntegrityVerificationSeed * | seed
| ) |  |

Exports the integrity verification seed.

Parameters

  seed | Pointer to output the seed to.

## FSPXI_FormatCardNorDevice()

Result FSPXI_FormatCardNorDevice | ( | Handle | serviceHandle,
|  | u32 | unk
| ) |  |

Formats the CARDNOR device.

Parameters

  unk | Unknown. Transaction?

## FSPXI_GenerateRandomBytes()

Result FSPXI_GenerateRandomBytes | ( | Handle | serviceHandle,
|  | void * | buffer,
|  | u32 | size
| ) |  |

Generates random bytes.

Uses same code as PSPXI_GenerateRandomBytes

Parameters

  buf | Buffer to output random bytes to.
  size | Size of buffer.

## FSPXI_GetArchiveResource()

Result FSPXI_GetArchiveResource | ( | Handle | serviceHandle,
|  | FS_ArchiveResource * | archiveResource,
|  | FS_SystemMediaType | mediaType
| ) |  |

Gets an archive's resource information.

Parameters

  archiveResource | Pointer to output the archive resource information to.
  mediaType | System media type to check.

## FSPXI_GetCardType()

Result FSPXI_GetCardType | ( | Handle | serviceHandle,
|  | FS_CardType * | out
| ) |  |

Gets the inserted card type.

Parameters

  out | Pointer to output the card type to.

## FSPXI_GetFileLastModified()

Result FSPXI_GetFileLastModified | ( | Handle | serviceHandle,
|  | FSPXI_Archive | archive,
|  | u64 * | out,
|  | const u16 * | path,
|  | u32 | size
| ) |  |

Gets the last modified time of a file in an archive.

Parameters

  archive | The archive that contains the file.
  out | The pointer to write the timestamp to.
  path | The UTF-16 path of the file.
  size | The size of the path.

## FSPXI_GetFileSize()

Result FSPXI_GetFileSize | ( | Handle | serviceHandle,
|  | FSPXI_File | file,
|  | u64 * | size
| ) |  |

Get size of a file.

Parameters

  file | File to get the size of.
  size | Pointer to output size to.

## FSPXI_GetLegacyBannerData()

Result FSPXI_GetLegacyBannerData | ( | Handle | serviceHandle,
|  | FS_MediaType | mediaType,
|  | u64 | programId,
|  | void * | banner,
|  | u8 | unk
| ) |  |

Gets the legacy banner data of a program.

Parameters

  mediaType | Media type of the program.
  programId | ID of the program.
  banner | Pointer to output the legacy banner data to. (size = 0x23C0)
  unk | Unknown. Always 1?

## FSPXI_GetLegacyRomHeader()

Result FSPXI_GetLegacyRomHeader | ( | Handle | serviceHandle,
|  | FS_MediaType | mediaType,
|  | u64 | programId,
|  | void * | header
| ) |  |

Gets the legacy ROM header of a program.

Parameters

  mediaType | Media type of the program.
  programId | ID of the program.
  header | Pointer to output the legacy ROM header to. (size = 0x3B4)

## FSPXI_GetLegacySubBannerData()

Result FSPXI_GetLegacySubBannerData | ( | Handle | serviceHandle,
|  | u32 | bannerSize,
|  | FS_MediaType | mediaType,
|  | u64 | programId,
|  | void * | banner
| ) |  |

Gets the legacy sub banner data of a program.

Parameters

  bannerSize | Size of the banner.
  mediaType | Media type of the program.
  programId | ID of the program.
  header | Pointer to output the legacy sub banner data to.

## FSPXI_GetNandArchiveResource()

Result FSPXI_GetNandArchiveResource | ( | Handle | serviceHandle,
|  | FS_ArchiveResource * | out
| ) |  |

Gets the NAND archive resource information.

Parameters

  out | Pointer to output the archive resource information to.

## FSPXI_GetNandCid()

Result FSPXI_GetNandCid | ( | Handle | serviceHandle,
|  | void * | out,
|  | u32 | size
| ) |  |

Gets the NAND CID.

Parameters

  out | Buffer to output the CID to.
  size | Size of buffer.

## FSPXI_GetNandLog()

Result FSPXI_GetNandLog | ( | Handle | serviceHandle,
|  | void * | out,
|  | u32 | size
| ) |  |

Gets the NAND log.

Parameters

  out | Buffer to output the log to.
  size | Size of buffer.

## FSPXI_GetNandSpeedInfo()

Result FSPXI_GetNandSpeedInfo | ( | Handle | serviceHandle,
|  | FS_SdMmcSpeedInfo * | out
| ) |  |

Gets the NAND speed info.

Parameters

  out | Buffer to output the speed info to.

## FSPXI_GetProductInfo()

Result FSPXI_GetProductInfo | ( | Handle | serviceHandle,
|  | FS_ProductInfo * | info,
|  | FSPXI_Archive | archive
| ) |  |

Gets an NCCH's product info.

Parameters

  info | Pointer to output the product info to.
  archive | Open NCCH content archive

## FSPXI_GetSdmcArchiveResource()

Result FSPXI_GetSdmcArchiveResource | ( | Handle | serviceHandle,
|  | FS_ArchiveResource * | out
| ) |  |

Gets the SDMC archive resource information.

Parameters

  out | Pointer to output the archive resource information to.

## FSPXI_GetSdmcCid()

Result FSPXI_GetSdmcCid | ( | Handle | serviceHandle,
|  | void * | out,
|  | u32 | size
| ) |  |

Gets the SDMC CID.

Parameters

  out | Buffer to output the CID to.
  size | Size of buffer.

## FSPXI_GetSdmcCtrRootPath()

Result FSPXI_GetSdmcCtrRootPath | ( | Handle | serviceHandle,
|  | u16 * | out,
|  | u32 | length
| ) |  |

Gets the CTR SDMC root path.

Parameters

  out | Pointer to output the root path to.
  length | Length of the output buffer in bytes.

## FSPXI_GetSdmcFatFsError()

Result FSPXI_GetSdmcFatFsError | ( | Handle | serviceHandle,
|  | u32 * | out
| ) |  |

Gets the error code from the SDMC FatFS driver.

Parameters

  out | Pointer to output the error code to

## FSPXI_GetSdmcLog()

Result FSPXI_GetSdmcLog | ( | Handle | serviceHandle,
|  | void * | out,
|  | u32 | size
| ) |  |

Gets the SDMC log.

Parameters

  out | Buffer to output the log to.
  size | Size of buffer.

## FSPXI_GetSdmcSpeedInfo()

Result FSPXI_GetSdmcSpeedInfo | ( | Handle | serviceHandle,
|  | FS_SdMmcSpeedInfo * | out
| ) |  |

Gets the SDMC speed info.

Parameters

  out | Buffer to output the speed info to.

## FSPXI_GetSpecialContentIndex()

Result FSPXI_GetSpecialContentIndex | ( | Handle | serviceHandle,
|  | u16 * | index,
|  | FS_MediaType | mediaType,
|  | u64 | programId,
|  | FS_SpecialContentType | type
| ) |  |

Gets a special content's index.

Parameters

  index | Pointer to output the index to.
  mediaType | Media type of the special content.
  programId | Program ID owning the special content.
  type | Type of special content.

## FSPXI_GetSpecialFileSize()

Result FSPXI_GetSpecialFileSize | ( | Handle | serviceHandle,
|  | u64 * | fileSize
| ) |  |

Gets the size of a special file.

Parameters

  fileSize | Pointer to output the size to.

## FSPXI_HasDirectory()

Result FSPXI_HasDirectory | ( | Handle | serviceHandle,
|  | FSPXI_Archive | archive,
|  | bool * | out,
|  | FS_Path | path
| ) |  |

Checks if the archive contains a directory at path.

Parameters

  archive | Archive to check.
  out | Pointer to output existence to.
  path | Path to check for directory

## FSPXI_HasFile()

Result FSPXI_HasFile | ( | Handle | serviceHandle,
|  | FSPXI_Archive | archive,
|  | bool * | out,
|  | FS_Path | path
| ) |  |

Checks if the archive contains a file at path.

Parameters

  archive | Archive to check.
  out | Pointer to output existence to.
  path | Path to check for file

## FSPXI_ImportIntegrityVerificationSeed()

Result FSPXI_ImportIntegrityVerificationSeed | ( | Handle | serviceHandle,
|  | const FS_IntegrityVerificationSeed * | seed
| ) |  |

Imports an integrity verification seed.

Parameters

  seed | Seed to import.

## FSPXI_IsSdmcDetected()

Result FSPXI_IsSdmcDetected | ( | Handle | serviceHandle,
|  | bool * | out
| ) |  |

Gets whether PXIFS0 detects the SD.

Parameters

  out | Pointer to output the detection status to

## FSPXI_IsSdmcWritable()

Result FSPXI_IsSdmcWritable | ( | Handle | serviceHandle,
|  | bool * | out
| ) |  |

Gets whether PXIFS0 can write to the SD.

Parameters

  out | Pointer to output the writable status to

## FSPXI_OpenArchive()

Result FSPXI_OpenArchive | ( | Handle | serviceHandle,
|  | FSPXI_Archive * | archive,
|  | FS_ArchiveID | archiveID,
|  | FS_Path | path
| ) |  |

Opens an archive.

Parameters

  archive | Pointer to output the opened archive to.
  id | ID of the archive.
  path | Path of the archive.

## FSPXI_OpenDirectory()

Result FSPXI_OpenDirectory | ( | Handle | serviceHandle,
|  | FSPXI_Directory * | out,
|  | FSPXI_Archive | archive,
|  | FS_Path | path
| ) |  |

Opens a directory.

Parameters

  out | Pointer to output the directory handle to.
  archive | Archive containing the directory.
  path | Path of the directory.

## FSPXI_OpenFile()

Result FSPXI_OpenFile | ( | Handle | serviceHandle,
|  | FSPXI_File * | out,
|  | FSPXI_Archive | archive,
|  | FS_Path | path,
|  | u32 | flags,
|  | u32 | attributes
| ) |  |

Opens a file.

Parameters

  out | Pointer to output the file handle to.
  archive | Archive containing the file.
  path | Path of the file.
  flags | Flags to open the file with.
  attributes | Attributes of the file.

## FSPXI_ReadDirectory()

Result FSPXI_ReadDirectory | ( | Handle | serviceHandle,
|  | FSPXI_Directory | directory,
|  | u32 * | entriesRead,
|  | u32 | entryCount,
|  | FS_DirectoryEntry * | entries
| ) |  |

Reads one or more directory entries.

Parameters

  directory | Directory to read from.
  entriesRead | Pointer to output the number of entries read to.
  entryCount | Number of entries to read.
  entryOut | Pointer to output directory entries to.

## FSPXI_ReadFile()

Result FSPXI_ReadFile | ( | Handle | serviceHandle,
|  | FSPXI_File | file,
|  | u32 * | bytesRead,
|  | u64 | offset,
|  | void * | buffer,
|  | u32 | size
| ) |  |

Reads from a file.

Parameters

  file | File to read from.
  bytesRead | Pointer to output the number of read bytes to.
  offset | Offset to read from.
  buffer | Buffer to read to.
  size | Size of the buffer.

## FSPXI_ReadFileSHA256()

Result FSPXI_ReadFileSHA256 | ( | Handle | serviceHandle,
|  | FSPXI_File | file,
|  | u32 * | bytesRead,
|  | u64 | offset,
|  | void * | readBuffer,
|  | u32 | readBufferSize,
|  | void * | hashtable,
|  | u32 | hashtableSize,
|  | u32 | unk
| ) |  |

Reads data and stores SHA256 hashes of blocks.

Parameters

  file | File to read from.
  bytesRead | Pointer to output the number of read bytes to.
  offset | Offset to read from.
  readBuffer | Pointer to store read data in.
  readBufferSize | Size of readBuffer.
  hashtable | Pointer to store SHA256 hashes in.
  hashtableSize | Size of hashtable.
  unk | Unknown. Always 0x00001000? Possibly block size?

## FSPXI_ReadNandReport()

Result FSPXI_ReadNandReport | ( | Handle | serviceHandle,
|  | void * | buffer,
|  | u32 | size,
|  | u32 | unk
| ) |  |

Reads the NAND report.

Parameters

  unk | Unknown
  buffer | Buffer to write the report to.
  size | Size of buffer

## FSPXI_ReadSpecialFile()

Result FSPXI_ReadSpecialFile | ( | Handle | serviceHandle,
|  | u32 * | bytesRead,
|  | u64 | fileOffset,
|  | u32 | size,
|  | void * | data
| ) |  |

Reads from a special file.

Parameters

  bytesRead | Pointer to output the number of bytes read to.
  fileOffset | Offset of the file.
  size | Size of the buffer.
  data | Buffer to read to.

## FSPXI_RenameDirectory()

Result FSPXI_RenameDirectory | ( | Handle | serviceHandle,
|  | FSPXI_Archive | srcArchive,
|  | FS_Path | srcPath,
|  | FSPXI_Archive | dstArchive,
|  | FS_Path | dstPath
| ) |  |

Renames a directory.

Parameters

  srcArchive | Archive containing the source directory.
  srcPath | Path of the source directory.
  dstArchive | Archive containing the destination directory.
  dstPath | Path of the destination directory.

## FSPXI_RenameFile()

Result FSPXI_RenameFile | ( | Handle | serviceHandle,
|  | FSPXI_Archive | srcArchive,
|  | FS_Path | srcPath,
|  | FSPXI_Archive | dstArchive,
|  | FS_Path | dstPath
| ) |  |

Renames a file.

Parameters

  srcArchive | Archive containing the source file.
  srcPath | Path of the source file.
  dstArchive | Archive containing the destination file.
  dstPath | Path of the destination file.

## FSPXI_SendInitializeInfoTo9()

Result FSPXI_SendInitializeInfoTo9 | ( | Handle | serviceHandle,
|  | u8 | unk
| ) |  |

Sends initialization info to ARM9.

Parameters

  unk | FS sends *(0x1FF81086)

## FSPXI_SetCardSpiBaudrate()

Result FSPXI_SetCardSpiBaudrate | ( | Handle | serviceHandle,
|  | FS_CardSpiBaudRate | baudRate
| ) |  |

Sets the CARDSPI baud rate.

Parameters

  baudRate | Baud rate to set.

## FSPXI_SetCardSpiBusMode()

Result FSPXI_SetCardSpiBusMode | ( | Handle | serviceHandle,
|  | FS_CardSpiBusMode | busMode
| ) |  |

Sets the CARDSPI bus mode.

Parameters

  busMode | Bus mode to set.

## FSPXI_SetCtrCardLatencyParameter()

Result FSPXI_SetCtrCardLatencyParameter | ( | Handle | serviceHandle,
|  | u64 | latency
| ) |  |

Configures CTRCARD latency emulation.

Parameters

  latency | Latency to apply.

## FSPXI_SetFileSize()

Result FSPXI_SetFileSize | ( | Handle | serviceHandle,
|  | FSPXI_File | file,
|  | u64 | size
| ) |  |

Set size of a file.

Parameters

  file | File to set the size of
  size | Size to set the file to

## FSPXI_SetPriority()

Result FSPXI_SetPriority | ( | Handle | serviceHandle,
|  | u32 | priority
| ) |  |

Sets the file system priority.

Parameters

  priority | Priority to set.

## FSPXI_StartDeviceMoveAsDestination()

Result FSPXI_StartDeviceMoveAsDestination | ( | Handle | serviceHandle,
|  | FS_DeviceMoveContext | context,
|  | bool | clear
| ) |  |

Initiates a device move as the destination device.

Parameters

  context | Context to use.
  clear | Whether to clear the device's data first.

## FSPXI_StartDeviceMoveAsSource()

Result FSPXI_StartDeviceMoveAsSource | ( | Handle | serviceHandle,
|  | FS_DeviceMoveContext * | context
| ) |  |

Initiates a device move as the source device.

Parameters

  context | Pointer to output the context to.

## FSPXI_SwitchCleanupInvalidSaveData()

Result FSPXI_SwitchCleanupInvalidSaveData | ( | Handle | serviceHandle,
|  | bool | enable
| ) |  |

Toggles cleaning up invalid save data.

Parameters

  enable | Whether to enable cleaning up invalid save data.

## FSPXI_Unknown0x17()

Result FSPXI_Unknown0x17 | ( | Handle | serviceHandle,
|  | FSPXI_Archive | archive,
|  | bool * | out
| ) |  |

Unknown 0x17.

Appears to be an "is archive handle valid" command?

Parameters

  archive | Archive handle to check validity of.
  out | Pointer to output validity to.

## FSPXI_Unknown0x56()

Result FSPXI_Unknown0x56 | ( | Handle | serviceHandle,
|  | u32 | out[4],
|  | FS_Archive | archive,
|  | FS_Path | path
| ) |  |

Unknown command 0x56.

Remarks
  Called by FSUSER_ControlArchive with ArchiveAction 0x789D

## FSPXI_WriteFile()

Result FSPXI_WriteFile | ( | Handle | serviceHandle,
|  | FSPXI_File | file,
|  | u32 * | bytesWritten,
|  | u64 | offset,
|  | const void * | buffer,
|  | u32 | size,
|  | u32 | flags
| ) |  |

Writes to a file.

Parameters

  file | File to write to.
  bytesWritten | Pointer to output the number of bytes written to.
  offset | Offset to write to.
  buffer | Buffer to write from.
  size | Size of the buffer.
  flags | Flags to use when writing.

## FSPXI_WriteFileSHA256()

Result FSPXI_WriteFileSHA256 | ( | Handle | serviceHandle,
|  | FSPXI_File | file,
|  | u32 * | bytesWritten,
|  | u64 | offset,
|  | const void * | writeBuffer,
|  | u32 | writeBufferSize,
|  | void * | hashtable,
|  | u32 | hashtableSize,
|  | u32 | unk1,
|  | u32 | unk2
| ) |  |

Assumedly writes data and stores SHA256 hashes of blocks.

Parameters

  file | File to write to.
  bytesWritten | Pointer to output the number of written bytes to.
  offset | Offset to write to.
  writeBuffer | Buffer to write from.
  writeBufferSize | Size of writeBuffer.
  hashtable | Pointer to store SHA256 hashes in.
  hashtableSize | Size of hashtable
  unk1 | Unknown. Might match with ReadFileSHA256's unknown?
  unk2 | Unknown. Might match with ReadFileSHA256's unknown?