0

Situation: I am scanning a directory using NtQueryDirectoryFile(..., FileBothDirectoryInformation, ...). In addition to data returned by this call I need security data (typically returned by GetKernelObjectSecurity) and list of alternate streams (NtQueryInformationFile(..., FileStreamInformation)).

Problem: To retrieve security and alternate stream info I need to open (and close) each file. In my tests it slows down the operation by factor of 3. Adding GetKernelObjectSecurity and NtQueryInformationFile slows it down by factor of 4 (making it 12x).

Question: Is there a better/faster way to get this information (by either opening files faster or avoiding file open altogether)?

Ideas: If target file system is local I could access it directly and (knowing NTFS/FAT/etc details extract info from raw data). But it isn't going to work for remote file systems.

4

1 回答 1

0

看来,自定义 SMB 客户端就是答案。跳过 Windows/NT API 层打开了所有大门。

于 2018-02-01T07:19:58.337 回答