GetStatus() public method

public GetStatus ( ) : ManagementStatus
return ManagementStatus
Exemplo n.º 1
0
 void writeDevice(string device, NetworkInterface[] nics)
 {
     if (enablewritedevice)
     {
         string mac = wmisession.GetXenStoreItem(device + "/mac").value;
         foreach (NetworkInterface nic in nics)
         {
             if (macsMatch(mac, nic))
             {
                 XenStoreItem name = wmisession.GetXenStoreItem("data/vif/" + device.Substring(vifpath.Length + 1) + "/name");
                 name.value = nic.Name;
                 if (name.GetStatus() != ManagementStatus.NoError)
                 {
                     enablewritedevice = false;
                     return;
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
        void addHotFixInfoToStore()
        {
            uint index = 0;

            if (enablehotfixinfo)
            {
                foreach (ManagementObject mo in WmiBase.Singleton.Win32_QuickFixEngineering)
                {
                    // Ignore Hotfixes where the id has been replaced by "File 1"
                    // Because these hotfixes have been replaced
                    string id = (string)mo["HotFixID"];
                    if (!id.Equals("File 1"))
                    {
                        XenStoreItem hotfix = wmisession.GetXenStoreItem("attr/os/hotfixes/" + index.ToString());
                        hotfix.value = id;
                        if (hotfix.GetStatus() == ManagementStatus.AccessDenied)
                        {
                            enablehotfixinfo = false;
                        }
                        index++;
                    }
                }
            }
        }