mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-04-30 10:47:48 +02:00
Implement FileAttributeTagInformation support for SMB file operations
This commit is contained in:
parent
2ef0fb968e
commit
f158cceed6
2 changed files with 56 additions and 1 deletions
|
@ -82,7 +82,7 @@ namespace SMBLibrary
|
||||||
case FileInformationClass.FileNetworkOpenInformation:
|
case FileInformationClass.FileNetworkOpenInformation:
|
||||||
return new FileNetworkOpenInformation(buffer, offset);
|
return new FileNetworkOpenInformation(buffer, offset);
|
||||||
case FileInformationClass.FileAttributeTagInformation:
|
case FileInformationClass.FileAttributeTagInformation:
|
||||||
throw new NotImplementedException();
|
return new FileAttributeTagInformation(buffer, offset);
|
||||||
case FileInformationClass.FileValidDataLengthInformation:
|
case FileInformationClass.FileValidDataLengthInformation:
|
||||||
return new FileValidDataLengthInformation(buffer, offset);
|
return new FileValidDataLengthInformation(buffer, offset);
|
||||||
case FileInformationClass.FileShortNameInformation:
|
case FileInformationClass.FileShortNameInformation:
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
/* Copyright (C) 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,
|
||||||
|
* either version 3 of the License, or (at your option) any later version.
|
||||||
|
*/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Utilities;
|
||||||
|
|
||||||
|
namespace SMBLibrary
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// [MS-FSCC] 2.4.6 - FileAttributeTagInformation
|
||||||
|
/// </summary>
|
||||||
|
public class FileAttributeTagInformation : FileInformation
|
||||||
|
{
|
||||||
|
public const int FixedLength = 8;
|
||||||
|
|
||||||
|
public FileAttributes FileAttributes;
|
||||||
|
public uint ReparsePointTag;
|
||||||
|
|
||||||
|
public FileAttributeTagInformation()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public FileAttributeTagInformation(byte[] buffer, int offset)
|
||||||
|
{
|
||||||
|
FileAttributes = (FileAttributes)LittleEndianConverter.ToUInt32(buffer, offset + 0);
|
||||||
|
ReparsePointTag = LittleEndianConverter.ToUInt32(buffer, offset + 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void WriteBytes(byte[] buffer, int offset)
|
||||||
|
{
|
||||||
|
LittleEndianWriter.WriteUInt32(buffer, offset + 0, (uint)FileAttributes);
|
||||||
|
LittleEndianWriter.WriteUInt32(buffer, offset + 4, ReparsePointTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override FileInformationClass FileInformationClass
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return FileInformationClass.FileAttributeTagInformation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int Length
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return FixedLength;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue