Пример #1
0
        private KernelResult ResetSignal(int handle)
        {
            KProcess currentProcess = _system.Scheduler.GetCurrentProcess();

            KReadableEvent readableEvent = currentProcess.HandleTable.GetObject <KReadableEvent>(handle);

            KernelResult result;

            if (readableEvent != null)
            {
                result = readableEvent.ClearIfSignaled();
            }
            else
            {
                KProcess process = currentProcess.HandleTable.GetKProcess(handle);

                if (process != null)
                {
                    result = process.ClearIfNotExited();
                }
                else
                {
                    result = KernelResult.InvalidHandle;
                }
            }

            return(result);
        }
 public void GetNativeHandle(uint typeId, out KReadableEvent readableEvent)
 {
     if (typeId == 0xF)
     {
         readableEvent = GetWaitBufferFreeEvent();
     }
     else
     {
         throw new NotImplementedException($"Unimplemented native event type {typeId}!");
     }
 }
Пример #3
0
        protected override void GetNativeHandle(int binderId, uint typeId, out KReadableEvent readableEvent)
        {
            IBinder binder = GetBinderObjectById(binderId);

            if (binder == null)
            {
                readableEvent = null;

                Logger.PrintError(LogClass.SurfaceFlinger, $"Invalid binder id {binderId}");

                return;
            }

            binder.GetNativeHandle(typeId, out readableEvent);
        }
Пример #4
0
        private KernelResult ClearEvent(int handle)
        {
            KernelResult result;

            KWritableEvent writableEvent = _process.HandleTable.GetObject <KWritableEvent>(handle);

            if (writableEvent == null)
            {
                KReadableEvent readableEvent = _process.HandleTable.GetObject <KReadableEvent>(handle);

                result = readableEvent?.Clear() ?? KernelResult.InvalidHandle;
            }
            else
            {
                result = writableEvent.Clear();
            }

            return(result);
        }
Пример #5
0
 protected abstract void GetNativeHandle(int binderId, uint typeId, out KReadableEvent readableEvent);
Пример #6
0
 public KEvent(Horizon system)
 {
     ReadableEvent = new KReadableEvent(system, this);
     WritableEvent = new KWritableEvent(this);
 }
Пример #7
0
 public KEvent(KernelContext context)
 {
     ReadableEvent = new KReadableEvent(context, this);
     WritableEvent = new KWritableEvent(context, this);
 }