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

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

            this.smbParameters.WordCount = packet.SmbParameters.WordCount;
            this.smbData.ByteCount = packet.SmbData.ByteCount;
        }
        /// <summary>
        /// to create a QueryInformationDisk request packet.
        /// </summary>
        /// <param name="messageId">This field SHOULD be the multiplex ID that is used to associate a response with a
        /// request.</param>
        /// <param name="uid">This field SHOULD identify the authenticated instance of the user.</param>
        /// <param name="treeId">This field identifies the subdirectory (or tree) on the server that the client is
        /// accessing.</param>
        /// <param name="flags">An 8-bit field of 1-bit flags describing various features in effect for the
        /// message</param>
        /// <param name="flags2">A 16-bit field of 1-bit flags that represent various features in effect for the
        /// message. Unspecified bits are reserved and MUST be zero.</param>
        /// <returns>a QueryInformationDisk request packet</returns>
        public SmbQueryInformationDiskRequestPacket CreateQueryInformationDiskRequest(
            ushort messageId,
            ushort uid,
            ushort treeId,
            SmbFlags flags,
            SmbFlags2 flags2)
        {
            SmbQueryInformationDiskRequestPacket packet = new SmbQueryInformationDiskRequestPacket();

            packet.SmbHeader = CifsMessageUtils.CreateSmbHeader(SmbCommand.SMB_COM_QUERY_INFORMATION_DISK,
                messageId, uid, treeId, flags, flags2);

            SMB_COM_QUERY_INFORMATION_DISK_Request_SMB_Parameters smbParameters =
                new SMB_COM_QUERY_INFORMATION_DISK_Request_SMB_Parameters();
            smbParameters.WordCount = 0;

            SMB_COM_QUERY_INFORMATION_DISK_Request_SMB_Data smbData =
                new SMB_COM_QUERY_INFORMATION_DISK_Request_SMB_Data();
            smbData.ByteCount = 0;

            packet.SmbParameters = smbParameters;
            packet.SmbData = smbData;

            return packet;
        }
        public SmbQueryInformationDiskResponsePacket CreateQueryInformationDiskResponse(
            CifsServerPerConnection connection,
            SmbQueryInformationDiskRequestPacket request,
            ushort totalUnits,
            ushort blocksPerUnit,
            ushort blockSize,
            ushort freeUnits
            )
        {
            SmbQueryInformationDiskResponsePacket response = new SmbQueryInformationDiskResponsePacket();
            response.SmbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);

            SMB_COM_QUERY_INFORMATION_DISK_Response_SMB_Parameters smbParameters = response.SmbParameters;
            smbParameters.TotalUnits = totalUnits;
            smbParameters.BlocksPerUnit = blocksPerUnit;
            smbParameters.BlockSize = blockSize;
            smbParameters.FreeUnits = freeUnits;
            smbParameters.Reserved = 0x0000;
            smbParameters.WordCount = (byte)(TypeMarshal.GetBlockMemorySize(smbParameters) / 2);
            response.SmbParameters = smbParameters;

            return response;
        }