From 8aad4adb9c93793a7ecece31b680e63e20056982 Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Fri, 21 Jul 2017 18:14:22 +0300 Subject: [PATCH] Added SMB_COM_NT_CANCEL request implementation --- SMBLibrary/SMB1/Commands/NTCancelRequest.cs | 35 +++++++++++++++++++++ SMBLibrary/SMB1/Commands/SMB1Command.cs | 2 ++ SMBLibrary/SMB1/Enums/CommandName.cs | 1 + SMBLibrary/SMBLibrary.csproj | 1 + 4 files changed, 39 insertions(+) create mode 100644 SMBLibrary/SMB1/Commands/NTCancelRequest.cs diff --git a/SMBLibrary/SMB1/Commands/NTCancelRequest.cs b/SMBLibrary/SMB1/Commands/NTCancelRequest.cs new file mode 100644 index 0000000..bf78ad6 --- /dev/null +++ b/SMBLibrary/SMB1/Commands/NTCancelRequest.cs @@ -0,0 +1,35 @@ +/* Copyright (C) 2017 Tal Aloni . All rights reserved. + * + * You can redistribute this program and/or modify it under the terms of + * the GNU Lesser Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + */ +using System; +using System.Collections.Generic; +using System.Text; +using Utilities; + +namespace SMBLibrary.SMB1 +{ + /// + /// SMB_COM_NT_CANCEL Request + /// + public class NTCancelRequest : SMB1Command + { + public NTCancelRequest() + { + } + + public NTCancelRequest(byte[] buffer, int offset) : base(buffer, offset, false) + { + } + + public override CommandName CommandName + { + get + { + return CommandName.SMB_COM_NT_CANCEL; + } + } + } +} diff --git a/SMBLibrary/SMB1/Commands/SMB1Command.cs b/SMBLibrary/SMB1/Commands/SMB1Command.cs index d3370b7..516fda5 100644 --- a/SMBLibrary/SMB1/Commands/SMB1Command.cs +++ b/SMBLibrary/SMB1/Commands/SMB1Command.cs @@ -155,6 +155,8 @@ namespace SMBLibrary.SMB1 return new NTTransactSecondaryRequest(buffer, offset); case CommandName.SMB_COM_NT_CREATE_ANDX: return new NTCreateAndXRequest(buffer, offset, isUnicode); + case CommandName.SMB_COM_NT_CANCEL: + return new NTCancelRequest(buffer, offset); default: throw new NotImplementedException("SMB Command 0x" + commandName.ToString("X")); } diff --git a/SMBLibrary/SMB1/Enums/CommandName.cs b/SMBLibrary/SMB1/Enums/CommandName.cs index a5775d9..591b586 100644 --- a/SMBLibrary/SMB1/Enums/CommandName.cs +++ b/SMBLibrary/SMB1/Enums/CommandName.cs @@ -35,6 +35,7 @@ namespace SMBLibrary.SMB1 SMB_COM_NT_TRANSACT = 0xA0, SMB_COM_NT_TRANSACT_SECONDARY = 0xA1, SMB_COM_NT_CREATE_ANDX = 0xA2, + SMB_COM_NT_CANCEL = 0xA4, SMB_COM_NO_ANDX_COMMAND = 0xFF, } } diff --git a/SMBLibrary/SMBLibrary.csproj b/SMBLibrary/SMBLibrary.csproj index 98467e4..8a22625 100644 --- a/SMBLibrary/SMBLibrary.csproj +++ b/SMBLibrary/SMBLibrary.csproj @@ -289,6 +289,7 @@ +