diff options
authorMaurice Kalinowski <>2014-04-01 10:27:42 +0200
committerThe Qt Project <>2014-04-01 12:29:14 +0200
commit30db2159aa54aff0c28054739e2204966c584d8c (patch)
parentcaf34b9f0ad66d8a1bcfaebcd33c676a0f7973cf (diff)
Fix offset calculation on WinRT
According to MSDN "the offset must be a multiple of the allocation granularity". We use this already for the win32 version by splitting into offsetLo and offsetHi. However, we did not convert it back to the correct argument passed for MapViewOfFileFromApp. Now all auto-tests for mapping succeed. Task-number: QTBUG-37773 Change-Id: I7e43f906cb93164b58f4e5e3f88388cdace865d7 Reviewed-by: Andrew Knight <>
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index c974daab06..afc8deb1a0 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -1034,6 +1034,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size,
LPVOID mapAddress = ::MapViewOfFile(mapHandle, access,
offsetHi, offsetLo, size + extra);
+ offset = (offsetHi << 32) + offsetLo;
LPVOID mapAddress = ::MapViewOfFileFromApp(mapHandle, access, offset, size);
if (mapAddress) {