Ejemplo n.º 1
0
        public Transaction2FindNext2Response(byte[] parameters, byte[] data, FindInformationLevel informationLevel, bool isUnicode, bool returnResumeKeys) : base()
        {
            SearchCount    = LittleEndianConverter.ToUInt16(parameters, 0);
            EndOfSearch    = LittleEndianConverter.ToUInt16(parameters, 2) != 0;
            EaErrorOffset  = LittleEndianConverter.ToUInt16(parameters, 4);
            LastNameOffset = LittleEndianConverter.ToUInt16(parameters, 6);

            FindInfoList = new FindInformation(data, informationLevel, isUnicode, returnResumeKeys);
        }
        /// <exception cref="SMBLibrary.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);
        }
Ejemplo n.º 3
0
 public Transaction2FindNext2Response() : base()
 {
     FindInfoList = new FindInformation();
 }