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); }
public static void InitializeNvMap(ServiceCtx Context) { IdDictionary Dict = Maps.GetOrAdd(Context.Process, (Key) => new IdDictionary()); Dict.Add(0, new NvMapHandle()); }
public static void InitializeNvMap(ServiceCtx context) { IdDictionary dict = _maps.GetOrAdd(context.Process, (key) => new IdDictionary()); dict.Add(0, new NvMapHandle()); }
public void Add(T obj) { objects.Add(obj); objectsById.Add(obj); }
public NvMapDeviceFile(ServiceCtx context) : base(context) { IdDictionary dict = _maps.GetOrAdd(Owner, (key) => new IdDictionary()); dict.Add(0, new NvMapHandle()); }
public NvMapDeviceFile(ServiceCtx context, IVirtualMemoryManager memory, long owner) : base(context, owner) { IdDictionary dict = _maps.GetOrAdd(Owner, (key) => new IdDictionary()); dict.Add(0, new NvMapHandle()); }
public int OpenHandle(object Obj) { return(Handles.Add(Obj)); }
private int CreateHandleFromMap(NvMapHandle map) { IdDictionary dict = _maps.GetOrAdd(Owner, (key) => new IdDictionary()); return(dict.Add(map)); }