internal static uint RegisterService(ref SysCallContext context, ref SystemMessage args) { var proc = Scheduler.GetCurrentThread().Process; if (proc.Service != null) { SysCallManager.SetCommand((SysCallTarget)args.Arg1, RegisteredService, proc); } return(0); }
/// <summary> /// Command is handled by another Service (up call) /// </summary> internal static uint RegisteredService(ref SysCallContext context, ref SystemMessage args) { var handler = SysCallManager.GetHandler(args.Target); var targetProcess = handler.Process; if (targetProcess.Service != null) { targetProcess.Service.SwitchToThreadMethod(ref context, ref args); } // Will reach only, if callingMethod==Action return(0); }
internal static uint GetProcessIDForCommand(ref SysCallContext context, ref SystemMessage args) { var handler = SysCallManager.GetHandler((SysCallTarget)args.Arg1); if (handler == null) { KernelMessage.WriteLine("GetProcessIDForCommand {0}: UNKNOWN", args.Arg1); return(unchecked ((uint)-1)); } var proc = handler.Process; if (proc == null) { proc = ProcessManager.System; } KernelMessage.WriteLine("Return ProcessID {0} for Command {1}", proc.ProcessID, (uint)handler.CommandID); return((uint)proc.ProcessID); }