コード例 #1
0
        internal void ResetSecurity(IntPtr handle)
        {
            if (null == securityHelper)
            {
                securityHelper = (IWmiSec) new WmiSec();
            }

            securityHelper.ResetSecurity(handle);
        }
コード例 #2
0
        internal bool SetSecurity(ref IntPtr handle)
        {
            bool needToReset = false;

            if (null == securityHelper)
            {
                securityHelper = (IWmiSec) new WmiSec();
            }

            securityHelper.SetSecurity(ref needToReset, ref handle);
            return(needToReset);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
                }
            }
        }
コード例 #6
0
        //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;
        }