Minor code refactoring

This commit is contained in:
Tal Aloni 2017-09-30 10:54:51 +03:00
parent 7eda93f5da
commit de4ab95d80
2 changed files with 5 additions and 6 deletions

View file

@ -36,13 +36,13 @@ namespace SMBLibrary.SMB1
}
/// <exception cref="SMBLibrary.UnsupportedInformationLevelException"></exception>
public static FindInformationList GetFindInformationList(List<QueryDirectoryFileInformation> entries, bool isUnicode, int maxLength)
public static FindInformationList ToFindInformationList(List<QueryDirectoryFileInformation> entries, bool isUnicode, int maxLength)
{
FindInformationList result = new FindInformationList();
int pageLength = 0;
for (int index = 0; index < entries.Count; index++)
{
FindInformation infoEntry = GetFindInformation(entries[index]);
FindInformation infoEntry = ToFindInformation(entries[index]);
int entryLength = infoEntry.GetLength(isUnicode);
if (pageLength + entryLength <= maxLength)
{
@ -58,7 +58,7 @@ namespace SMBLibrary.SMB1
}
/// <exception cref="SMBLibrary.UnsupportedInformationLevelException"></exception>
public static FindInformation GetFindInformation(QueryDirectoryFileInformation fileInformation)
public static FindInformation ToFindInformation(QueryDirectoryFileInformation fileInformation)
{
if (fileInformation is FileDirectoryInformation)
{

View file

@ -7,7 +7,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using SMBLibrary.SMB1;
using Utilities;
@ -61,7 +60,7 @@ namespace SMBLibrary.Server.SMB1
FindInformationList findInformationList;
try
{
findInformationList = FindInformationHelper.GetFindInformationList(segment, header.UnicodeFlag, maxLength);
findInformationList = FindInformationHelper.ToFindInformationList(segment, header.UnicodeFlag, maxLength);
}
catch (UnsupportedInformationLevelException)
{
@ -112,7 +111,7 @@ namespace SMBLibrary.Server.SMB1
FindInformationList findInformationList;
try
{
findInformationList = FindInformationHelper.GetFindInformationList(segment, header.UnicodeFlag, maxLength);
findInformationList = FindInformationHelper.ToFindInformationList(segment, header.UnicodeFlag, maxLength);
}
catch (UnsupportedInformationLevelException)
{