Ejemplo n.º 1
0
 /// <summary>
 /// Deep copy constructor.
 /// </summary>
 public SmbTrans2QueryPathInformationFinalResponsePacket(
     SmbTrans2QueryPathInformationFinalResponsePacket packet)
     : base(packet)
 {
     this.InitDefaultValue();
     this.trans2Parameters.EaErrorOffset = packet.trans2Parameters.EaErrorOffset;
     this.trans2Data.Data  = packet.trans2Data.Data;
     this.informationLevel = packet.informationLevel;
 }
 /// <summary>
 /// Deep copy constructor.
 /// </summary>
 public SmbTrans2QueryPathInformationFinalResponsePacket(
         SmbTrans2QueryPathInformationFinalResponsePacket packet)
     : base(packet)
 {
     this.InitDefaultValue();
     this.trans2Parameters.EaErrorOffset = packet.trans2Parameters.EaErrorOffset;
     this.trans2Data.Data = packet.trans2Data.Data;
     this.informationLevel = packet.informationLevel;
 }
        public SmbTrans2QueryPathInformationFinalResponsePacket CreateTrans2QueryPathInformationFinalResponse(
            CifsServerPerConnection connection,
            SmbTrans2QueryPathInformationRequestPacket request,
            object queryInformationLevel)
        {
            if (queryInformationLevel != null &&
                !CheckInformationLevel(request.Trans2Parameters.InformationLevel, queryInformationLevel))
            {
                throw new InvalidCastException("The findInformationLevel must correspond with "
                    + request.Trans2Parameters.InformationLevel);
            }

            SmbTrans2QueryPathInformationFinalResponsePacket response = new SmbTrans2QueryPathInformationFinalResponsePacket();
            response.SmbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);

            TRANS2_QUERY_PATH_INFORMATION_Response_Trans2_Parameters trans2Parameters = response.Trans2Parameters;
            trans2Parameters.EaErrorOffset = 0x0000;
            response.Trans2Parameters = trans2Parameters;

            TRANS2_QUERY_PATH_INFORMATION_Response_Trans2_Data trans2Data = response.Trans2Data;
            trans2Data.Data = queryInformationLevel;
            response.Trans2Data = trans2Data;

            response.UpdateCountAndOffset();

            return response;
        }