/// <summary>
        /// Create NTTransQueryQuota request for client to query quota on server. 
        /// </summary>
        /// <param name = "messageId">the id of message, used to identity the request and the server response. </param>
        /// <param name = "sessionUid">the valid session id, must be response by server of the session setup request. </param>
        /// <param name = "treeId">the valid tree connect id, must be response by server of the tree connect. </param>
        /// <param name = "flags">
        /// The Flags field contains individual flags, as specified in [CIFS] sections 2.4.2 and 3.1.1. 
        /// </param>
        /// <param name = "flags2">
        /// The Flags2 field contains individual bit flags that, depending on the negotiated SMB dialect, indicate   
        /// various client and server capabilities. 
        /// </param>
        /// <param name = "fileId">the valid file id to operation on, response by server. </param>
        /// <param name = "isReturnSingleEntry">
        /// Indicates only a single entry is to be returned instead of filling the entire buffer. 
        /// </param>
        /// <param name = "isRestartScan">Indicates that the scan of the quota information is to be restarted. </param>
        /// <param name = "sidListLength">
        /// Supplies the length in bytes of the SidList (see below), or 0 if there is no SidList. 
        /// </param>
        /// <param name = "startSidLength">
        /// Supplies the length in bytes of the StartSid (see below), or 0 if there is no StartSid. MUST be ignored by 
        /// the receiver if SidListLength is non-zero. 
        /// </param>
        /// <param name = "startSidOffset">
        /// Supplies the offset, in bytes, to the StartSid in the Parameter buffer 
        /// </param>
        /// <returns>a nt transaction query quota request packet </returns>
        private SmbNtTransQueryQuotaRequestPacket CreateNTTransQueryQuotaRequest(
            ushort messageId,
            ushort sessionUid,
            ushort treeId,
            SmbHeader_Flags_Values flags,
            SmbHeader_Flags2_Values flags2,
            ushort fileId,
            bool isReturnSingleEntry,
            bool isRestartScan,
            int sidListLength,
            int startSidLength,
            int startSidOffset)
        {
            SmbNtTransQueryQuotaRequestPacket packet = new SmbNtTransQueryQuotaRequestPacket();
            packet.SmbHeader = CifsMessageUtils.CreateSmbHeader(SmbCommand.SMB_COM_NT_TRANSACT,
                messageId, sessionUid, treeId, (SmbFlags)flags, (SmbFlags2)flags2);

            // Set Smb_Parameters
            SMB_COM_NT_TRANSACT_Request_SMB_Parameters smbParameters =
                new SMB_COM_NT_TRANSACT_Request_SMB_Parameters();
            smbParameters.MaxSetupCount = this.capability.MaxSetupCount;
            smbParameters.MaxParameterCount = this.capability.MaxParameterCount;
            smbParameters.MaxDataCount = this.capability.MaxDataCount;
            smbParameters.SetupCount = 0; // the correct count in word of the Setup is always 0.
            smbParameters.Function = (NtTransSubCommand)SmbNtTransSubCommand.NT_TRANSACT_QUERY_QUOTA;
            smbParameters.Setup = new ushort[0];
            smbParameters.WordCount = (byte)(CifsMessageUtils.GetSize<SMB_COM_NT_TRANSACT_Request_SMB_Parameters>(
                smbParameters) / SmbCapability.NUM_BYTES_OF_WORD);

            // Set Smb_Data
            SMB_COM_NT_TRANSACT_Request_SMB_Data smbData = new SMB_COM_NT_TRANSACT_Request_SMB_Data();

            // Set Nt Transaction Parameters
            NT_TRANSACT_QUERY_QUOTA_Request_NT_Trans_Parameters
                ntTransParameters = new NT_TRANSACT_QUERY_QUOTA_Request_NT_Trans_Parameters();
            ntTransParameters.Fid = fileId;
            if (isReturnSingleEntry)
            {
                ntTransParameters.ReturnSingleEntry = 0x01;
            }
            if (isRestartScan)
            {
                ntTransParameters.RestartScan = 0x01;
            }
            ntTransParameters.SidListLength = (uint)sidListLength;
            ntTransParameters.StartSidLength = (uint)startSidLength;
            ntTransParameters.StartSidOffset = (uint)startSidOffset;

            packet.SmbParameters = smbParameters;
            packet.SmbData = smbData;
            packet.NtTransParameters = ntTransParameters;
            packet.UpdateCountAndOffset();

            return packet;
        }
 /// <summary>
 /// to decode the NtTrans parameters: from the general NtTransParameters to the concrete NtTrans Parameters. 
 /// </summary>
 protected override void DecodeNtTransParameters()
 {
     this.ntTransParameters =
         CifsMessageUtils.ToStuct<NT_TRANSACT_QUERY_QUOTA_Request_NT_Trans_Parameters>(
         this.smbData.NT_Trans_Parameters);
 }