Esempio n. 1
0
        private int Open(ServiceCtx context, string path)
        {
            if (context.Process == _owner)
            {
                if (_deviceFileRegistry.TryGetValue(path, out Type deviceFileClass))
                {
                    ConstructorInfo constructor = deviceFileClass.GetConstructor(new Type[] { typeof(ServiceCtx) });

                    NvDeviceFile deviceFile = (NvDeviceFile)constructor.Invoke(new object[] { context });

                    return(_deviceFileIdRegistry.Add(deviceFile));
                }
                else
                {
                    Logger.PrintWarning(LogClass.ServiceNv, $"Cannot find file device \"{path}\"!");
                }
            }

            return(-1);
        }
Esempio n. 2
0
        public static void InitializeNvMap(ServiceCtx Context)
        {
            IdDictionary Dict = Maps.GetOrAdd(Context.Process, (Key) => new IdDictionary());

            Dict.Add(0, new NvMapHandle());
        }
Esempio n. 3
0
        public static void InitializeNvMap(ServiceCtx context)
        {
            IdDictionary dict = _maps.GetOrAdd(context.Process, (key) => new IdDictionary());

            dict.Add(0, new NvMapHandle());
        }
Esempio n. 4
0
 public void Add(T obj)
 {
     objects.Add(obj);
     objectsById.Add(obj);
 }
Esempio n. 5
0
        public NvMapDeviceFile(ServiceCtx context) : base(context)
        {
            IdDictionary dict = _maps.GetOrAdd(Owner, (key) => new IdDictionary());

            dict.Add(0, new NvMapHandle());
        }
Esempio n. 6
0
        public NvMapDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, long owner) : base(context, owner)
        {
            IdDictionary dict = _maps.GetOrAdd(Owner, (key) => new IdDictionary());

            dict.Add(0, new NvMapHandle());
        }
Esempio n. 7
0
 public int OpenHandle(object Obj)
 {
     return(Handles.Add(Obj));
 }
Esempio n. 8
0
        private int CreateHandleFromMap(NvMapHandle map)
        {
            IdDictionary dict = _maps.GetOrAdd(Owner, (key) => new IdDictionary());

            return(dict.Add(map));
        }