From 4cb219f61ffa8e80f83ce5d9634eb9511a80e2a7 Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Wed, 22 Feb 2017 20:44:15 +0200 Subject: [PATCH] Added NT_TRANSACT_NOTIFY_CHANGE response implementation --- .../NTTransactNotifyChangeResponse.cs | 53 +++++++++++++++++++ SMBLibrary/SMBLibrary.csproj | 1 + 2 files changed, 54 insertions(+) create mode 100644 SMBLibrary/SMB1/NTTransactSubcommands/NTTransactNotifyChangeResponse.cs diff --git a/SMBLibrary/SMB1/NTTransactSubcommands/NTTransactNotifyChangeResponse.cs b/SMBLibrary/SMB1/NTTransactSubcommands/NTTransactNotifyChangeResponse.cs new file mode 100644 index 0000000..04a5247 --- /dev/null +++ b/SMBLibrary/SMB1/NTTransactSubcommands/NTTransactNotifyChangeResponse.cs @@ -0,0 +1,53 @@ +/* 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 Utilities; + +namespace SMBLibrary.SMB1 +{ + /// + /// NT_TRANSACT_NOTIFY_CHANGE Response + /// + public class NTTransactNotifyChangeResponse : NTTransactSubcommand + { + // Parameters: + public byte[] FileNotifyInformationBytes; + + public NTTransactNotifyChangeResponse() : base() + { + } + + public NTTransactNotifyChangeResponse(byte[] parameters) : base() + { + FileNotifyInformationBytes = parameters; + } + + public override byte[] GetParameters(bool isUnicode) + { + return FileNotifyInformationBytes; + } + + public List GetFileNotifyInformation() + { + return FileNotifyInformation.ReadList(FileNotifyInformationBytes, 0); + } + + public void SetFileNotifyInformation(List notifyInformationList) + { + FileNotifyInformationBytes = FileNotifyInformation.GetBytes(notifyInformationList); + } + + public override NTTransactSubcommandName SubcommandName + { + get + { + return NTTransactSubcommandName.NT_TRANSACT_NOTIFY_CHANGE; + } + } + } +} diff --git a/SMBLibrary/SMBLibrary.csproj b/SMBLibrary/SMBLibrary.csproj index 5d274f8..eb9f53c 100644 --- a/SMBLibrary/SMBLibrary.csproj +++ b/SMBLibrary/SMBLibrary.csproj @@ -364,6 +364,7 @@ +