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

Function FSUSER_OpenFile

libctru/source/services/fs.c:163–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163Result FSUSER_OpenFile(Handle* out, FS_Archive archive, FS_Path path, u32 openFlags, u32 attributes)
164{
165 u32 *cmdbuf = getThreadCommandBuffer();
166
167 cmdbuf[0] = IPC_MakeHeader(0x802,7,2); // 0x80201C2
168 cmdbuf[1] = 0;
169 cmdbuf[2] = (u32) archive;
170 cmdbuf[3] = (u32) (archive >> 32);
171 cmdbuf[4] = path.type;
172 cmdbuf[5] = path.size;
173 cmdbuf[6] = openFlags;
174 cmdbuf[7] = attributes;
175 cmdbuf[8] = IPC_Desc_StaticBuffer(path.size, 0);
176 cmdbuf[9] = (u32) path.data;
177
178 Result ret = 0;
179 if(R_FAILED(ret = svcSendSyncRequest(fsSessionForArchive(archive)))) return ret;
180
181 if(out) *out = cmdbuf[3];
182
183 return cmdbuf[1];
184}
185
186Result FSUSER_OpenFileDirectly(Handle* out, FS_ArchiveID archiveId, FS_Path archivePath, FS_Path filePath, u32 openFlags, u32 attributes)
187{

Callers 2

archive_openFunction · 0.85
archive_statFunction · 0.85

Calls 4

getThreadCommandBufferFunction · 0.85
IPC_MakeHeaderFunction · 0.85
IPC_Desc_StaticBufferFunction · 0.85
fsSessionForArchiveFunction · 0.85

Tested by

no test coverage detected