public static SecurityProviderHealth QuerySecurityProviderHealth(SecurityProviders provider) { SecurityProviderHealth result; var queryResult = NativeMethods.WscGetSecurityProviderHealth(provider, out result); if (queryResult == 0) return result; // this means that the security center service is disabled if (queryResult == 1 && result == SecurityProviderHealth.Poor) { Log.Warn("Windows reports that the security center service is disabled"); return result; } throw new Exception(string.Format("Unable to query {0} health: issue {1}", provider, queryResult)); }
internal static extern int WscGetSecurityProviderHealth(SecurityProviders providers, [Out] out SecurityProviderHealth health);