| 329 | } |
| 330 | |
| 331 | void DirectoryWalker::forEachEntry(const std::wstring& path, void* cx, |
| 332 | DirStartF* dirStartF, DirEndF* dirEndF, FileF* fileF) |
| 333 | { |
| 334 | auto& hc = g_handleClosers.request(); |
| 335 | |
| 336 | if (!NtOpenFile) { |
| 337 | LibraryPtr m(::LoadLibraryW(L"ntdll.dll")); |
| 338 | NtOpenFile = (NtOpenFile_type)::GetProcAddress(m.get(), "NtOpenFile"); |
| 339 | NtQueryDirectoryFile = |
| 340 | (NtQueryDirectoryFile_type)::GetProcAddress(m.get(), "NtQueryDirectoryFile"); |
| 341 | NtClose = (NtClose_type)::GetProcAddress(m.get(), "NtClose"); |
| 342 | } |
| 343 | |
| 344 | const std::wstring ntpath = makeNtPath(path); |
| 345 | |
| 346 | UNICODE_STRING ObjectName = {}; |
| 347 | ObjectName.Buffer = const_cast<wchar_t*>(ntpath.c_str()); |
| 348 | ObjectName.Length = (USHORT)ntpath.size() * sizeof(wchar_t); |
| 349 | ObjectName.MaximumLength = ObjectName.Length; |
| 350 | |
| 351 | OBJECT_ATTRIBUTES oa = {}; |
| 352 | oa.Length = sizeof(oa); |
| 353 | oa.ObjectName = &ObjectName; |
| 354 | |
| 355 | forEachEntryImpl(cx, hc, m_buffers, &oa, 0, dirStartF, dirEndF, fileF); |
| 356 | hc.wakeup(); |
| 357 | } |
| 358 | |
| 359 | void forEachEntry(const std::wstring& path, void* cx, DirStartF* dirStartF, |
| 360 | DirEndF* dirEndF, FileF* fileF) |
no test coverage detected