mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-04-30 10:47:48 +02:00
SMBLibrary: Moved MS-FSCC structures to the Structures directory
This commit is contained in:
parent
b892bd9018
commit
2f4a6e1538
4 changed files with 16 additions and 14 deletions
|
@ -51,9 +51,6 @@
|
|||
<Compile Include="Enums\SMBTransportType.cs" />
|
||||
<Compile Include="Enums\Win32Error.cs" />
|
||||
<Compile Include="EnumStructures\AccessMask.cs" />
|
||||
<Compile Include="IOCTL\FileFullEAInformation.cs" />
|
||||
<Compile Include="IOCTL\FileFullEAInformationList.cs" />
|
||||
<Compile Include="IOCTL\ObjectIDBufferType1.cs" />
|
||||
<Compile Include="NetBios\NameServicePackets\Enums\NameRecordType.cs" />
|
||||
<Compile Include="NetBios\NameServicePackets\Enums\NameServiceOperation.cs" />
|
||||
<Compile Include="NetBios\NameServicePackets\Enums\NetBiosSuffix.cs" />
|
||||
|
@ -384,6 +381,9 @@
|
|||
<Compile Include="Structures\ACE\Enums\AceFlags.cs" />
|
||||
<Compile Include="Structures\ACE\Enums\AceType.cs" />
|
||||
<Compile Include="Structures\ACL.cs" />
|
||||
<Compile Include="Structures\FileFullEAInformation.cs" />
|
||||
<Compile Include="Structures\FileFullEAInformationList.cs" />
|
||||
<Compile Include="Structures\ObjectIDBufferType1.cs" />
|
||||
<Compile Include="Structures\SecurityDescriptor.cs" />
|
||||
<Compile Include="Structures\SID.cs" />
|
||||
<Compile Include="Tests\AuthenticationTests.cs" />
|
||||
|
|
|
@ -16,10 +16,12 @@ namespace SMBLibrary
|
|||
/// </summary>
|
||||
public class FileFullEAInformation
|
||||
{
|
||||
public const int FixedLength = 8;
|
||||
|
||||
public uint NextEntryOffset;
|
||||
public byte Flags;
|
||||
//byte EaNameLength;
|
||||
//ushort EaValueLength;
|
||||
private byte EaNameLength;
|
||||
private ushort EaValueLength;
|
||||
public string EaName; // ASCII
|
||||
public string EaValue; // ASCII
|
||||
|
||||
|
@ -31,20 +33,20 @@ namespace SMBLibrary
|
|||
{
|
||||
NextEntryOffset = LittleEndianReader.ReadUInt32(buffer, ref offset);
|
||||
Flags = ByteReader.ReadByte(buffer, ref offset);
|
||||
byte eaNameLength = ByteReader.ReadByte(buffer, ref offset);
|
||||
ushort eaValueLength = LittleEndianReader.ReadUInt16(buffer, ref offset);
|
||||
EaName = ByteReader.ReadAnsiString(buffer, ref offset, eaNameLength);
|
||||
EaValue = ByteReader.ReadAnsiString(buffer, ref offset, eaValueLength);
|
||||
EaNameLength = ByteReader.ReadByte(buffer, ref offset);
|
||||
EaValueLength = LittleEndianReader.ReadUInt16(buffer, ref offset);
|
||||
EaName = ByteReader.ReadAnsiString(buffer, ref offset, EaNameLength);
|
||||
EaValue = ByteReader.ReadAnsiString(buffer, ref offset, EaValueLength);
|
||||
}
|
||||
|
||||
public void WriteBytes(byte[] buffer, int offset)
|
||||
{
|
||||
byte eaNameLength = (byte)EaName.Length;
|
||||
ushort eaValueLength = (ushort)EaValue.Length;
|
||||
EaNameLength = (byte)EaName.Length;
|
||||
EaValueLength = (ushort)EaValue.Length;
|
||||
LittleEndianWriter.WriteUInt32(buffer, ref offset, NextEntryOffset);
|
||||
ByteWriter.WriteByte(buffer, ref offset, Flags);
|
||||
ByteWriter.WriteByte(buffer, ref offset, eaNameLength);
|
||||
LittleEndianWriter.WriteUInt16(buffer, ref offset, eaValueLength);
|
||||
ByteWriter.WriteByte(buffer, ref offset, EaNameLength);
|
||||
LittleEndianWriter.WriteUInt16(buffer, ref offset, EaValueLength);
|
||||
ByteWriter.WriteAnsiString(buffer, ref offset, EaName);
|
||||
ByteWriter.WriteAnsiString(buffer, ref offset, EaValue);
|
||||
}
|
||||
|
@ -53,7 +55,7 @@ namespace SMBLibrary
|
|||
{
|
||||
get
|
||||
{
|
||||
return 8 + EaName.Length + EaValue.Length;
|
||||
return FixedLength + EaName.Length + EaValue.Length;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue