aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Arp/LibHacIReader.cs
blob: d36ec5900e53be846970af3d935580b0705de857 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using LibHac;
using LibHac.Ncm;
using LibHac.Ns;
using System;

using ApplicationId = LibHac.ApplicationId;

namespace Ryujinx.HLE.HOS.Services.Arp
{
    class LibHacIReader : LibHac.Arp.Impl.IReader
    {
        public ApplicationId ApplicationId { get; set; }

        public Result GetApplicationLaunchProperty(out LibHac.Arp.ApplicationLaunchProperty launchProperty, ulong processId)
        {
            launchProperty = new LibHac.Arp.ApplicationLaunchProperty
            {
                BaseStorageId = StorageId.BuiltInUser,
                ApplicationId = ApplicationId
            };

            return Result.Success;
        }

        public Result GetApplicationLaunchPropertyWithApplicationId(out LibHac.Arp.ApplicationLaunchProperty launchProperty, ApplicationId applicationId)
        {
            launchProperty = new LibHac.Arp.ApplicationLaunchProperty
            {
                BaseStorageId = StorageId.BuiltInUser,
                ApplicationId = applicationId
            };

            return Result.Success;
        }

        public Result GetApplicationControlProperty(out ApplicationControlProperty controlProperty, ulong processId)
        {
            throw new NotImplementedException();
        }

        public Result GetApplicationControlPropertyWithApplicationId(out ApplicationControlProperty controlProperty, ApplicationId applicationId)
        {
            throw new NotImplementedException();
        }

        public Result GetServiceObject(out object serviceObject)
        {
            throw new NotImplementedException();
        }
    }

    internal class LibHacArpServiceObject : LibHac.Sm.IServiceObject
    {
        private LibHacIReader _serviceObject;

        public LibHacArpServiceObject(LibHacIReader serviceObject)
        {
            _serviceObject = serviceObject;
        }

        public Result GetServiceObject(out object serviceObject)
        {
            serviceObject = _serviceObject;

            return Result.Success;
        }
    }
}