mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-07-06 17:43:17 +02:00
Minor code refactoring
This commit is contained in:
parent
7eda93f5da
commit
de4ab95d80
2 changed files with 5 additions and 6 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue