FS_path FS_makePath(FS_pathType type, const char *path);
-Result FSUSER_Initialize(void);
+Result FSUSER_Initialize(Handle handle);
Result FSUSER_OpenArchive(FS_archive* archive);
Result FSUSER_OpenDirectory(Handle* out, FS_archive archive, FS_path dirLowPath);
Result FSUSER_OpenFile(Handle* out, FS_archive archive, FS_path fileLowPath, u32 openflags, u32 attributes);
if (fsInitialised) return ret;
if((ret=srvGetServiceHandle(&fsuHandle, "fs:USER"))!=0)return ret;
- if(__get_handle_from_list("fs:USER")==0)ret=FSUSER_Initialize();
+ if(__get_handle_from_list("fs:USER")==0)ret=FSUSER_Initialize(fsuHandle);
fsInitialised = true;
*
* @returns error
*
+ * @param[in] handle fs:USER service handle
+ *
* @internal
*
* #### Request
* 1 | Result code
*/
Result
-FSUSER_Initialize(void)
+FSUSER_Initialize(Handle handle)
{
- // don't run command if we got handle from the list
- if(fsuHandle != 0 && __get_handle_from_list("fs:USER")!=0)
- return 0;
-
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = 0x08010002;
cmdbuf[1] = 0x20;
Result ret = 0;
- if((ret = svcSendSyncRequest(fsuHandle)))
+ if((ret = svcSendSyncRequest(handle)))
return ret;
return cmdbuf[1];