/// <summary> /// Deep copy constructor. /// </summary> public SmbCloseResponsePacket(SmbCloseResponsePacket packet) : base(packet) { this.InitDefaultValue(); this.smbParameters.WordCount = packet.SmbParameters.WordCount; this.smbData.ByteCount = packet.SmbData.ByteCount; }
/// <summary> /// server response the close request from client. /// </summary> /// <param name="open">the file open between server and client</param> public override void SendCloseResponse(IFileServiceServerOpen open) { CifsServerPerConnection connection = open.TreeConnect.Session.Connection as CifsServerPerConnection; foreach (SmbCloseRequestPacket request in connection.PendingRequestTable) { if (request != null && request.SmbHeader.Uid == open.TreeConnect.Session.SessionId && request.SmbHeader.Tid == open.TreeConnect.TreeConnectId && request.SmbParameters.FID == open.FileId) { SmbCloseResponsePacket response = this.cifsServer.CreateCloseResponse(connection, request); this.cifsServer.SendPacket(response, connection); return; } } }
public SmbCloseResponsePacket CreateCloseResponse( CifsServerPerConnection connection, SmbCloseRequestPacket request) { SmbCloseResponsePacket response = new SmbCloseResponsePacket(); response.SmbHeader = CifsMessageUtils.CreateSmbHeader(connection, request); return response; }