private KernelResult ResetSignal(int Handle) { KReadableEvent ReadableEvent = Process.HandleTable.GetObject <KReadableEvent>(Handle); KernelResult Result; //TODO: KProcess support. if (ReadableEvent != null) { Result = ReadableEvent.ClearIfSignaled(); } else { Result = KernelResult.InvalidHandle; } if (Result == KernelResult.InvalidState) { Device.Log.PrintDebug(LogClass.KernelSvc, "Operation failed with error: " + Result + "!"); } else if (Result != KernelResult.Success) { Device.Log.PrintWarning(LogClass.KernelSvc, "Operation failed with error: " + Result + "!"); } return(Result); }
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; } } if (result == KernelResult.InvalidState) { Logger.PrintDebug(LogClass.KernelSvc, "Operation failed with error: " + result + "!"); } else if (result != KernelResult.Success) { Logger.PrintWarning(LogClass.KernelSvc, "Operation failed with error: " + result + "!"); } return(result); }
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(); } if (result != KernelResult.Success) { Logger.PrintWarning(LogClass.KernelSvc, "Operation failed with error: " + result + "!"); } return(result); }
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(); } if (Result != KernelResult.Success) { Logger.PrintWarning(LogClass.KernelSvc, "Operation failed with error: " + Result + "!"); } return(Result); }