Added FSUSER_GetMediaType
This commit is contained in:
parent
6590ed3fad
commit
87b9d1302a
@ -150,6 +150,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_IsSdmcDetected(Handle *handle, u8 *detected);
|
||||
Result FSUSER_IsSdmcWritable(Handle *handle, u8 *writable);
|
||||
Result FSUSER_GetMediaType(Handle *handle, u8* mediatype);
|
||||
|
||||
Result FSFILE_Close(Handle handle);
|
||||
Result FSFILE_Read(Handle handle, u32 *bytesRead, u64 offset, void *buffer, u32 size);
|
||||
|
@ -1051,6 +1051,49 @@ FSUSER_IsSdmcDetected(Handle *handle,
|
||||
return cmdbuf[1];
|
||||
}
|
||||
|
||||
/*! Close an open file
|
||||
*
|
||||
* @param[in] handle fs:USER handle
|
||||
* @param[out] mediatype Output curent process mediatype
|
||||
*
|
||||
* @returns error
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* #### Request
|
||||
*
|
||||
* Index Word | Description
|
||||
* -----------|-------------------------
|
||||
* 0 | Header code [0x08680000]
|
||||
*
|
||||
* #### Response
|
||||
*
|
||||
* Index Word | Description
|
||||
* -----------|-------------------------
|
||||
* 0 | Header code
|
||||
* 1 | Result code
|
||||
*/
|
||||
Result
|
||||
FSUSER_GetMediaType(Handle *handle,
|
||||
u8* mediatype)
|
||||
{
|
||||
if(!handle)
|
||||
handle = &fsuHandle;
|
||||
|
||||
u32* cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = 0x08680000;
|
||||
|
||||
Result ret = 0;
|
||||
if((ret = svcSendSyncRequest(*handle)))
|
||||
return ret;
|
||||
|
||||
if(mediatype)
|
||||
*mediatype = cmdbuf[2];
|
||||
|
||||
return cmdbuf[1];
|
||||
}
|
||||
|
||||
/*! Check if SD card is writable
|
||||
*
|
||||
* @param[in] handle fs:USER handle
|
||||
|
Loading…
Reference in New Issue
Block a user