예제 #1
0
        /// <exception cref="SmbLibraryStd.UnsupportedInformationLevelException"></exception>
        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   = ToFindInformation(entries[index]);
                int             entryLength = infoEntry.GetLength(isUnicode);
                if (pageLength + entryLength <= maxLength)
                {
                    result.Add(infoEntry);
                    pageLength += entryLength;
                }
                else
                {
                    break;
                }
            }
            return(result);
        }
 public void SetFindInformationList(FindInformationList findInformationList, bool isUnicode)
 {
     SearchCount = (ushort)findInformationList.Count;
     FindInformationListBytes = findInformationList.GetBytes(isUnicode);
 }