コード例 #1
0
        /// <summary>
        /// Deep copy constructor.
        /// </summary>
        public SmbWriteAndUnlockResponsePacket(SmbWriteAndUnlockResponsePacket packet)
            : base(packet)
        {
            this.InitDefaultValue();

            this.smbParameters.WordCount           = packet.SmbParameters.WordCount;
            this.smbParameters.CountOfBytesWritten = packet.SmbParameters.CountOfBytesWritten;

            this.smbData.ByteCount = packet.SmbData.ByteCount;
        }
        /// <summary>
        /// Deep copy constructor.
        /// </summary>
        public SmbWriteAndUnlockResponsePacket(SmbWriteAndUnlockResponsePacket packet)
            : base(packet)
        {
            this.InitDefaultValue();

            this.smbParameters.WordCount = packet.SmbParameters.WordCount;
            this.smbParameters.CountOfBytesWritten = packet.SmbParameters.CountOfBytesWritten;

            this.smbData.ByteCount = packet.SmbData.ByteCount;
        }
コード例 #3
0
        public SmbWriteAndUnlockResponsePacket CreateWriteAndUnlockResponse(
            CifsServerPerConnection connection,
            SmbWriteAndUnlockRequestPacket request)
        {
            SmbWriteAndUnlockResponsePacket response = new SmbWriteAndUnlockResponsePacket();
            response.SmbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);

            SMB_COM_WRITE_AND_UNLOCK_Response_SMB_Parameters smbParameters = response.SmbParameters;
            smbParameters.CountOfBytesWritten = request.SmbParameters.CountOfBytesToWrite;
            smbParameters.WordCount = (byte)(TypeMarshal.GetBlockMemorySize(smbParameters) / 2);
            response.SmbParameters = smbParameters;

            return response;
        }