示例#1
0
文件: Code.cs 项目: ckurtz22/LibHac
        private static Result MountCodeImpl(this FileSystemClient fs, out CodeVerificationData verificationData,
                                            U8Span mountName, U8Span path, ProgramId programId)
        {
            Unsafe.SkipInit(out verificationData);

            Result rc = MountHelpers.CheckMountName(mountName);

            if (rc.IsFailure())
            {
                return(rc);
            }

            rc = FspPath.FromSpan(out FspPath fsPath, path);
            if (rc.IsFailure())
            {
                return(rc);
            }

            IFileSystemProxyForLoader fsProxy = fs.GetFileSystemProxyForLoaderServiceObject();

            rc = fsProxy.OpenCodeFileSystem(out IFileSystem codeFs, out verificationData, in fsPath, programId);
            if (rc.IsFailure())
            {
                return(rc);
            }

            return(fs.Register(mountName, codeFs));
        }
示例#2
0
        public static Result IsArchivedProgram(this FileSystemClient fs, out bool isArchived, ProcessId processId)
        {
            IFileSystemProxyForLoader fsProxy = fs.GetFileSystemProxyForLoaderServiceObject();

            return(fsProxy.IsArchivedProgram(out isArchived, processId.Value));
        }