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,9 +489,11 @@ begin
|
|||||||
WriteLog('[INNER] NtQueryDirectoryFile', 'Written entry: ' + EntryName);
|
WriteLog('[INNER] NtQueryDirectoryFile', 'Written entry: ' + EntryName);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
with PFILE_ID_BOTH_DIR_INFORMATION(BufCaret)^ do begin
|
if StructConvertResult <> TOO_SMALL_BUF then begin
|
||||||
NextEntryOffset := 0;
|
with PFILE_ID_BOTH_DIR_INFORMATION(BufCaret)^ do begin
|
||||||
FileIndex := 0;
|
NextEntryOffset := 0;
|
||||||
|
FileIndex := 0;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if StructConvertResult = TOO_SMALL_BUF then begin
|
if StructConvertResult = TOO_SMALL_BUF then begin
|
||||||
@ -499,7 +501,6 @@ begin
|
|||||||
|
|
||||||
if IsFirstEntry then begin
|
if IsFirstEntry then begin
|
||||||
result := STATUS_INFO_LENGTH_MISMATCH;
|
result := STATUS_INFO_LENGTH_MISMATCH;
|
||||||
VarDump([BufLength, WinNative.GetFileInformationClassSize(InfoClass), BytesWritten, '---', Buffer, BufCaret, BufSize]);
|
|
||||||
end;
|
end;
|
||||||
end else if StructConvertResult = TRUNCATED_NAME then begin
|
end else if StructConvertResult = TRUNCATED_NAME then begin
|
||||||
if IsFirstEntry then begin
|
if IsFirstEntry then begin
|
||||||
|
|||||||
@ -79,7 +79,7 @@ type
|
|||||||
|
|
||||||
TSysDirScanner = class (Utils.TManagedObject, ISysDirScanner)
|
TSysDirScanner = class (Utils.TManagedObject, ISysDirScanner)
|
||||||
protected const
|
protected const
|
||||||
BUF_SIZE = (sizeof(WinNative.FILE_ID_BOTH_DIR_INFORMATION) + MAX_FILENAME_SIZE) * 10;
|
BUF_SIZE = 65000;
|
||||||
|
|
||||||
protected
|
protected
|
||||||
fOwnsDirHandle: boolean;
|
fOwnsDirHandle: boolean;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user