public FCFS_scheduler(SchedulerUI GUI, ProcessList p)
 {
     this.GUI = GUI;
     this.process_queue = p.get_as_queue();
     this.process_list = p;
     this.clock_time = 0;
 }
Esempio n. 2
0
        private void ToolStrip_DetachProcess_Click(object sender, EventArgs e)
        {
            Int32 selectedCellCount = ProcessList.GetCellCount(DataGridViewElementStates.Selected);

            if (selectedCellCount > 0)
            {
                int    index    = ProcessList.SelectedRows[0].Index;
                string ProcName = Convert.ToString(ProcessList.Rows[index].Cells["ProcName"].Value);
                PS4.Target[TargetName].Process.Detach(ProcName);
                Thread.Sleep(400);
                LoadProcList();
            }
        }
 public void Remove(int id)
 {
     lock (_lock)
     {
         var p = ProcessList.Find(process => process.Id == id);
         if (p == null)
         {
             return;
         }
         p.Kill();
         ProcessList.Remove(p);
     }
 }
Esempio n. 4
0
        public override Result evaluate()
        {
            ProcessList.Sort(new EntryPointComparator());
            List <Process> activeprocesses = new List <Process>();
            int            currentTime     = 0;

            do
            {
                bool done = false;
                for (int i = 0; i < ProcessList.Count; i++)
                {
                    done = false;
                    if (currentTime == ProcessList[i].EntryMoment)
                    {
                        activeprocesses.Add(ProcessList[i]);
                        activeprocesses.Sort(new TimeRemainingComparator());
                    }
                    done = currentTime > ProcessList[i].EntryMoment;
                }
                if (activeprocesses.Count > 0)
                {
                    activeprocesses[0].TimeLeft -= 1;
                }
                currentTime++;
                if (activeprocesses.Count > 0 && activeprocesses[0].TimeLeft == 0)
                {
                    Process temp = ProcessList.Find((e) =>
                    {
                        return(e.Equals(activeprocesses[0]));
                    });
                    ProcessList.Find((e) =>
                    {
                        return(e.Equals(activeprocesses[0]));
                    }).WaitingTime = currentTime - temp.Duration - temp.EntryMoment;
                    activeprocesses.RemoveAt(0);
                    activeprocesses.Sort(new TimeRemainingComparator());
                }
                if (activeprocesses.Count == 0 && done)
                {
                    break;
                }
            } while (currentTime < 1000000);
            List <int> wait = new List <int>();

            foreach (Process i in ProcessList)
            {
                wait.Add(i.WaitingTime);
            }
            return(new Result(wait, Name));
        }
        private void Btn_AddProcess_Click(object sender, RoutedEventArgs e)
        {
            bool _checkName = ProcessList.SearchNameExist(TextBoxProcessName.Text);

            if (_checkName == false)
            {
                ProcessList.addProcess(TextBoxProcessName.Text);
                ProcessListDisplay.ItemsSource = ProcessList.ImportProcessList();
            }
            else if (_checkName == true)
            {
                System.Windows.MessageBox.Show("Name is already Exist");
            }
        }
Esempio n. 6
0
        //private void OnJobFinished(object sender, EventArgs eventArgs)
        //{
        //    //Interlocked.Decrement(ref runningJobs);
        //    //RaisePropertyChanged("RunningJobs");
        //}

        public void CheckStatus()
        {
            List <Process> remove = ProcessList.Where(p => p.HasExited).ToList();

            foreach (Process p in remove)
            {
                ProcessList.Remove(p);
            }

            if (ProcessList.Count < Processes && IsRunning)
            {
                StartOne();
            }
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            PS4RPC ps4 = new PS4RPC("192.168.1.107");

            ps4.Connect();

            ProcessList pl = ps4.GetProcessList();

            foreach (Process p in pl.processes)
            {
                Console.WriteLine(p.name);
            }

            Process p = pl.FindProcess("SceShellCore");

            ProcessInfo pi         = ps4.GetProcessInfo(p.pid);
            ulong       executable = 0;

            for (int i = 0; i < pi.entries.Length; i++)
            {
                MemoryEntry me = pi.entries[i];
                if (me.prot == 5)
                {
                    Console.WriteLine("executable base " + me.start.ToString("X"));
                    executable = me.start;
                    break;
                }
            }

            byte[] b = ps4.ReadMemory(p.pid, executable, 256);
            Console.Write(HexDump(b));

            ulong stub = ps4.InstallRPC(p.pid);

            ProcessInfo pi  = ps4.GetProcessInfo(p.pid);
            MemoryEntry vme = pi.FindEntry("libSceLibcInternal.sprx", true);

            // dissasemble libSceLibcInternal.sprx to get these offsets (4.05)
            int sys_getpid = (int)ps4.Call(p.pid, stub, vme.start + 0xE0);

            Console.WriteLine("sys_getpid: " + sys_getpid);

            int time = (int)ps4.Call(p.pid, stub, vme.start + 0x4430, 0);

            Console.WriteLine("time: " + time);

            ps4.Disconnect();

            Console.ReadKey();
        }
Esempio n. 8
0
        /*
         * 
         * This version of the function is used if we are reading in a file.
         * in the index 0 is the ID of the process if needed (p1, p2, p3, etc)
         * and in the index 1 is the memory in kb.
         * this can obviously be changed
         * - Chris A
         * 
         * */
        void GetProcesses()
        {
            string[] file = File.readAllLines();
            foreach (String line in file)
            {
                string[] l = line.Split('\t');
                if (l[0] == "Id") continue;

                Process obj = new Process();
                obj.ID = Convert.ToInt32(l[0]);
                obj.MemoryInKB = Convert.ToInt32(l[1]);
                ProcessList.Add(obj);
            }
        }
Esempio n. 9
0
        public virtual void SortList()
        {
            var rList = ProcessList.Where(t => t.State != State.Terminated).ToList();
            var tList = ProcessList.Where(t => t.State == State.Terminated);

            rList.Sort((p1, p2) =>
            {
                if (p1.Priority == p2.Priority)
                {
                    return(p1.LastRunTime > p2.LastRunTime ? 1 : -1);
                }
                return(p1.Priority < p2.Priority ? 1 : -1);
            });
            ProcessList = rList.Concat(tList).ToList();
        }
        private void createNewProcessList()
        {
            MyProces currentProcesInput = new MyProces();

            currentProcesInput.Name            = LabelInputName.Text;
            currentProcesInput.Path            = LabelInputPath.Text;
            currentProcesInput.MainWindowTitle = LabelInputName.Text;
            currentProcesInput.TimeIsCounted   = false;
            currentProcesInput.StartTime       = DateTime.Now;
            currentProcesInput.Time            = TimeSpan.Zero;

            ProcessList processList = ProcessList.Instance;

            processList.processes.Add(currentProcesInput);
        }
Esempio n. 11
0
 private void ProcessList_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ProcessList.SelectedIndex < 0)
     {
         buttonRemove.Enabled = false;
     }
     else
     {
         buttonRemove.Enabled = true;
         buttonAdd.Enabled    = true;
         ProcessName.Text     = ProcessList.Items[ProcessList.SelectedIndex].ToString();
         Time.Value           = TimeList[ProcessList.SelectedIndex];
         KillProcess.Checked  = ProcessList.GetItemChecked(ProcessList.SelectedIndex);
     }
 }
Esempio n. 12
0
        private void SelectProcess_FormClosing(object sender, FormClosingEventArgs e)
        {
            PS4.Target[TargetName].Events.ProcDetach     -= Events_ProcDetach;
            PS4.Target[TargetName].Events.ProcAttach     -= Events_ProcAttach;
            PS4.Target[TargetName].Events.ProcDie        -= Events_ProcDie;
            PS4.Target[TargetName].Events.TargetNewTitle -= Events_TargetNewTitle;

            Int32 selectedCellCount = ProcessList.GetCellCount(DataGridViewElementStates.Selected);

            if (selectedCellCount > 0)
            {
                int index = ProcessList.SelectedRows[0].Index;
                SelectedProcess = Convert.ToString(ProcessList.Rows[index].Cells["ProcName"].Value);
            }
        }
Esempio n. 13
0
        public void StartOne()
        {
            if (Jobs.Count == 0)
            {
                return;
            }
            Job job = Jobs.First();

            //Interlocked.Increment(ref runningJobs);
            //RaisePropertyChanged("RunningJobs");
            Jobs.Remove(job);
            job.Execute();
            ProcessList.Add(job.Process);
            // job.Process.Exited += OnJobFinished;
        }
Esempio n. 14
0
        private void saveChanges_Click(object sender, EventArgs e)
        {
            chromeAlertTime             = Int32.Parse(chromeTime.Text) * 1000;
            chromeMemoryUsage           = Int32.Parse(chromeThreshold.Text);
            IEAlertTime                 = Int32.Parse(IETime.Text) * 1000;
            IEMemoryUsage               = Int32.Parse(chromeThreshold.Text);
            idleCheckerTime             = Int32.Parse(idleAlertTime.Text) * 1000;
            guiActivityThreshold        = Int32.Parse(GuiAlertThreshold.Text);
            liveInfoTime                = Int32.Parse(liveInfoAlertTime.Text) * 1000;
            committedBytealert          = committedBytesAlert.Checked;
            ramAlertTime                = Int32.Parse(ramTime.Text) * 1000;
            ramPercentageAlert          = Int32.Parse(ramPercentageThreshold.Text);
            runningAppTime              = Int32.Parse(appAlertTime.Text) * 1000;
            runningApplicationThreshold = Int32.Parse(appAlertThreshold.Text);
            processExists               = processRunning.Text;
            if (guiAlertCheckbox.Checked)
            {
                guistate = true;
            }
            else
            {
                guistate = false;
            }
            if (committedBytesAlert.Checked)
            {
                committedBytealert = true;
            }
            else
            {
                committedBytealert = false;
            }
            if (killProcessCheckbox.Checked)
            {
                killProcess = true;
            }
            else
            {
                killProcess = false;
            }

            Browser          b = new Browser();
            IdleCheckForm    i = new IdleCheckForm();
            MemoryCounters   m = new MemoryCounters();
            SystemMemoryInfo s = new SystemMemoryInfo();
            ProcessList      p = new ProcessList();

            this.Close();
        }
Esempio n. 15
0
        public ControlViewModel(IRecordDirectoryObserver recordObserver,
                                IEventAggregator eventAggregator,
                                IAppConfiguration appConfiguration, RecordManager recordManager,
                                ISystemInfo systemInfo,
                                ProcessList processList,
                                ILogger <ControlViewModel> logger,
                                ApplicationState applicationState)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            _recordObserver   = recordObserver;
            _eventAggregator  = eventAggregator;
            _appConfiguration = appConfiguration;
            _recordManager    = recordManager;
            _systemInfo       = systemInfo;
            _processList      = processList;
            _logger           = logger;
            _applicationState = applicationState;

            //Commands
            DeleteRecordFileCommand          = new DelegateCommand(OnDeleteRecordFile);
            MoveRecordFileCommand            = new DelegateCommand(OnMoveRecordFile);
            DuplicateRecordFileCommand       = new DelegateCommand(OnDuplicateRecordFile);
            AcceptEditingDialogCommand       = new DelegateCommand(OnAcceptEditingDialog);
            CancelEditingDialogCommand       = new DelegateCommand(OnCancelEditingDialog);
            AddCpuInfoCommand                = new DelegateCommand(OnAddCpuInfo);
            AddGpuInfoCommand                = new DelegateCommand(OnAddGpuInfo);
            AddRamInfoCommand                = new DelegateCommand(OnAddRamInfo);
            DeleteRecordCommand              = new DelegateCommand(OnPressDeleteKey);
            OpenObservedFolderCommand        = new DelegateCommand(OnOpenObservedFolder);
            DeleteFolderCommand              = new DelegateCommand(OnDeleteFolder);
            OpenCreateSubFolderDialogCommand = new DelegateCommand(() =>
            {
                CreateFolderDialogIsOpen = true;
                TreeViewSubFolderName    = string.Empty;
                CreateFolderdialogIsOpenStream.OnNext(true);
            });
            SelectedRecordingsCommand      = new DelegateCommand <object>(OnSelectedRecordings);
            CreateFolderCommand            = new DelegateCommand(OnCreateSubFolder);
            CloseCreateFolderDialogCommand = new DelegateCommand(() =>
            {
                CreateFolderDialogIsOpen = false;
                CreateFolderdialogIsOpenStream.OnNext(false);
            }
                                                                 );
            ReloadRootFolderCommand = new DelegateCommand(() => TreeViewUpdateStream.OnNext(default));
Esempio n. 16
0
        public ProcessInfo?GetProcessInfo(string process_name)
        {
            ProcessList processList = MemoryHelper.GetProcessList();
            ProcessInfo?processInfo = null;

            foreach (Process process in processList.processes)
            {
                if (process.name == process_name)
                {
                    processInfo = MemoryHelper.GetProcessInfo(process.pid);
                    break;
                }
            }

            return(processInfo);
        }
        public IActionResult Post([FromBody] ProcessList item)
        {
            if (item == null)
            {
                return(BadRequest());
            }

            if (_context.ProcessList.Count(x => x.Exe == item.Exe && x.Filename == item.Filename) > 0)
            {
                return(NotFound());
            }

            _context.ProcessList.Add(item);
            _context.SaveChanges();
            return(new JsonResult(item));
        }
Esempio n. 18
0
        private void button3_Click(object sender, EventArgs e)
        {
            try {
                comboBox1.Items.Clear();

                pList = PS4.GetProcessList();
                foreach (Process p in pList.processes)
                {
                    comboBox1.Items.Add(p.name);
                }
            }
            catch (Exception) {
                label1.Text = "Error";
                MessageBox.Show("Unable to Grab Processes", "Are you connected?");
            }
        }
Esempio n. 19
0
        public ProcessInfo GetProcessInfo(String process_name)
        {
            ProcessList processList = Memory.ps4RPC.GetProcessList();
            ProcessInfo processInfo = null;

            foreach (Process process in processList.processes)
            {
                if (process.name == process_name)
                {
                    processInfo = Memory.ps4RPC.GetProcessInfo(process.pid);
                    break;
                }
            }

            return(processInfo);
        }
Esempio n. 20
0
 /// <summary>
 /// Default ctor
 /// </summary>
 /// <param name="wildcards"></param>
 internal TaskPoller(WildCardCollection wildcards, Rule[] rules, ILog logger)
 {
     this.logger = logger;
     Thread.CurrentThread.IsBackground = true;
     Thread.CurrentThread.Priority     = ThreadPriority.BelowNormal;
     this.Rules                 = rules;
     this.Events                = new ManualResetEvents();
     this.tmpEvents             = new ManualResetEvents();
     this.pollTimer             = new ProgTimer(TimerType.HashDelay);
     this.pollTimer.TimerFired += new HashTimerEventHandler(pollTimer_TimerFired);
     this.wildcards             = wildcards;
     Poll          = new ProcessList();
     CompletedDirs = new List <string>();
     Results       = new List <string>();
     CreateTasks();
 }
Esempio n. 21
0
        protected override void ConfigureContainer()
        {
            base.ConfigureContainer();

            // Vertical components
            Container.ConfigureSerilogILogger(Log.Logger);
            Container.Register <IEventAggregator, EventAggregator>(Reuse.Singleton, null, null, IfAlreadyRegistered.Replace, "EventAggregator");
            Container.Register <ISettingsStorage, JsonSettingsStorage>(Reuse.Singleton);
            Container.Register <IAppConfiguration, CapFrameXConfiguration>(Reuse.Singleton);
            Container.RegisterInstance <IFrametimeStatisticProviderOptions>(Container.Resolve <IAppConfiguration>());
            Container.RegisterInstance(new ApplicationState(), Reuse.Singleton);

            // Prism
            Container.Register <IRegionManager, RegionManager>(Reuse.Singleton, null, null, IfAlreadyRegistered.Replace, "RegionManager");

            // Core components
            Container.Register <IRecordDirectoryObserver, RecordDirectoryObserver>(Reuse.Singleton);
            Container.Register <IStatisticProvider, FrametimeStatisticProvider>(Reuse.Singleton);
            Container.Register <IFrametimeAnalyzer, FrametimeAnalyzer>(Reuse.Singleton);
            Container.Register <ICaptureService, PresentMonCaptureService>(Reuse.Singleton);
            Container.Register <IRTSSService, RTSSService>(Reuse.Singleton);
            Container.Register <IOverlayEntryCore, OverlayEntryCore>(Reuse.Singleton);
            Container.Register <IOverlayService, OverlayService>(Reuse.Singleton);
            Container.Register <IOnlineMetricService, OnlineMetricService>(Reuse.Singleton);
            Container.Register <ISensorService, SensorService>(Reuse.Singleton);
            Container.Register <ISensorConfig, SensorConfig>(Reuse.Singleton);
            Container.Register <ISensorEntryProvider, SensorEntryProvider>(Reuse.Singleton);
            Container.Register <IOverlayEntryProvider, OverlayEntryProvider>(Reuse.Singleton);
            Container.Register <IRecordManager, RecordManager>(Reuse.Singleton);
            Container.Register <ISystemInfo, SystemInfo>(Reuse.Singleton);
            Container.Register <IAppVersionProvider, AppVersionProvider>(Reuse.Singleton);
            Container.RegisterInstance <IWebVersionProvider>(new WebVersionProvider(), Reuse.Singleton);
            Container.Register <IUpdateCheck, UpdateCheck>(Reuse.Singleton);
            Container.Register <LoginManager>(Reuse.Singleton);
            Container.Register <ICloudManager, CloudManager>(Reuse.Singleton);
            Container.Register <LoginWindow>(Reuse.Transient);
            Container.RegisterInstance(ProcessList.Create(
                                           filename: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"CapFrameX\Resources\Processes.json"),
                                           appConfiguration: Container.Resolve <IAppConfiguration>()));
            Container.Register <SoundManager>(Reuse.Singleton);
            Container.Resolve <IEventAggregator>().GetEvent <PubSubEvent <AppMessages.OpenLoginWindow> >().Subscribe(_ => {
                var window = Container.Resolve <LoginWindow>();
                window.Show();
            });
            Container.Register <CaptureManager>(Reuse.Singleton);
        }
        /// <summary>
        /// Getting a process list.
        /// </summary>
        /// <returns> Lists with process.</returns>
        public ProcessList GetProcessListReports()
        {
            ProcessList    processList = new ProcessList();
            List <Process> processes   = new List <Process>();

            if (_windows.GetProcesses().Count == 0)
            {
            }

            foreach (var f in _windows.GetProcesses())
            {
                processes.Add(new Process(f.GetName(), f.GetId(), f.GetStartTime()));
            }
            processList.ProcessObjectList = processes;
            processList.Timestamp         = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds();
            return(processList);
        }
        private void btConnect_Click(object sender, EventArgs e)
        {
            try
            {
                ps4 = new PS4DBG(tbIPAddress.Text);
                ps4.Connect();

                ProcessList pl = ps4.GetProcessList();

                p = pl.FindProcess("SceShellUI");

                ProcessMap pi = ps4.GetProcessMaps(p.pid);
                executable = 0;
                for (int i = 0; i < pi.entries.Length; i++)
                {
                    MemoryEntry me = pi.entries[i];
                    if (me.prot == 5)
                    {
                        Console.WriteLine("executable base " + me.start.ToString("X"));
                        executable = me.start;
                        break;
                    }
                }

                stub = ps4.InstallRPC(p.pid);

                sceRegMgrGetInt_addr = executable + 0x3D55C0;
                sceRegMgrGetStr_addr = executable + 0x846B00;
                sceRegMgrGetBin_addr = executable + 0x848640;

                sceRegMgrSetInt_addr = executable + 0x848FB0;
                sceRegMgrSetStr_addr = executable + 0x84CFF0;
                sceRegMgrSetBin_addr = executable + 0x848650;


                if (ps4.IsConnected)
                {
                    toolStripStatusLabel1.Text = "Connected to " + tbIPAddress.Text + ". Click Get Users";
                    btGetUsers.Enabled         = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "Something went wrong and it's probably your fault ;-P");
            }
        }
Esempio n. 24
0
        public void RefreshReturnsAnOrderedListOfUniqueProcessIds()
        {
            var nm = new NativeMethodsMock {
                ProcessIds = new[] { 4, 3, 2, 1 }
            };
            var pl = new ProcessList(nm);

            pl.Refresh();

            var n = (int)_fiN.GetValue(pl);

            Assert.Equal(4, n);

            var buf = ((int[])_fiBuf.GetValue(pl)).Take(n).ToArray();

            Assert.Equal(new[] { 1, 2, 3, 4 }, buf);
        }
Esempio n. 25
0
        void BindingProcess()
        {
            try
            {
                var dispatcher = App.Current.Dispatcher;

                ProcessLogProxy.MessageAction = ((x) =>
                {
                    dispatcher.Invoke(() =>
                    {
                        ProcessList.Add(x);
                    });
                });
                ProcessLogProxy.SuccessMessage = ((x) =>
                {
                    dispatcher.Invoke(() =>
                    {
                        ProcessList.Add(new ProcessMsg(x, "Green"));
                    });
                });


                ProcessLogProxy.Error = (
                    (x) =>
                {
                    dispatcher.Invoke(() =>
                    {
                        ProcessList.Add(new ProcessMsg(x, "Red"));
                    });
                });

                ProcessLogProxy.Normal = (
                    x =>
                {
                    dispatcher.Invoke(() =>
                    {
                        ProcessList.Add(new ProcessMsg(x, "Blue"));
                    });
                });
            }
            catch (Exception e)
            {
                string msg = e.ToString();
                // to do nothing
            }
        }
Esempio n. 26
0
        protected override int RunProcess(Process process)
        {
            var before = process.CpuState.TimeUse;

            Cpu.RunToEnd();
            var after = Cpu.State.TimeUse;

            ProcessList.ForEach(increasePriority);
            SuspendedList.ForEach(increasePriority);

            if (process.Priority != Priority.RealTime && process.Priority > Priority.Low)
            {
                process.Priority--;
            }

            return(after - before);
        }
Esempio n. 27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LogFile"/> class.
        /// </summary>
        public LogFile()
            : base()
        {
            m_fileName            = DefaultFileName;
            m_fileSize            = DefaultFileSize;
            m_fileFullOperation   = DefaultFileFullOperation;
            m_logFilesDuration    = DefaultLogFilesDuration;
            m_persistSettings     = DefaultPersistSettings;
            m_settingsCategory    = DefaultSettingsCategory;
            m_textEncoding        = Encoding.Default;
            m_operationWaitHandle = new ManualResetEvent(true);
            m_savedFilesWithTime  = new Dictionary <DateTime, string>();
            m_logEntryQueue       = ProcessList <string> .CreateRealTimeQueue(WriteLogEntries);

            this.FileFull += LogFile_FileFull;
            m_logEntryQueue.ProcessException += ProcessExceptionHandler;
        }
Esempio n. 28
0
        public static string[] GameInfoArray()
        {
            PS4 = main.PS4;
            string procName  = "SceCdlgApp";
            string entryName = "libSceCdlgUtilServer.sprx";
            ulong  titleId   = 0xA0;
            ulong  version   = 0xC8;
            int    prot      = 3;

            string[] result = new string[2];

            try
            {
                PS4.Connect();
                ProcessList pl = PS4.GetProcessList();

                foreach (Process p in pl.processes)
                {
                    if (p.name == procName)
                    {
                        ProcessInfo pi = PS4.GetProcessInfo(p.pid);

                        for (int i = 0; i < pi.entries.Length; i++)
                        {
                            MemoryEntry me = pi.entries[i];

                            if (me.prot == prot && me.name == entryName)
                            {
                                result[0] = PS4.ReadString(p.pid, me.start + titleId);
                                result[1] = PS4.ReadString(p.pid, me.start + version);

                                return(result);
                            }
                        }
                    }
                }

                return(new string[] { null, null });
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(new string[] { null, null });
            }
        }
Esempio n. 29
0
 void GetProcesses()
 {
     try
     {
         Proccesses_ComboBox.Items.Clear();
         pList = ps4.GetProcessList();
         Process[] processes = pList.processes;
         foreach (Process process in processes)
         {
             Proccesses_ComboBox.Items.Add(process.name);
         }
     }
     catch (Exception)
     {
         CurrentStatus_Label.ForeColor = Color.Red;
         CurrentStatus_Label.Text      = "Unable to grab processes";
     }
 }
 public void GetPreFileDetail(PublishedFileId_t publishID)
 {    //GetPreFileDetail step 1
     try
     {
         if (publishID.m_PublishedFileId == 0)
         {
             ProcessList.Remove(this);
             return;
         }
         SteamAPICall_t handle = SteamRemoteStorage.GetPublishedFileDetails(publishID, 0);
         remoteStorageGetPublishedFileDetailsResult.Set(handle);
     }
     catch (Exception e)
     {
         Finish(_PublishID, null, false);
         Debug.Log("SteamGetPreFileDetailProcess GetPreFileDetail " + e.ToString());
     }
 }
Esempio n. 31
0
        public void AllocateMemory(string processName)
        {
            var process = ProcessList.Find(t => t.Name == processName);

            if (process == null)
            {
                process = SuspendedList.Find(t => t.Name == processName);
            }
            if (process == null)
            {
                throw new ProcessNotExistException();
            }

            var processSize = process.MemorySize;
            var hole        = FindHole(processSize);

            process.Memory = new MemoryAllocation(hole.Item1, hole.Item2, MemoryAllocationType.Process);
        }
Esempio n. 32
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LogFile"/> class.
        /// </summary>
        public LogFile()
            : base()
        {
            m_fileName = DefaultFileName;
            m_fileSize = DefaultFileSize;
            m_fileFullOperation = DefaultFileFullOperation;
            m_logFilesDuration = DefaultLogFilesDuration;
            m_persistSettings = DefaultPersistSettings;
            m_settingsCategory = DefaultSettingsCategory;
            m_textEncoding = Encoding.Default;
            m_operationWaitHandle = new ManualResetEvent(true);
            m_savedFilesWithTime = new Dictionary<DateTime, string>();
            m_logEntryQueue = ProcessList<string>.CreateRealTimeQueue(WriteLogEntries);

            this.FileFull += LogFile_FileFull;
            m_logEntryQueue.ProcessException += ProcessExceptionHandler;
        }
 //Constructor
 public HRRN_scheduler(SchedulerUI GUI, ProcessList process_list)
 {
     this.GUI = GUI;
     this.process_list = process_list.get_as_list();
     clock = 0;
 }
Esempio n. 34
0
 public OperatingSystem(IScheduler scheduler)
 {
     Scheduler = scheduler;
     Processes = new ProcessList();
     Threads = new ThreadList();
 }
Esempio n. 35
0
        /// <summary>
        /// Initializes the <see cref="ServiceBusService"/>.
        /// </summary>
        /// <exception cref="NotSupportedException">The specified <see cref="ProcessingMode"/> is not supported.</exception>
        public override void Initialize()
        {
            base.Initialize();
            if (m_publishQueue == null)
            {
                // Instantiate the process queue.
                if (m_processingMode == MessageProcessingMode.Parallel)
                    m_publishQueue = ProcessList<PublishContext>.CreateAsynchronousQueue(PublishMessages);
                else if (m_processingMode == MessageProcessingMode.Sequential)
                    m_publishQueue = ProcessList<PublishContext>.CreateRealTimeQueue(PublishMessages);
                else
                    throw new NotSupportedException(string.Format("Processing mode '{0}' is not supported", m_processingMode));

                // Start the process queue.
                m_publishQueue.Start();
            }
        }
Esempio n. 36
0
        public NavItem(NavigationItemInfo itemInfo, ProcessList procList)
        {
            if (itemInfo == null)
            {
                throw new ArgumentNullException("itemInfo");
            }

            if (procList == null)
            {
                throw new ArgumentNullException("procList");
            }

            Id = itemInfo.Id;
            Name = itemInfo.Name;
            SystemName = itemInfo.SystemName;
            ProcessSystemName = itemInfo.ProcessSystemName;
            Description = itemInfo.Description;
            BackgroundColor = ColorTranslator.ToHtml(Color.FromArgb((int)itemInfo.BackgroundColor));
            IsSystem = itemInfo.IsSystem;
            ProcessId = itemInfo.ProcessId;
            RuntimeId = itemInfo.RuntimeId;
            ProcessViewGuid = itemInfo.ProcessViewGuid;

            var processInfo = procList.FirstOrDefault(x => x.SystemName == this.SystemName);
            if (processInfo != null)
            {
                ProcessDescription = processInfo.ProcessDocumentation;
            }
        }
Esempio n. 37
0
        public NavGroup(NavigationGroupInfo groupInfo, ProcessList procList)
        {
            if (groupInfo == null)
            {
                throw new ArgumentNullException("groupInfo");
            }

            if (procList == null)
            {
                throw new ArgumentNullException("procList");
            }

            this.Id = groupInfo.Id;
            this.Name = groupInfo.Name;
            this.SystemName = groupInfo.SystemName;
            if (groupInfo.Icon != null && groupInfo.Icon.Length > 0)
            {
                this.Icon = Convert.ToBase64String(groupInfo.Icon);
            }

            var itemsList = new List<NavItem>();
            this.Items = itemsList;
 
            foreach (var item in groupInfo.NavigationItems)
            {
                if (item.ProcessId != null)
                {
                    itemsList.Add(new NavItem(item, procList));
                }
            }
        }