Corrected TRANS2_FIND_FIRST2 / TRANS2_FIND_NEXT2 requests implementation when InformationLevel = SMB_INFO_QUERY_EAS_FROM_LIST

This commit is contained in:
Tal Aloni 2017-02-07 13:54:25 +02:00
parent 794b1b30e1
commit 9f79f939b6
2 changed files with 24 additions and 4 deletions

View file

@ -24,11 +24,11 @@ namespace SMBLibrary.SMB1
public SearchStorageType SearchStorageType;
public string FileName; // SMB_STRING
// Data:
public FullExtendedAttributeList GetExtendedAttributeList; // Used with FindInformationLevel.SMB_INFO_QUERY_EAS_FROM_LIST
public ExtendedAttributeNameList GetExtendedAttributeList; // Used with FindInformationLevel.SMB_INFO_QUERY_EAS_FROM_LIST
public Transaction2FindFirst2Request() : base()
{
GetExtendedAttributeList = new FullExtendedAttributeList();
GetExtendedAttributeList = new ExtendedAttributeNameList();
}
public Transaction2FindFirst2Request(byte[] parameters, byte[] data, bool isUnicode) : base()
@ -42,7 +42,7 @@ namespace SMBLibrary.SMB1
if (InformationLevel == FindInformationLevel.SMB_INFO_QUERY_EAS_FROM_LIST)
{
GetExtendedAttributeList = new FullExtendedAttributeList(data, 0);
GetExtendedAttributeList = new ExtendedAttributeNameList(data, 0);
}
}

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
* the GNU Lesser Public License as published by the Free Software Foundation,
@ -23,9 +23,12 @@ namespace SMBLibrary.SMB1
public uint ResumeKey;
public FindFlags Flags;
public string FileName; // SMB_STRING
// Data:
public ExtendedAttributeNameList GetExtendedAttributeList; // Used with FindInformationLevel.SMB_INFO_QUERY_EAS_FROM_LIST
public Transaction2FindNext2Request() : base()
{
GetExtendedAttributeList = new ExtendedAttributeNameList();
}
public Transaction2FindNext2Request(byte[] parameters, byte[] data, bool isUnicode) : base()
@ -36,6 +39,11 @@ namespace SMBLibrary.SMB1
ResumeKey = LittleEndianConverter.ToUInt32(parameters, 6);
Flags = (FindFlags)LittleEndianConverter.ToUInt16(parameters, 10);
FileName = SMB1Helper.ReadSMBString(parameters, 12, isUnicode);
if (InformationLevel == FindInformationLevel.SMB_INFO_QUERY_EAS_FROM_LIST)
{
GetExtendedAttributeList = new ExtendedAttributeNameList(data, 0);
}
}
public override byte[] GetSetup()
@ -66,6 +74,18 @@ namespace SMBLibrary.SMB1
return parameters;
}
public override byte[] GetData(bool isUnicode)
{
if (InformationLevel == FindInformationLevel.SMB_INFO_QUERY_EAS_FROM_LIST)
{
return GetExtendedAttributeList.GetBytes();
}
else
{
return new byte[0];
}
}
public override Transaction2SubcommandName SubcommandName
{
get