Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit a28a2cd

Browse files
authored
Use NtCreateFile on Win32 (#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.
1 parent 03ecb64 commit a28a2cd

File tree

6 files changed

+626
-1
lines changed

6 files changed

+626
-1
lines changed

src/Common/src/Interop/Windows/Interop.UNICODE_STRING.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,19 @@
77

88
internal static partial class Interop
99
{
10+
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa380518.aspx
11+
// https://msdn.microsoft.com/en-us/library/windows/hardware/ff564879.aspx
1012
[StructLayout(LayoutKind.Sequential)]
1113
internal struct UNICODE_STRING
1214
{
15+
/// <summary>
16+
/// Length, in bytes, not including the the null, if any.
17+
/// </summary>
1318
internal ushort Length;
19+
20+
/// <summary>
21+
/// Max size of the buffer in bytes
22+
/// </summary>
1423
internal ushort MaximumLength;
1524
internal IntPtr Buffer;
1625
}

0 commit comments

Comments
 (0)