mirror of
https://github.com/CloudDelphi/Virtual-File-System
synced 2025-12-19 09:53:54 +01:00
Improved directory scanning performance by enlarging buffer size and fixed bug with external buffer corruption in NtQueryDirectoryFiles. Everything works!
This commit is contained in:
parent
fa991ef152
commit
4b1a3df792
@ -489,17 +489,18 @@ begin
|
||||
WriteLog('[INNER] NtQueryDirectoryFile', 'Written entry: ' + EntryName);
|
||||
end;
|
||||
|
||||
if StructConvertResult <> TOO_SMALL_BUF then begin
|
||||
with PFILE_ID_BOTH_DIR_INFORMATION(BufCaret)^ do begin
|
||||
NextEntryOffset := 0;
|
||||
FileIndex := 0;
|
||||
end;
|
||||
end;
|
||||
|
||||
if StructConvertResult = TOO_SMALL_BUF then begin
|
||||
OpenedFile.DirListing.SeekRel(-1);
|
||||
|
||||
if IsFirstEntry then begin
|
||||
result := STATUS_INFO_LENGTH_MISMATCH;
|
||||
VarDump([BufLength, WinNative.GetFileInformationClassSize(InfoClass), BytesWritten, '---', Buffer, BufCaret, BufSize]);
|
||||
end;
|
||||
end else if StructConvertResult = TRUNCATED_NAME then begin
|
||||
if IsFirstEntry then begin
|
||||
|
||||
@ -79,7 +79,7 @@ type
|
||||
|
||||
TSysDirScanner = class (Utils.TManagedObject, ISysDirScanner)
|
||||
protected const
|
||||
BUF_SIZE = (sizeof(WinNative.FILE_ID_BOTH_DIR_INFORMATION) + MAX_FILENAME_SIZE) * 10;
|
||||
BUF_SIZE = 65000;
|
||||
|
||||
protected
|
||||
fOwnsDirHandle: boolean;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user