Added InformationLevel property to the SetInformation abstract class

This commit is contained in:
Tal Aloni 2017-01-19 22:29:16 +02:00
parent 841a267cdf
commit 0a6a4fcf44
7 changed files with 59 additions and 6 deletions

View file

@ -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 * 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, * the GNU Lesser Public License as published by the Free Software Foundation,
@ -36,5 +36,13 @@ namespace SMBLibrary.SMB1
{ {
return ExtendedAttributeList.GetBytes(); return ExtendedAttributeList.GetBytes();
} }
public override SetInformationLevel InformationLevel
{
get
{
return SetInformationLevel.SMB_INFO_SET_EAS;
}
}
} }
} }

View file

@ -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 * 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, * the GNU Lesser Public License as published by the Free Software Foundation,
@ -39,5 +39,13 @@ namespace SMBLibrary.SMB1
LittleEndianWriter.WriteUInt64(buffer, 0, AllocationSize); LittleEndianWriter.WriteUInt64(buffer, 0, AllocationSize);
return buffer; return buffer;
} }
public override SetInformationLevel InformationLevel
{
get
{
return SetInformationLevel.SMB_SET_FILE_ALLOCATION_INFO;
}
}
} }
} }

View file

@ -54,5 +54,13 @@ namespace SMBLibrary.SMB1
LittleEndianWriter.WriteUInt32(buffer, 36, Reserved); LittleEndianWriter.WriteUInt32(buffer, 36, Reserved);
return buffer; return buffer;
} }
public override SetInformationLevel InformationLevel
{
get
{
return SetInformationLevel.SMB_SET_FILE_BASIC_INFO;
}
}
} }
} }

View file

@ -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 * 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, * 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)); ByteWriter.WriteByte(buffer, 0, Convert.ToByte(DeletePending));
return buffer; return buffer;
} }
public override SetInformationLevel InformationLevel
{
get
{
return SetInformationLevel.SMB_SET_FILE_DISPOSITION_INFO;
}
}
} }
} }

View file

@ -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 * 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, * the GNU Lesser Public License as published by the Free Software Foundation,
@ -39,5 +39,13 @@ namespace SMBLibrary.SMB1
LittleEndianWriter.WriteUInt64(buffer, 0, EndOfFile); LittleEndianWriter.WriteUInt64(buffer, 0, EndOfFile);
return buffer; return buffer;
} }
public override SetInformationLevel InformationLevel
{
get
{
return SetInformationLevel.SMB_SET_FILE_END_OF_FILE_INFO;
}
}
} }
} }

View file

@ -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 * 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, * the GNU Lesser Public License as published by the Free Software Foundation,
@ -49,5 +49,13 @@ namespace SMBLibrary.SMB1
ByteWriter.WriteBytes(buffer, 12, Reserved); ByteWriter.WriteBytes(buffer, 12, Reserved);
return buffer; return buffer;
} }
public override SetInformationLevel InformationLevel
{
get
{
return SetInformationLevel.SMB_INFO_STANDARD;
}
}
} }
} }

View file

@ -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 * 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, * 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 byte[] GetBytes();
public abstract SetInformationLevel InformationLevel
{
get;
}
public static SetInformation GetSetInformation(byte[] buffer, SetInformationLevel informationLevel) public static SetInformation GetSetInformation(byte[] buffer, SetInformationLevel informationLevel)
{ {
switch (informationLevel) switch (informationLevel)