With deoRecursive (or the deprecated Recursive = True), TSimpleDirEnumerator.Execute finds the subdirectories with
BaseDirBS := itpd(dzExtractFileDir(_Mask));
dirs := EnumDirsOnly(BaseDirBS + '*', ...);
For a mask without a directory part, such as '*.txt', dzExtractFileDir returns '' and itpd('') is '\'. So the top level lists the current directory, but the recursion lists the subdirectories of the root of the current drive and descends into all of them. The result mixes two unrelated trees, and the call can take minutes. EnumFilesOnly with deoRecursive goes through Execute and has the same problem.
Found by reading the code in a review of [features:#40], not reproduced (it would walk the whole drive). The code is older than that change.
The recursion should use the current directory, or the mask should be expanded first. A drive-relative mask such as 'c:*.txt' probably needs the same treatment.
Fixed in revision [r2528].
Related
Commit: [r2528]