/// <summary>
        /// Deep copy constructor.
        /// </summary>
        public SmbTrans2Open2FinalResponsePacket(SmbTrans2Open2FinalResponsePacket packet)
            : base(packet)
        {
            this.InitDefaultValue();

            this.trans2Parameters.Fid = packet.trans2Parameters.Fid;
            this.trans2Parameters.FileAttributes = packet.trans2Parameters.FileAttributes;
            this.trans2Parameters.CreationTime = packet.trans2Parameters.CreationTime;
            this.trans2Parameters.FileDataSize = packet.trans2Parameters.FileDataSize;
            this.trans2Parameters.AccessMode = packet.trans2Parameters.AccessMode;
            this.trans2Parameters.ResourceType = packet.trans2Parameters.ResourceType;
            this.trans2Parameters.NMPipeStatus = packet.trans2Parameters.NMPipeStatus;
            this.trans2Parameters.OpenResults = packet.trans2Parameters.OpenResults;
            this.trans2Parameters.Reserved = packet.trans2Parameters.Reserved;
            this.trans2Parameters.ExtendedAttributeErrorOffset =
                packet.trans2Parameters.ExtendedAttributeErrorOffset;
            this.trans2Parameters.ExtendedAttributeLength = packet.trans2Parameters.ExtendedAttributeLength;
        }
コード例 #2
0
        /// <summary>
        /// Deep copy constructor.
        /// </summary>
        public SmbTrans2Open2FinalResponsePacket(SmbTrans2Open2FinalResponsePacket packet)
            : base(packet)
        {
            this.InitDefaultValue();

            this.trans2Parameters.Fid            = packet.trans2Parameters.Fid;
            this.trans2Parameters.FileAttributes = packet.trans2Parameters.FileAttributes;
            this.trans2Parameters.CreationTime   = packet.trans2Parameters.CreationTime;
            this.trans2Parameters.FileDataSize   = packet.trans2Parameters.FileDataSize;
            this.trans2Parameters.AccessMode     = packet.trans2Parameters.AccessMode;
            this.trans2Parameters.ResourceType   = packet.trans2Parameters.ResourceType;
            this.trans2Parameters.NMPipeStatus   = packet.trans2Parameters.NMPipeStatus;
            this.trans2Parameters.OpenResults    = packet.trans2Parameters.OpenResults;
            this.trans2Parameters.Reserved       = packet.trans2Parameters.Reserved;
            this.trans2Parameters.ExtendedAttributeErrorOffset =
                packet.trans2Parameters.ExtendedAttributeErrorOffset;
            this.trans2Parameters.ExtendedAttributeLength = packet.trans2Parameters.ExtendedAttributeLength;
        }
コード例 #3
0
        public SmbTrans2Open2FinalResponsePacket CreateTrans2Open2FinalResponse(
            CifsServerPerConnection connection,
            SmbTrans2Open2RequestPacket request,
            uint fileDataSize,
            FileTypeValue resourceType,
            SMB_NMPIPE_STATUS nmPipeStatus,
            OpenResultsValues actionTaken)
        {
            SmbTrans2Open2FinalResponsePacket response = new SmbTrans2Open2FinalResponsePacket();
            response.SmbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);

            TRANS2_OPEN2_Response_Trans2_Parameters trans2Parameters = response.Trans2Parameters;
            trans2Parameters.Fid = (ushort)connection.GenerateFID();
            trans2Parameters.FileAttributes = request.Trans2Parameters.FileAttributes;
            trans2Parameters.CreationTime = (uint)DateTime.Now.Millisecond;
            trans2Parameters.FileDataSize = fileDataSize;
            trans2Parameters.AccessMode = request.Trans2Parameters.AccessMode;
            trans2Parameters.ResourceType = resourceType;
            trans2Parameters.NMPipeStatus = nmPipeStatus;
            trans2Parameters.OpenResults = actionTaken;
            trans2Parameters.Reserved = 0x00000000;
            trans2Parameters.ExtendedAttributeErrorOffset = 0;
            trans2Parameters.ExtendedAttributeLength = request.Trans2Data.ExtendedAttributeList.SizeOfListInBytes;
            response.Trans2Parameters = trans2Parameters;

            response.UpdateCountAndOffset();

            return response;
        }