Ejemplo n.º 1
0
        public static void Initialize(XenGuestAgentLib.XenGuestServices service)
        {
            Program.AssertOffEventThread();
            Thread thread;
            string evname;
            EventWaitHandleSecurity evsec;
            EventWaitHandleAccessRule evrule;
            string user;
            xgsc = service;
            alertList = Program.GetAlertList();

            evname = xgsc.RegisterAlertsEvent();
            user = Environment.UserDomainName + "\\" + Environment.UserName;
            evalerts = EventWaitHandle.OpenExisting(evname,
                EventWaitHandleRights.ReadPermissions | EventWaitHandleRights.ChangePermissions);
            evsec = evalerts.GetAccessControl();
            evrule = new EventWaitHandleAccessRule(user,
                EventWaitHandleRights.Synchronize | EventWaitHandleRights.Modify,
                AccessControlType.Deny);
            evsec.RemoveAccessRule(evrule);

            evrule = new EventWaitHandleAccessRule(user,
                EventWaitHandleRights.Synchronize | EventWaitHandleRights.Modify,
                AccessControlType.Allow);
            evsec.AddAccessRule(evrule);
            evalerts.SetAccessControl(evsec);

            evalerts = EventWaitHandle.OpenExisting(evname);

            thread = new Thread(alertUpdater);
            thread.Name = "XenClient Alert Thread";
            thread.IsBackground = true;

            thread.Start();
        }
Ejemplo n.º 2
0
        public static void Initialize(XenGuestAgentLib.XenGuestServices service)
        {
            Program.AssertOffEventThread();
            Thread thread;
            string evname;
            EventWaitHandleSecurity   evsec;
            EventWaitHandleAccessRule evrule;
            string user;

            xgsc      = service;
            alertList = Program.GetAlertList();

            evname   = xgsc.RegisterAlertsEvent();
            user     = Environment.UserDomainName + "\\" + Environment.UserName;
            evalerts = EventWaitHandle.OpenExisting(evname,
                                                    EventWaitHandleRights.ReadPermissions | EventWaitHandleRights.ChangePermissions);
            evsec  = evalerts.GetAccessControl();
            evrule = new EventWaitHandleAccessRule(user,
                                                   EventWaitHandleRights.Synchronize | EventWaitHandleRights.Modify,
                                                   AccessControlType.Deny);
            evsec.RemoveAccessRule(evrule);

            evrule = new EventWaitHandleAccessRule(user,
                                                   EventWaitHandleRights.Synchronize | EventWaitHandleRights.Modify,
                                                   AccessControlType.Allow);
            evsec.AddAccessRule(evrule);
            evalerts.SetAccessControl(evsec);

            evalerts = EventWaitHandle.OpenExisting(evname);

            thread              = new Thread(alertUpdater);
            thread.Name         = "XenClient Alert Thread";
            thread.IsBackground = true;

            thread.Start();
        }
Ejemplo n.º 3
0
 public string RegisterAlertsEvent()
 {
     return(xgsc.RegisterAlertsEvent());
 }