コード例 #1
0
 /// <summary>
 ///  The SamrGetDisplayEnumerationIndex2 method obtains an
 ///  index into an account-namesorted list of accounts,
 ///  such that the index is the position in the list of
 ///  the accounts whose account name best matches a client-provided
 ///  string. Opnum: 49 
 /// </summary>
 /// <param name="DomainHandle">
 ///  An RPC context handle, as specified in section , representing
 ///  a domain object.
 /// </param>
 /// <param name="DisplayInformationClass">
 ///  An enumeration indicating which set of objects to return
 ///  an index into (for a subsequent SamrQueryDisplayInformation3
 ///  method call).
 /// </param>
 /// <param name="Prefix">
 ///  A string matched against the account name to find a
 ///  starting point for an enumeration. The Prefix parameter
 ///  enables the client to obtain a listing of an account
 ///  from SamrQueryDisplayInformation3  such that the accounts
 ///  are returned in alphabetical order with respect to
 ///  their account name, starting with the account name
 ///  that most closely matches Prefix. See details later
 ///  in this section.
 /// </param>
 /// <param name="Index">
 ///  A value to use as input to SamrQueryDisplayInformation3
 ///   in order to control the accounts that are returned
 ///  from that method.
 /// </param>
 /// <returns>
 /// status of the function call, for example: 0 indicates STATUS_SUCCESS
 /// </returns>
 public int SamrGetDisplayEnumerationIndex2(System.IntPtr DomainHandle,
     _DOMAIN_DISPLAY_INFORMATION DisplayInformationClass,
     _RPC_UNICODE_STRING Prefix,
     out System.UInt32 Index)
 {
     return rpc.SamrGetDisplayEnumerationIndex2(DomainHandle, DisplayInformationClass, Prefix, out Index);
 }
コード例 #2
0
 /// <summary>
 ///  The SamrQueryDisplayInformation3 method obtains a listing
 ///  of accounts in name-sorted order, starting at a specified
 ///  index. Opnum: 51 
 /// </summary>
 /// <param name="DomainHandle">
 ///  An RPC context handle, as specified in section , representing
 ///  a domain object.
 /// </param>
 /// <param name="DisplayInformationClass">
 ///  An enumeration (see section) that indicates the type
 ///  of accounts, as well as the type of attributes on the
 ///  accounts, to return via the Buffer parameter.
 /// </param>
 /// <param name="Index">
 ///  A cursor into an account-namesorted list of accounts.
 /// </param>
 /// <param name="EntryCount">
 ///  The number of accounts that the client is requesting
 ///  on output.
 /// </param>
 /// <param name="PreferredMaximumLength">
 ///  The requested maximum number of bytes to return in Buffer;
 ///  this value overrides EntryCount if this value is reached
 ///  before EntryCount is reached.
 /// </param>
 /// <param name="TotalAvailable">
 ///  The number of bytes required to see a complete listing
 ///  of accounts specified by the DisplayInformationClass
 ///  parameter.
 /// </param>
 /// <param name="TotalReturned">
 ///  The number of bytes returned. This value is estimated
 ///  and is not accurate.  clients do not rely on the accuracy
 ///  of this value.
 /// </param>
 /// <param name="Buffer">
 ///  The accounts that are returned.
 /// </param>
 /// <returns>
 /// status of the function call, for example: 0 indicates STATUS_SUCCESS
 /// </returns>
 public int SamrQueryDisplayInformation3(System.IntPtr DomainHandle,
     _DOMAIN_DISPLAY_INFORMATION DisplayInformationClass,
     uint Index,
     uint EntryCount,
     uint PreferredMaximumLength,
     out System.UInt32 TotalAvailable,
     out System.UInt32 TotalReturned,
     //[Switch("DisplayInformationClass")]
     out _SAMPR_DISPLAY_INFO_BUFFER Buffer)
 {
     return rpc.SamrQueryDisplayInformation3(DomainHandle, DisplayInformationClass, Index,
         EntryCount, PreferredMaximumLength, out TotalAvailable, out TotalReturned, out Buffer);
 }
コード例 #3
0
        /// <summary>
        ///  The SamrGetDisplayEnumerationIndex2 method obtains an
        ///  index into an account-namesorted list of accounts,
        ///  such that the index is the position in the list of
        ///  the accounts whose account name best matches a client-provided
        ///  string. Opnum: 49 
        /// </summary>
        /// <param name="DomainHandle">
        ///  An RPC context handle, as specified in section , representing
        ///  a domain object.
        /// </param>
        /// <param name="DisplayInformationClass">
        ///  An enumeration indicating which set of objects to return
        ///  an index into (for a subsequent SamrQueryDisplayInformation3
        ///  method call).
        /// </param>
        /// <param name="Prefix">
        ///  A string matched against the account name to find a
        ///  starting point for an enumeration. The Prefix parameter
        ///  enables the client to obtain a listing of an account
        ///  from SamrQueryDisplayInformation3  such that the accounts
        ///  are returned in alphabetical order with respect to
        ///  their account name, starting with the account name
        ///  that most closely matches Prefix. See details later
        ///  in this section.
        /// </param>
        /// <param name="Index">
        ///  A value to use as input to SamrQueryDisplayInformation3
        ///   in order to control the accounts that are returned
        ///  from that method.
        /// </param>
        /// <returns>
        /// status of the function call, for example: 0 indicates STATUS_SUCCESS
        /// </returns>
        public int SamrGetDisplayEnumerationIndex2(
            IntPtr DomainHandle,
            _DOMAIN_DISPLAY_INFORMATION DisplayInformationClass,
            _RPC_UNICODE_STRING Prefix,
            out uint Index)
        {
            const ushort opnum = 49;
            Int3264[] paramList;
            int retVal = 0;

            SafeIntPtr pPrefix = TypeMarshal.ToIntPtr(Prefix);

            paramList = new Int3264[] {
                DomainHandle,
                (int)DisplayInformationClass,
                pPrefix,
                IntPtr.Zero,
                IntPtr.Zero
            };

            try
            {
                using (RpceInt3264Collection outParamList = RpceCall(paramList, opnum))
                {
                    Index = TypeMarshal.ToStruct<uint>(outParamList[3]);
                    retVal = outParamList[4].ToInt32();
                }
            }
            finally
            {
                pPrefix.Dispose();
            }

            return retVal;
        }
コード例 #4
0
        /// <summary>
        ///  The SamrQueryDisplayInformation3 method obtains a listing
        ///  of accounts in name-sorted order, starting at a specified
        ///  index. Opnum: 51 
        /// </summary>
        /// <param name="DomainHandle">
        ///  An RPC context handle, as specified in section , representing
        ///  a domain object.
        /// </param>
        /// <param name="DisplayInformationClass">
        ///  An enumeration (see section) that indicates the type
        ///  of accounts, as well as the type of attributes on the
        ///  accounts, to return via the Buffer parameter.
        /// </param>
        /// <param name="Index">
        ///  A cursor into an account-namesorted list of accounts.
        /// </param>
        /// <param name="EntryCount">
        ///  The number of accounts that the client is requesting
        ///  on output.
        /// </param>
        /// <param name="PreferredMaximumLength">
        ///  The requested maximum number of bytes to return in Buffer;
        ///  this value overrides EntryCount if this value is reached
        ///  before EntryCount is reached.
        /// </param>
        /// <param name="TotalAvailable">
        ///  The number of bytes required to see a complete listing
        ///  of accounts specified by the DisplayInformationClass
        ///  parameter.
        /// </param>
        /// <param name="TotalReturned">
        ///  The number of bytes returned. This value is estimated
        ///  and is not accurate.  clients do not rely on the accuracy
        ///  of this value.
        /// </param>
        /// <param name="Buffer">
        ///  The accounts that are returned.
        /// </param>
        /// <returns>
        /// status of the function call, for example: 0 indicates STATUS_SUCCESS
        /// </returns>
        public int SamrQueryDisplayInformation3(
            IntPtr DomainHandle,
            _DOMAIN_DISPLAY_INFORMATION DisplayInformationClass,
            uint Index,
            uint EntryCount,
            uint PreferredMaximumLength,
            out uint TotalAvailable,
            out uint TotalReturned,
            out _SAMPR_DISPLAY_INFO_BUFFER Buffer)
        {
            const ushort opnum = 51;
            Int3264[] paramList;
            int retVal = 0;

            paramList = new Int3264[] {
                DomainHandle,
                (int)DisplayInformationClass,
                Index,
                EntryCount,
                PreferredMaximumLength,
                IntPtr.Zero,
                IntPtr.Zero,
                IntPtr.Zero,
                IntPtr.Zero
            };

            using (RpceInt3264Collection outParamList = RpceCall(paramList, opnum))
            {
                TotalAvailable = TypeMarshal.ToStruct<uint>(outParamList[5]);
                TotalReturned = TypeMarshal.ToStruct<uint>(outParamList[6]);
                Buffer = TypeMarshal.ToStruct<_SAMPR_DISPLAY_INFO_BUFFER>(
                    outParamList[7], DisplayInformationClass, null, null);
                retVal = outParamList[8].ToInt32();
            }

            return retVal;
        }
 /// <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))
     {
         DomainHandle = inParams[0].ToIntPtr();
         DisplayInformationClass = (_DOMAIN_DISPLAY_INFORMATION)(inParams[1].ToInt32());
         Index = inParams[2].ToUInt32();
         EntryCount = inParams[3].ToUInt32();
         PreferredMaximumLength = inParams[4].ToUInt32();
     }
 }