summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qstorageinfo_p.h
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2021-09-30 14:40:32 +0200
committerKarsten Heimrich <karsten.heimrich@qt.io>2021-12-08 09:29:02 +0100
commitc7248a38799470bda1fb5367a3c281c0b1ba54d0 (patch)
tree3ab2bfac996c4db1b7cfc84b6e10be7b676be7ef /src/corelib/io/qstorageinfo_p.h
parentf0be152896471aa392bb1b2b649b66feb31480cc (diff)
Implement fetching physical QStorageInfo::blockSize() under Windows
This is implemented in two passes, first we try the older and always available DeviceIoControl() function. This works most of the time, though it might fail for example for storage devices attached via USB. In this case, we try to dynamically load the newer NtQueryVolumeInformationFile kernel function. Since this is probably more expensive, we do this as fallback. [ChangeLog][QtCore][QStorageInfo] The QStorageInfo::blockSize() will now report the physical block size of a storage device under Windows. Network mapped drives are not supported. Fixes: QTBUG-93976 Change-Id: I08b5b879e5bf79c025e2e305196ec5c5fce8b20f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/corelib/io/qstorageinfo_p.h')
-rw-r--r--src/corelib/io/qstorageinfo_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/io/qstorageinfo_p.h b/src/corelib/io/qstorageinfo_p.h
index 421e364311..c0f7595c08 100644
--- a/src/corelib/io/qstorageinfo_p.h
+++ b/src/corelib/io/qstorageinfo_p.h
@@ -74,6 +74,8 @@ protected:
#if defined(Q_OS_WIN)
void retrieveVolumeInfo();
void retrieveDiskFreeSpace();
+ bool queryStorageProperty();
+ void queryFileFsSectorSizeInformation();
#elif defined(Q_OS_MAC)
void retrievePosixInfo();
void retrieveUrlProperties(bool initRootPath = false);