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

Function FSUSER_OpenFileDirectly

libctru/source/services/fs.c:186–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186Result FSUSER_OpenFileDirectly(Handle* out, FS_ArchiveID archiveId, FS_Path archivePath, FS_Path filePath, u32 openFlags, u32 attributes)
187{
188 u32 *cmdbuf = getThreadCommandBuffer();
189
190 cmdbuf[0] = IPC_MakeHeader(0x803,8,4); // 0x8030204
191 cmdbuf[1] = 0;
192 cmdbuf[2] = archiveId;
193 cmdbuf[3] = archivePath.type;
194 cmdbuf[4] = archivePath.size;
195 cmdbuf[5] = filePath.type;
196 cmdbuf[6] = filePath.size;
197 cmdbuf[7] = openFlags;
198 cmdbuf[8] = attributes;
199 cmdbuf[9] = IPC_Desc_StaticBuffer(archivePath.size, 2);
200 cmdbuf[10] = (u32) archivePath.data;
201 cmdbuf[11] = IPC_Desc_StaticBuffer(filePath.size, 0);
202 cmdbuf[12] = (u32) filePath.data;
203
204 Result ret = 0;
205 if(R_FAILED(ret = svcSendSyncRequest(fsSession()))) return ret;
206
207 if(out) *out = cmdbuf[3];
208
209 return cmdbuf[1];
210}
211
212Result FSUSER_DeleteFile(FS_Archive archive, FS_Path path)
213{

Callers 4

romfsMountSelfFunction · 0.85
romfsMountFromTitleFunction · 0.85
ndspFindAndLoadComponentFunction · 0.85

Calls 4

getThreadCommandBufferFunction · 0.85
IPC_MakeHeaderFunction · 0.85
IPC_Desc_StaticBufferFunction · 0.85
fsSessionFunction · 0.85

Tested by

no test coverage detected