Check() 공개 정적인 메소드

public static Check ( ) : bool
리턴 bool
예제 #1
0
        void ServiceThreadHandler()
        {
            try {
                Debug.Print("ServiceThreadHandler");
                needsShutdown.Reset();

                NetInfo.StoreChangedNetworkSettings();

                WmiBase.Reset();
                Debug.Print("WMI Check");
                if (WmiBase.Check())
                {
                    starting = true;
                    WmiCapableServiceThreadHandler();
                    starting = false;
                    running  = true;
                }
                else
                {
                    running = false;
                    WaitHandle[] waitHandles = new WaitHandle[]
                    {
                        (new WmiIncapableThread()).Incapable,
                        needsShutdown
                    };

                    Debug.Print("Waiting for WMI capability to begin");
                    try
                    {
                        EventLog.WriteEntry(Branding.Instance.getString("BRANDING_errNoWMI"));
                    }
                    catch { };

                    int activehandle = WaitHandle.WaitAny(waitHandles);
                    Debug.Print("Received event");

                    if (activehandle == 0)
                    {
                        try
                        {
                            EventLog.WriteEntry(Branding.Instance.getString("BRANDING_errNoWMI"));
                        }
                        catch { };
                        starting = true;
                        WmiCapableServiceThreadHandler();
                        starting = false;
                        running  = true;
                    }
                }
            }
            catch (Exception e) {
                HandleException("Main Service Thread", e);
            }
        }
예제 #2
0
        void ServiceThreadHandler()
        {
            try {
                Debug.Print("ServiceThreadHandler");
                needsShutdown.Reset();
                WmiBase.Reset();
                Debug.Print("WMI Check");
                if (WmiBase.Check())
                {
                    starting = true;
                    WmiCapableServiceThreadHandler();
                    starting = false;
                    running  = true;
                }
                else
                {
                    running = false;
                    WaitHandle[] waitHandles = new WaitHandle[]
                    {
                        (new WmiIncapableThread()).Incapable,
                        needsShutdown
                    };

                    Debug.Print("Waiting for WMI capability to begin");
                    try
                    {
                        EventLog.WriteEntry("Citrix Xen Guest Agent cannot find XenIface WMI interface");
                    }
                    catch { };

                    int activehandle = WaitHandle.WaitAny(waitHandles);
                    Debug.Print("Received event");

                    if (activehandle == 0)
                    {
                        try
                        {
                            EventLog.WriteEntry("Citrix Xen Guest Agent cannot find XenIface WMI interface");
                        }
                        catch { };
                        starting = true;
                        WmiCapableServiceThreadHandler();
                        starting = false;
                        running  = true;
                    }
                }
            }
            catch (Exception e) {
                HandleException("Main Service Thread", e);
            }
        }
예제 #3
0
 void WmiIncapableServiceThreadHandler(object nothing)
 {
     try {
         WmiBase.Reset();
         if (WmiBase.Check())
         {
             timer.Dispose();
             Incapable.Set();
         }
     }
     catch {
         timer.Dispose();
         Incapable.Set();
     }
 }