瀏覽代碼

Added InformationLevel property to the SetInformation abstract class

Tal Aloni 8 年之前
父節點
當前提交
0a6a4fcf44

+ 9 - 1
SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetExtendedAttributes.cs

@@ -1,4 +1,4 @@
-/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
+/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. 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;
+            }
+        }
     }
 }

+ 9 - 1
SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileAllocationInfo.cs

@@ -1,4 +1,4 @@
-/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
+/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. 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;
+            }
+        }
     }
 }

+ 8 - 0
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;
+            }
+        }
     }
 }

+ 9 - 1
SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileDispositionInfo.cs

@@ -1,4 +1,4 @@
-/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
+/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. 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;
+            }
+        }
     }
 }

+ 9 - 1
SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetFileEndOfFileInfo.cs

@@ -1,4 +1,4 @@
-/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
+/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. 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;
+            }
+        }
     }
 }

+ 9 - 1
SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetInfoStandard.cs

@@ -1,4 +1,4 @@
-/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
+/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. 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;
+            }
+        }
     }
 }

+ 6 - 1
SMBLibrary/SMB1/Transaction2Subcommands/Structures/SetInformation/SetInformation.cs

@@ -1,4 +1,4 @@
-/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
+/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. 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)