I'm writing a directory enumerator and CreateFileW takes as long as NtQueryDirectoryFile when it's cached , is there a faster alternative to get the handle ?
Printable View
I'm writing a directory enumerator and CreateFileW takes as long as NtQueryDirectoryFile when it's cached , is there a faster alternative to get the handle ?
CreateFile() is the basic WIN32 user mode for function for creating/opening a file.
For a directory enumerator, why do you need to get the handle for each file? To enumerate a directory, use FindFirstFileEx() and then FindNextFile(). See https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx and https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx and for an example of use https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx
NtQueryDirectoryFile() is a driver function. If you are writing a driver, the driver function to open a file is NtOpenFile(). See https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx