Ejemplo n.º 1
0
 public void Stop()
 {
     TraceLog.WriteLineInfo("Record Service stoping...");
     if (_tasks != null)
     {
         _tasks.Stop();
         _tasks = null;
     }
     TraceLog.WriteLineInfo("Record Service stoped.");
 }
Ejemplo n.º 2
0
        public void SessionLogon(int sessionId)
        {
            try
            {
                while (!WTSEngine.IsSessionActive(sessionId))
                {
                    System.Threading.Thread.Sleep(1000);
                }

                PeriodTask.PostMessage(Global.Tasks.RecordingSessions, sessionId);
            }
            catch (Exception ex) { TraceLog.WriteException(ex); }
        }
Ejemplo n.º 3
0
        public void Stop()
        {
            TraceLogger.Instance.WriteLineInfo("Record Service stoping...");
            if (_tasks != null)
            {
                _tasks.Stop();
                _tasks = null;
            }
            TraceLogger.Instance.WriteLineInfo("Record Service stoped.");

            if (_adminWeb != null)
            {
                TraceLogger.Instance.WriteLineInfo("Admin Service is stoping...");
                _adminWeb.Stop();
                _adminWeb = null;
                TraceLogger.Instance.WriteLineInfo("Admin Service is stoped.");
            }
        }
Ejemplo n.º 4
0
        public void Start()
        {
            TraceLog.WriteLineInfo("Privileges ajusting...");
            bool succeed = PrivilegeEngine.SetProcessPrivileges(Process.GetCurrentProcess().Id,
                                                                PrivilegeEngine.SE_ASSIGNPRIMARYTOKEN_NAME,
                                                                PrivilegeEngine.SE_INCREASE_QUOTA_NAME,
                                                                PrivilegeEngine.SE_TCB_NAME);

            TraceLog.WriteLineInfo("Privileges ajusted: " + succeed);

            TraceLog.WriteLineInfo("Record Service is starting...");
            _tasks = new PeriodTask(1000);
            _tasks.AddTask(Global.Tasks.UpdateConfigurations, this.UpdateConfigurations, null, 60, 0);
            _tasks.AddTask(Global.Tasks.RecordingSessions, this.RecordingSessions, null, 5, 10);

            //_tasks.AddTask("License", this.UpdateLicenseInfo, 60 * 60, 0);
            //_tasks.AddTask("Configuration", this.UpdateConfigurationFile, 60, 0);
            //_tasks.AddTask("Session", this.ScanWinSessionsToRecordOrEnd, 2, 10);
            //_tasks.AddTask("Storage", StorageEngine.ScanAndStoreCacheFiles, 5, 15);
            //_tasks.AddTask("Restrict", StorageEngine.ScanAndRestrictLocalStore, 60 * 60, 60 * 60);
            _tasks.Start();
            TraceLog.WriteLineInfo("Record Service is started.");
        }
Ejemplo n.º 5
0
        public void Start()
        {
            TraceLogger.Instance.WriteLineInfo("Privileges ajusting...");
            bool succeed = WTSEngine.SetProcessPrivileges(Process.GetCurrentProcess().Id,
                                                          bfbd.WindowsAPI.WTS.NtPrivileges.SE_ASSIGNPRIMARYTOKEN_NAME,
                                                          bfbd.WindowsAPI.WTS.NtPrivileges.SE_INCREASE_QUOTA_NAME,
                                                          bfbd.WindowsAPI.WTS.NtPrivileges.SE_TCB_NAME);

            TraceLogger.Instance.WriteLineInfo("Privileges ajusted: " + succeed);

            TraceLogger.Instance.WriteLineInfo("Record Service is starting...");
            _tasks = new PeriodTask(1000);
            _tasks.AddTask("License", this.UpdateLicenseInfo, 60 * 60, 0);
            _tasks.AddTask("Configuration", this.UpdateConfigurationFile, 60, 0);
            _tasks.AddTask("Session", this.ScanWinSessionsToRecordOrEnd, 2, 10);
            _tasks.AddTask("Storage", StorageEngine.ScanAndStoreCacheFiles, 5, 15);
            _tasks.AddTask("Restrict", StorageEngine.ScanAndRestrictLocalStore, 60 * 60, 60 * 60);
            _tasks.AddTask("AccessPolicy", this.UpdateWebAccessPolicy, 60, 0);
            _tasks.Start();
            TraceLogger.Instance.WriteLineInfo("Record Service is started.");

            if (Global.Config.AdminWebPort > 80)
            {
                try
                {
                    TraceLogger.Instance.WriteLineInfo("Admin Service is starting...");
                    _adminWeb = new Server.AdminServiceCore();
                    _adminWeb.Start();
                    TraceLogger.Instance.WriteLineInfo("Admin Service is started.");
                }
                catch (Exception ex)
                {
                    TraceLogger.Instance.WriteException(ex);
                    _adminWeb = null;
                }
            }
        }