internal void ResetSecurity(IntPtr handle) { if (null == securityHelper) { securityHelper = (IWmiSec) new WmiSec(); } securityHelper.ResetSecurity(handle); }
internal bool SetSecurity(ref IntPtr handle) { bool needToReset = false; if (null == securityHelper) { securityHelper = (IWmiSec) new WmiSec(); } securityHelper.SetSecurity(ref needToReset, ref handle); return(needToReset); }
internal void Secure(IWbemServices wbemServices) { if (null == securityHelper) { securityHelper = (IWmiSec) new WmiSec(); } securityHelper.BlessIWbemServices( ref wbemServices, options.Username, options.GetPassword(), options.Authority, (int)options.Impersonation, (int)options.Authentication); }
internal void Secure(IEnumWbemClassObject wbemEnum) { if (null == securityHelper) { securityHelper = (IWmiSec) new WmiSec(); } securityHelper.BlessIEnumWbemClassObject( ref wbemEnum, options.Username, options.GetPassword(), options.Authority, (int)options.Impersonation, (int)options.Authentication); }
internal SecurityHandler(ManagementScope theScope) { this.scope = theScope; if (null == securityHelper) { securityHelper = (IWmiSec)MTAHelper.CreateInMTA(typeof(WmiSec)); //new WmiSec(); } if (null != scope) { if (scope.Options.EnablePrivileges) { securityHelper.SetSecurity(ref needToReset, ref handle); } } }
//Internal constructor internal ManagementScope(ManagementPath path, IWbemServices wbemServices, IWmiSec securityHelper, ConnectionOptions options) { if (null != path) { this.Path = path; } if (null != options) { this.Options = options; } // We set this.wbemServices after setting Path and Options // because the latter operations can cause wbemServices to be NULLed. this.wbemServices = wbemServices; // this.securityHelper = securityHelper; }