/// <summary> /// to decode the Trans2 data: from the general Trans2Dada to the concrete Trans2 Data. /// </summary> protected override void DecodeTrans2Data() { if (this.trans2Parameters.InformationLevel == QueryInformationLevel.SMB_INFO_QUERY_EAS_FROM_LIST) { using (MemoryStream memoryStream = new MemoryStream(this.smbData.Trans2_Data)) { using (Channel channel = new Channel(null, memoryStream)) { this.trans2Data.GetExtendedAttributeList.SizeOfListInBytes = channel.Read <uint>(); uint sizeOfListInBytes = this.trans2Data.GetExtendedAttributeList.SizeOfListInBytes - sizeOfListInBytesLength; List <SMB_GEA> attributeList = new List <SMB_GEA>(); while (sizeOfListInBytes > 0) { SMB_GEA smbQueryEa = channel.Read <SMB_GEA>(); attributeList.Add(smbQueryEa); sizeOfListInBytes -= (uint)(EA.SMB_QUERY_EA_FIXED_SIZE + smbQueryEa.AttributeName.Length); } this.trans2Data.GetExtendedAttributeList.GEAList = attributeList.ToArray(); } } } else { this.trans2Data.GetExtendedAttributeList.GEAList = new SMB_GEA[0]; } }
/// <summary> /// to decode the Trans2 data: from the general Trans2Dada to the concrete Trans2 Data. /// </summary> protected override void DecodeTrans2Data() { if (this.smbData.Trans2_Data != null && this.smbData.Trans2_Data.Length > 0) { using (MemoryStream memoryStream = new MemoryStream(this.smbData.Trans2_Data)) { using (Channel channel = new Channel(null, memoryStream)) { this.trans2Data.GetExtendedAttributeList.SizeOfListInBytes = channel.Read <uint>(); uint sizeOfListInBytes = this.trans2Data.GetExtendedAttributeList.SizeOfListInBytes - sizeOfListInBytesLength; List <SMB_GEA> eaList = new List <SMB_GEA>(); while (sizeOfListInBytes > 0) { SMB_GEA smbQueryEa = channel.Read <SMB_GEA>(); eaList.Add(smbQueryEa); sizeOfListInBytes -= (uint)(EA.SMB_QUERY_EA_FIXED_SIZE + smbQueryEa.AttributeName.Length); } this.trans2Data.GetExtendedAttributeList.GEAList = eaList.ToArray(); } } } }