diff --git a/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetExtendedAttributes.cs b/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetExtendedAttributes.cs index b9c150b..a264eb6 100644 --- a/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetExtendedAttributes.cs +++ b/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetExtendedAttributes.cs @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 Tal Aloni . All rights reserved. +/* Copyright (C) 2014-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, @@ -36,5 +36,13 @@ namespace SMBLibrary.SMB1 { return ExtendedAttributeList.GetBytes(); } + + public override SetInformationLevel InformationLevel + { + get + { + return SetInformationLevel.SMB_INFO_SET_EAS; + } + } } } diff --git a/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileAllocationInfo.cs b/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileAllocationInfo.cs index 82a62a8..b02fd58 100644 --- a/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileAllocationInfo.cs +++ b/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileAllocationInfo.cs @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 Tal Aloni . All rights reserved. +/* Copyright (C) 2014-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, @@ -39,5 +39,13 @@ namespace SMBLibrary.SMB1 LittleEndianWriter.WriteUInt64(buffer, 0, AllocationSize); return buffer; } + + public override SetInformationLevel InformationLevel + { + get + { + return SetInformationLevel.SMB_SET_FILE_ALLOCATION_INFO; + } + } } } diff --git a/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileBasicInfo.cs b/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileBasicInfo.cs index 3e61ea5..7404b08 100644 --- a/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileBasicInfo.cs +++ b/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileBasicInfo.cs @@ -54,5 +54,13 @@ namespace SMBLibrary.SMB1 LittleEndianWriter.WriteUInt32(buffer, 36, Reserved); return buffer; } + + public override SetInformationLevel InformationLevel + { + get + { + return SetInformationLevel.SMB_SET_FILE_BASIC_INFO; + } + } } } diff --git a/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileDispositionInfo.cs b/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileDispositionInfo.cs index 2a2e44a..e97dd1c 100644 --- a/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileDispositionInfo.cs +++ b/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileDispositionInfo.cs @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 Tal Aloni . All rights reserved. +/* Copyright (C) 2014-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, @@ -41,5 +41,13 @@ namespace SMBLibrary.SMB1 ByteWriter.WriteByte(buffer, 0, Convert.ToByte(DeletePending)); return buffer; } + + public override SetInformationLevel InformationLevel + { + get + { + return SetInformationLevel.SMB_SET_FILE_DISPOSITION_INFO; + } + } } } diff --git a/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileEndOfFileInfo.cs b/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileEndOfFileInfo.cs index ea05df0..62c03d0 100644 --- a/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileEndOfFileInfo.cs +++ b/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileEndOfFileInfo.cs @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 Tal Aloni . All rights reserved. +/* Copyright (C) 2014-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, @@ -39,5 +39,13 @@ namespace SMBLibrary.SMB1 LittleEndianWriter.WriteUInt64(buffer, 0, EndOfFile); return buffer; } + + public override SetInformationLevel InformationLevel + { + get + { + return SetInformationLevel.SMB_SET_FILE_END_OF_FILE_INFO; + } + } } } diff --git a/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetInfoStandard.cs b/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetInfoStandard.cs index 6c2f519..8093ffd 100644 --- a/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetInfoStandard.cs +++ b/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetInfoStandard.cs @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 Tal Aloni . All rights reserved. +/* Copyright (C) 2014-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, @@ -49,5 +49,13 @@ namespace SMBLibrary.SMB1 ByteWriter.WriteBytes(buffer, 12, Reserved); return buffer; } + + public override SetInformationLevel InformationLevel + { + get + { + return SetInformationLevel.SMB_INFO_STANDARD; + } + } } } diff --git a/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetInformation.cs b/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetInformation.cs index dc34f37..37c319e 100644 --- a/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetInformation.cs +++ b/SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetInformation.cs @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 Tal Aloni . All rights reserved. +/* Copyright (C) 2014-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, @@ -15,6 +15,11 @@ namespace SMBLibrary.SMB1 { public abstract byte[] GetBytes(); + public abstract SetInformationLevel InformationLevel + { + get; + } + public static SetInformation GetSetInformation(byte[] buffer, SetInformationLevel informationLevel) { switch (informationLevel)