コード例 #1
0
        public System.UInt32 SetSecurityDescriptor(Win32SecurityDescriptor inDescriptor)
        {
            var parameters = new CimMethodParametersCollection();

            if (inDescriptor != null)
            {
                parameters.Add(CimMethodParameter.Create("Descriptor", inDescriptor.AsCimInstance(), CimType.Instance, inDescriptor == null ? CimFlags.NullValue : CimFlags.None));
            }
            var result = InfrastuctureObjectScope.CimSession.InvokeMethod(InnerCimInstance, "SetSecurityDescriptor", parameters);

            return((System.UInt32)result.ReturnValue.Value);
        }
コード例 #2
0
        public System.UInt32 SetShareInfo(Win32SecurityDescriptor inAccess, System.String inDescription, System.UInt32?inMaximumAllowed)
        {
            var parameters = new CimMethodParametersCollection();

            if (inAccess != null)
            {
                parameters.Add(CimMethodParameter.Create("Access", inAccess.AsCimInstance(), CimType.Instance, inAccess == null ? CimFlags.NullValue : CimFlags.None));
            }
            if (inDescription != null)
            {
                parameters.Add(CimMethodParameter.Create("Description", inDescription, CimType.String, inDescription == null ? CimFlags.NullValue : CimFlags.None));
            }
            if (inMaximumAllowed.HasValue)
            {
                parameters.Add(CimMethodParameter.Create("MaximumAllowed", inMaximumAllowed.Value, CimFlags.None));
            }
            var result = InfrastuctureObjectScope.CimSession.InvokeMethod(InnerCimInstance, "SetShareInfo", parameters);

            return((System.UInt32)result.ReturnValue.Value);
        }
コード例 #3
0
        public (System.UInt32 retval, System.String outStopFileName) ChangeSecurityPermissionsEx(System.UInt32?inOption, System.Boolean?inRecursive, Win32SecurityDescriptor inSecurityDescriptor, System.String inStartFileName)
        {
            var parameters = new CimMethodParametersCollection();

            if (inOption.HasValue)
            {
                parameters.Add(CimMethodParameter.Create("Option", inOption.Value, CimFlags.None));
            }
            if (inRecursive.HasValue)
            {
                parameters.Add(CimMethodParameter.Create("Recursive", inRecursive.Value, CimFlags.None));
            }
            if (inSecurityDescriptor != null)
            {
                parameters.Add(CimMethodParameter.Create("SecurityDescriptor", inSecurityDescriptor.AsCimInstance(), CimType.Instance, inSecurityDescriptor == null ? CimFlags.NullValue : CimFlags.None));
            }
            if (inStartFileName != null)
            {
                parameters.Add(CimMethodParameter.Create("StartFileName", inStartFileName, CimType.String, inStartFileName == null ? CimFlags.NullValue : CimFlags.None));
            }
            var result = InfrastuctureObjectScope.CimSession.InvokeMethod(InnerCimInstance, "ChangeSecurityPermissionsEx", parameters);

            return((System.UInt32)result.ReturnValue.Value, (System.String)result.OutParameters["StopFileName"].Value);
        }