summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystemengine_win.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-07-14 00:00:53 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2017-07-14 00:00:53 +0000
commit97294ed9958baf4b1a99f75b94066c1fdadffa56 (patch)
treed33a91c6979894895f86efd79ae98f61d0127123 /src/corelib/io/qfilesystemengine_win.cpp
parent3bac08c00fb411fe99c824a4e3bd9421cd6ccc27 (diff)
parentd38fe875c7850ca2c6ca28f91e94ae276735fac8 (diff)
Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib/io/qfilesystemengine_win.cpp')
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index d95a6de777..889fbfea7b 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -602,13 +602,13 @@ QByteArray QFileSystemEngine::id(const QFileSystemEntry &entry)
QByteArray result;
const HANDLE handle =
#ifndef Q_OS_WINRT
- CreateFile((wchar_t*)entry.nativeFilePath().utf16(), GENERIC_READ,
+ CreateFile((wchar_t*)entry.nativeFilePath().utf16(), 0,
FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
#else // !Q_OS_WINRT
- CreateFile2((const wchar_t*)entry.nativeFilePath().utf16(), GENERIC_READ,
+ CreateFile2((const wchar_t*)entry.nativeFilePath().utf16(), 0,
FILE_SHARE_READ, OPEN_EXISTING, NULL);
#endif // Q_OS_WINRT
- if (handle) {
+ if (handle != INVALID_HANDLE_VALUE) {
result = QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows8 ?
fileIdWin8(handle) : fileId(handle);
CloseHandle(handle);