コード例 #1
0
        /// <summary>
        ///  The SamrQuerySecurityObject method queries the access
        ///  control on a server, domain, user, group, or alias
        ///  object. Opnum: 3 
        /// </summary>
        /// <param name="ObjectHandle">
        ///  An RPC context handle, as specified in section , representing
        ///  a server, domain, user, group, or alias object.
        /// </param>
        /// <param name="SecurityInformation">
        ///  A bit field that specifies which fields of SecurityDescriptor
        ///  the client is requesting to be returned. The SECURITY_INFORMATION
        ///  type is defined in [MS-DTYP] section. The following
        ///  bits are valid; all other bits MUST be zero on send
        ///  and ignored on receipt.
        /// </param>
        /// <param name="SecurityDescriptor">
        ///  A security descriptor expressing accesses that are specific
        ///  to the ObjectHandle and the owner and group of the
        ///  object. [MS-DTYP] section  contains the specification
        ///  for a valid security descriptor.
        /// </param>
        /// <returns>
        /// status of the function call, for example: 0 indicates STATUS_SUCCESS
        /// </returns>
        public int SamrQuerySecurityObject(
            IntPtr ObjectHandle,
            SamrQuerySecurityObject_SecurityInformation_Values SecurityInformation,
            out _SAMPR_SR_SECURITY_DESCRIPTOR? SecurityDescriptor)
        {
            const ushort opnum = 3;
            Int3264[] paramList;
            int retVal = 0;

            paramList = new Int3264[] {
                ObjectHandle,
                (int)SecurityInformation,
                IntPtr.Zero,
                IntPtr.Zero
            };

            using (RpceInt3264Collection outParamList = RpceCall(paramList, opnum))
            {
                IntPtr pSecurityDescriptor = Marshal.ReadIntPtr(outParamList[2]);
                SecurityDescriptor = TypeMarshal.ToNullableStruct<_SAMPR_SR_SECURITY_DESCRIPTOR>(
                    pSecurityDescriptor);
                retVal = outParamList[3].ToInt32();
            }

            return retVal;
        }
コード例 #2
0
 /// <summary>
 ///  The SamrQuerySecurityObject method queries the access
 ///  control on a server, domain, user, group, or alias
 ///  object. Opnum: 3 
 /// </summary>
 /// <param name="ObjectHandle">
 ///  An RPC context handle, as specified in section , representing
 ///  a server, domain, user, group, or alias object.
 /// </param>
 /// <param name="SecurityInformation">
 ///  A bit field that specifies which fields of SecurityDescriptor
 ///  the client is requesting to be returned. The SECURITY_INFORMATION
 ///  type is defined in [MS-DTYP] section. The following
 ///  bits are valid; all other bits MUST be zero on send
 ///  and ignored on receipt.
 /// </param>
 /// <param name="SecurityDescriptor">
 ///  A security descriptor expressing accesses that are specific
 ///  to the ObjectHandle and the owner and group of the
 ///  object. [MS-DTYP] section  contains the specification
 ///  for a valid security descriptor.
 /// </param>
 /// <returns>
 /// status of the function call, for example: 0 indicates STATUS_SUCCESS
 /// </returns>
 public int SamrQuerySecurityObject(System.IntPtr ObjectHandle,
     SamrQuerySecurityObject_SecurityInformation_Values SecurityInformation,
     out _SAMPR_SR_SECURITY_DESCRIPTOR? SecurityDescriptor)
 {
     return rpc.SamrQuerySecurityObject(ObjectHandle, SecurityInformation, out SecurityDescriptor);
 }
 /// <summary>
 ///  Decodes the request stub, and fills the fields of the class
 /// </summary>
 /// <param name="sessionContext">The session context of the request received</param>
 /// <param name="requestStub">The request stub got from RPCE layer</param>
 internal override void Decode(SamrServerSessionContext sessionContext, byte[] requestStub)
 {
     using (RpceInt3264Collection inParams = RpceStubDecoder.ToParamList(
    RpceStubHelper.GetPlatform(),
     SamrRpcStubFormatString.TypeFormatString,
     new RpceStubExprEval[]{
         new RpceStubExprEval(SamrRpcAdapter.samr_SAMPR_USER_LOGON_INFORMATIONExprEval_0000),
         new RpceStubExprEval(SamrRpcAdapter.samr_SAMPR_USER_LOGON_HOURS_INFORMATIONExprEval_0001),
         new RpceStubExprEval(SamrRpcAdapter.samr_SAMPR_USER_ACCOUNT_INFORMATIONExprEval_0002),
         new RpceStubExprEval(SamrRpcAdapter.samr_SAMPR_LOGON_HOURSExprEval_0003)},
     SamrRpcStubFormatString.ProcFormatString,
     SamrRpcStubFormatString.ProcFormatStringOffsetTable[(int)Opnum],
     false,
     requestStub))
     {
         ObjectHandle = inParams[0].ToIntPtr();
         SecurityInformation = (SamrQuerySecurityObject_SecurityInformation_Values)(inParams[1].ToInt32());
     }
 }