MCPcopy Create free account
hub / github.com/devkitPro/libctru / FSFILE_Read

Function FSFILE_Read

libctru/source/services/fs.c:1654–1671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1652}
1653
1654Result FSFILE_Read(Handle handle, u32* bytesRead, u64 offset, void* buffer, u32 size)
1655{
1656 u32 *cmdbuf = getThreadCommandBuffer();
1657
1658 cmdbuf[0] = IPC_MakeHeader(0x802,3,2); // 0x80200C2
1659 cmdbuf[1] = (u32) offset;
1660 cmdbuf[2] = (u32) (offset >> 32);
1661 cmdbuf[3] = size;
1662 cmdbuf[4] = IPC_Desc_Buffer(size, IPC_BUFFER_W);
1663 cmdbuf[5] = (u32) buffer;
1664
1665 Result ret = 0;
1666 if(R_FAILED(ret = svcSendSyncRequest(handle))) return ret;
1667
1668 if(bytesRead) *bytesRead = cmdbuf[2];
1669
1670 return cmdbuf[1];
1671}
1672
1673Result FSFILE_Write(Handle handle, u32* bytesWritten, u64 offset, const void* buffer, u32 size, u32 flags)
1674{

Callers 4

_romfs_readFunction · 0.85
romfsMountSelfFunction · 0.85
archive_readFunction · 0.85
ndspFindAndLoadComponentFunction · 0.85

Calls 3

getThreadCommandBufferFunction · 0.85
IPC_MakeHeaderFunction · 0.85
IPC_Desc_BufferFunction · 0.85

Tested by

no test coverage detected