123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Utilities;
- namespace SMBLibrary.SMB1
- {
-
-
-
- public class QueryFSAttibuteInfo : QueryFSInformation
- {
- public const int FixedLength = 12;
- public FileSystemAttributes FileSystemAttributes;
- public uint MaxFileNameLengthInBytes;
-
- public string FileSystemName;
- public QueryFSAttibuteInfo()
- {
- }
- public QueryFSAttibuteInfo(byte[] buffer, int offset)
- {
- FileSystemAttributes = (FileSystemAttributes)LittleEndianConverter.ToUInt32(buffer, offset + 0);
- MaxFileNameLengthInBytes = LittleEndianConverter.ToUInt32(buffer, offset + 4);
- uint lengthOfFileSystemName = LittleEndianConverter.ToUInt32(buffer, offset + 8);
- FileSystemName = ByteReader.ReadUTF16String(buffer, offset + 12, (int)(lengthOfFileSystemName / 2));
- }
- public override byte[] GetBytes(bool isUnicode)
- {
- uint lengthOfFileSystemName = (uint)(FileSystemName.Length * 2);
- byte[] buffer = new byte[this.Length];
- LittleEndianWriter.WriteUInt32(buffer, 0, (uint)FileSystemAttributes);
- LittleEndianWriter.WriteUInt32(buffer, 4, MaxFileNameLengthInBytes);
- LittleEndianWriter.WriteUInt32(buffer, 8, lengthOfFileSystemName);
- ByteWriter.WriteUTF16String(buffer, 12, FileSystemName);
- return buffer;
- }
- public int Length
- {
- get
- {
- return FixedLength + FileSystemName.Length * 2;
- }
- }
- }
- }
|