summaryrefslogtreecommitdiff
path: root/src/shared/directoryentry.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-07-15 17:31:44 +0200
committerTannin <devnull@localhost>2014-07-15 17:31:44 +0200
commit67b0268e700072b9ee273a40251b422a8f55c3ba (patch)
tree8e5ee4b39044649400c2cd323c61e46f244e94be /src/shared/directoryentry.cpp
parentb1ac479fb648ed7c7e295fecb3a98a2e27cb3fde (diff)
- qt 5 compatibility fixes
- detection for support of optimized find no longer depends on deprecated api
Diffstat (limited to 'src/shared/directoryentry.cpp')
-rw-r--r--src/shared/directoryentry.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp
index 5172346b..87431ea8 100644
--- a/src/shared/directoryentry.cpp
+++ b/src/shared/directoryentry.cpp
@@ -489,13 +489,18 @@ void DirectoryEntry::propagateOrigin(int origin)
static bool SupportOptimizedFind()
{
- OSVERSIONINFO versionInfo;
- versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&versionInfo);
-
// large fetch and basic info for FindFirstFileEx is supported on win server 2008 r2, win 7 and newer
- return (versionInfo.dwMajorVersion > 6) ||
- ((versionInfo.dwMajorVersion == 6) && (versionInfo.dwMinorVersion >= 1));
+
+ OSVERSIONINFOEX versionInfo;
+ versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+ versionInfo.dwMajorVersion = 6;
+ versionInfo.dwMinorVersion = 1;
+ ULONGLONG mask = ::VerSetConditionMask(
+ ::VerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL),
+ VER_MINORVERSION, VER_GREATER_EQUAL);
+
+ bool res = ::VerifyVersionInfo(&versionInfo, VER_MAJORVERSION | VER_MINORVERSION, mask);
+ return res;
}