Implemented FSUSER_GetProductInfo.
This commit is contained in:
parent
6b40ea9d8e
commit
fcb370a8c1
@ -127,6 +127,14 @@ typedef struct
|
|||||||
u64 fileSize; //!< file size
|
u64 fileSize; //!< file size
|
||||||
} FS_dirent;
|
} FS_dirent;
|
||||||
|
|
||||||
|
/*! ProductInfo. These strings are not NULL-terminated. */
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
char product_code[0x10];
|
||||||
|
char company_code[0x2];
|
||||||
|
u16 remaster_version;
|
||||||
|
} FS_ProductInfo;
|
||||||
|
|
||||||
Result fsInit(void);
|
Result fsInit(void);
|
||||||
Result fsExit(void);
|
Result fsExit(void);
|
||||||
Handle *fsGetSessionHandle();
|
Handle *fsGetSessionHandle();
|
||||||
@ -150,6 +158,7 @@ Result FSUSER_GetSdmcArchiveResource(Handle *handle, u32 *sectorSize, u32 *clust
|
|||||||
Result FSUSER_GetNandArchiveResource(Handle *handle, u32 *sectorSize, u32 *clusterSize, u32 *numClusters, u32 *freeClusters);
|
Result FSUSER_GetNandArchiveResource(Handle *handle, u32 *sectorSize, u32 *clusterSize, u32 *numClusters, u32 *freeClusters);
|
||||||
Result FSUSER_IsSdmcDetected(Handle *handle, u8 *detected);
|
Result FSUSER_IsSdmcDetected(Handle *handle, u8 *detected);
|
||||||
Result FSUSER_IsSdmcWritable(Handle *handle, u8 *writable);
|
Result FSUSER_IsSdmcWritable(Handle *handle, u8 *writable);
|
||||||
|
Result FSUSER_GetProductInfo(Handle *handle, u32 processid, FS_ProductInfo *out);
|
||||||
Result FSUSER_GetMediaType(Handle *handle, u8* mediatype);
|
Result FSUSER_GetMediaType(Handle *handle, u8* mediatype);
|
||||||
|
|
||||||
Result FSFILE_Close(Handle handle);
|
Result FSFILE_Close(Handle handle);
|
||||||
|
@ -1051,6 +1051,54 @@ FSUSER_IsSdmcDetected(Handle *handle,
|
|||||||
return cmdbuf[1];
|
return cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*! Get the ProductInfo for the specified process.
|
||||||
|
*
|
||||||
|
* @param[in] handle fs:USER handle
|
||||||
|
* @param[in] processid ProcessID
|
||||||
|
* @param[out] out Output ProductInfo
|
||||||
|
*
|
||||||
|
* @returns error
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*
|
||||||
|
* #### Request
|
||||||
|
*
|
||||||
|
* Index Word | Description
|
||||||
|
* -----------|-------------------------
|
||||||
|
* 0 | Header code [0x082E0040]
|
||||||
|
* 1 | u32 processID
|
||||||
|
*
|
||||||
|
* #### Response
|
||||||
|
*
|
||||||
|
* Index Word | Description
|
||||||
|
* -----------|-------------------------
|
||||||
|
* 0 | Header code
|
||||||
|
* 1 | Result code
|
||||||
|
* 2-6 | Output ProductInfo
|
||||||
|
*/
|
||||||
|
Result
|
||||||
|
FSUSER_GetProductInfo(Handle *handle,
|
||||||
|
u32 processid,
|
||||||
|
FS_ProductInfo *out)
|
||||||
|
{
|
||||||
|
if(!handle)
|
||||||
|
handle = &fsuHandle;
|
||||||
|
|
||||||
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
|
||||||
|
cmdbuf[0] = 0x082E0040;
|
||||||
|
cmdbuf[1] = processid;
|
||||||
|
|
||||||
|
Result ret = 0;
|
||||||
|
if((ret = svcSendSyncRequest(*handle)))
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
if(out)
|
||||||
|
memcpy(out, &cmdbuf[2], sizeof(FS_ProductInfo));
|
||||||
|
|
||||||
|
return cmdbuf[1];
|
||||||
|
}
|
||||||
|
|
||||||
/*! Get curent process mediatype
|
/*! Get curent process mediatype
|
||||||
*
|
*
|
||||||
* @param[in] handle fs:USER handle
|
* @param[in] handle fs:USER handle
|
||||||
|
Loading…
Reference in New Issue
Block a user