123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace SMBLibrary.SMB1
- {
- public abstract class FindInformation
- {
- private bool m_returnResumeKeys;
- public FindInformation(bool returnResumeKeys)
- {
- m_returnResumeKeys = returnResumeKeys;
- }
- public abstract void WriteBytes(byte[] buffer, ref int offset, bool isUnicode);
-
- public abstract int GetLength(bool isUnicode);
- public bool ReturnResumeKeys
- {
- get
- {
- return m_returnResumeKeys;
- }
- }
- public static FindInformation ReadEntry(byte[] buffer, ref int offset, FindInformationLevel informationLevel, bool isUnicode, bool returnResumeKeys)
- {
- switch (informationLevel)
- {
- case FindInformationLevel.SMB_FIND_FILE_DIRECTORY_INFO:
- return new FindFileDirectoryInfo(buffer, ref offset, isUnicode);
- case FindInformationLevel.SMB_FIND_FILE_FULL_DIRECTORY_INFO:
- return new FindFileFullDirectoryInfo(buffer, ref offset, isUnicode);
- case FindInformationLevel.SMB_FIND_FILE_NAMES_INFO:
- return new FindFileNamesInfo(buffer, ref offset, isUnicode);
- case FindInformationLevel.SMB_FIND_FILE_BOTH_DIRECTORY_INFO:
- return new FindFileBothDirectoryInfo(buffer, ref offset, isUnicode);
- default:
- throw new InvalidRequestException();;
- }
- }
- }
- }
|