- OSVERSIONINFO vi;
- vi.dwOSVersionInfoSize = sizeof(vi);
- GetVersionEx(&vi);
-
- poco_assert(wcsncmp(sPattern.c_str(), L"\\\\?\\", 4) != 0); // Prefix better not be there yet
- if (vi.dwMajorVersion * 10 + vi.dwMinorVersion >= 61)
- h = FindFirstFileEx((L"\\\\?\\" + sPattern).c_str(), FindExInfoBasic, &ff, FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH);
+ if (IsWin7_OrGreater()) // (also 'Windows Server 2008 R2' and greater) for FindExInfoBasic and FIND_FIRST_EX_LARGE_FETCH
+ h = FindFirstFileEx(TFile(sPattern).wpath().c_str(), FindExInfoBasic, &ff, FindExSearchNameMatch, nullptr, FIND_FIRST_EX_LARGE_FETCH);