Ejemplo n.º 1
0
 /// <summary>
 ///  The SamrSetInformationAlias method  updates attributes
 ///  on an alias object. Opnum: 29 
 /// </summary>
 /// <param name="AliasHandle">
 ///  An RPC context handle, as specified in section , representing
 ///  an alias object.
 /// </param>
 /// <param name="AliasInformationClass">
 ///  An enumeration indicating which attributes to update.
 ///  See section  for a listing of possible values.
 /// </param>
 /// <param name="Buffer">
 ///  The requested attributes and values to update. See section
 ///   for structure details.
 /// </param>
 /// <returns>
 /// status of the function call, for example: 0 indicates STATUS_SUCCESS
 /// </returns>
 public int SamrSetInformationAlias(System.IntPtr AliasHandle,
     _ALIAS_INFORMATION_CLASS AliasInformationClass,
     //[Switch("AliasInformationClass")]
     _SAMPR_ALIAS_INFO_BUFFER Buffer)
 {
     return rpc.SamrSetInformationAlias(AliasHandle, AliasInformationClass, Buffer);
 }
        /// <summary>
        ///  The SamrQueryInformationAlias method obtains attributes
        ///  from an alias object. Opnum: 28 
        /// </summary>
        /// <param name="AliasHandle">
        ///  An RPC context handle, as specified in section , representing
        ///  an alias object.
        /// </param>
        /// <param name="AliasInformationClass">
        ///  An enumeration indicating which attributes to return.
        ///  See section  for a listing of possible values.
        /// </param>
        /// <param name="Buffer">
        ///  The requested attributes on output. See section  for
        ///  structure details.
        /// </param>
        /// <returns>
        /// status of the function call, for example: 0 indicates STATUS_SUCCESS
        /// </returns>
        public int SamrQueryInformationAlias(
            IntPtr AliasHandle,
            _ALIAS_INFORMATION_CLASS AliasInformationClass,
            out _SAMPR_ALIAS_INFO_BUFFER? Buffer)
        {
            const ushort opnum = 28;
            Int3264[] paramList;
            int retVal = 0;

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

            using (RpceInt3264Collection outParamList = RpceCall(paramList, opnum))
            {
                Buffer = TypeMarshal.ToNullableStruct<_SAMPR_ALIAS_INFO_BUFFER>(
                    Marshal.ReadIntPtr(outParamList[2]), AliasInformationClass, null, null);
                retVal = outParamList[3].ToInt32();
            }

            return retVal;
        }
        /// <summary>
        ///  The SamrSetInformationAlias method  updates attributes
        ///  on an alias object. Opnum: 29 
        /// </summary>
        /// <param name="AliasHandle">
        ///  An RPC context handle, as specified in section , representing
        ///  an alias object.
        /// </param>
        /// <param name="AliasInformationClass">
        ///  An enumeration indicating which attributes to update.
        ///  See section  for a listing of possible values.
        /// </param>
        /// <param name="Buffer">
        ///  The requested attributes and values to update. See section
        ///   for structure details.
        /// </param>
        /// <returns>
        /// status of the function call, for example: 0 indicates STATUS_SUCCESS
        /// </returns>
        public int SamrSetInformationAlias(
            IntPtr AliasHandle,
            _ALIAS_INFORMATION_CLASS AliasInformationClass,
            _SAMPR_ALIAS_INFO_BUFFER Buffer)
        {
            const ushort opnum = 29;
            Int3264[] paramList;
            int retVal = 0;

            SafeIntPtr pBuffer = TypeMarshal.ToIntPtr(Buffer, AliasInformationClass, null, null);

            paramList = new Int3264[] {
                AliasHandle,
                (int)AliasInformationClass,
                pBuffer,
                IntPtr.Zero
            };

            try
            {
                using (RpceInt3264Collection outParamList = RpceCall(paramList, opnum))
                {
                    retVal = outParamList[3].ToInt32();
                }
            }
            finally
            {
                pBuffer.Dispose();
            }

            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))
     {
         AliasHandle = inParams[0].ToIntPtr();
         AliasInformationClass = (_ALIAS_INFORMATION_CLASS)inParams[1].ToInt32();
         Buffer = TypeMarshal.ToStruct<_SAMPR_ALIAS_INFO_BUFFER>(
             inParams[2].ToIntPtr(), AliasInformationClass, null, null);
     }
 }