Use NtCreateFile on Win32 (dotnet/corefx#27195)
authorJeremy Kuhne <jeremy.kuhne@microsoft.com>
Fri, 16 Feb 2018 19:10:07 +0000 (11:10 -0800)
committerGitHub <noreply@github.com>
Fri, 16 Feb 2018 19:10:07 +0000 (11:10 -0800)
commite9d845d7ff80f07b3f6990d60c2bca422ded692f
treef640a801249cf1c3d553f27fe4983a19e1642ca9
parentb7918ea880c88c7d04380ef34cb9d732e1585b54
Use NtCreateFile on Win32 (dotnet/corefx#27195)

NtCreateFile allows passing in a base handle which makes opening child directories much faster. This cuts anywhere from 3-10% of the time off of a GetFiles() call.

It is significantly faster as it avoids normalization and path parsing overhead.

Commit migrated from https://github.com/dotnet/corefx/commit/a28a2cdda67c024126f690bbe1331174a194f9ce
src/libraries/Common/src/Interop/Windows/Interop.UNICODE_STRING.cs
src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs [new file with mode: 0644]
src/libraries/System.IO.FileSystem/src/System.IO.FileSystem.csproj
src/libraries/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEnumerator.Win32.cs
src/libraries/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEnumerator.WinRT.cs
src/libraries/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEnumerator.Windows.cs