/// <summary>
 /// to decode the smb parameters: from the general SmbParameters to the concrete Smb Parameters.
 /// </summary>
 protected override void DecodeParameters()
 {
     this.smbParameters = TypeMarshal.ToStruct<SMB_COM_NT_CANCEL_Request_SMB_Parameters>(
         TypeMarshal.ToBytes(this.smbParametersBlock));
 }
        /// <summary>
        /// to create a NtCancel request packet.
        /// </summary>
        /// <param name="pid">the PID of the pending request(s) to be cancelled.</param>
        /// <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 NtCancel request packet</returns>
        public SmbNtCancelRequestPacket CreateNtCancelRequest(
            uint pid,
            ushort messageId,
            ushort uid,
            ushort treeId,
            SmbFlags flags,
            SmbFlags2 flags2)
        {
            SmbNtCancelRequestPacket packet = new SmbNtCancelRequestPacket();

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

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

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

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

            return packet;
        }