winrt: Use Windows 10 features when available

OpenFileMappingFromApp has been added for Windows 10. Using it,
QSharedMemory autotests succeed without any failure.

Change-Id: I5a4fbec004f121f41909ae13f3db02c384810645
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
bb10
Maurice Kalinowski 2015-12-09 13:34:58 +01:00
parent 604ef6d4a7
commit cf6d671a11
1 changed files with 4 additions and 0 deletions

View File

@ -101,7 +101,11 @@ HANDLE QSharedMemoryPrivate::handle()
Q_UNIMPLEMENTED();
hand = 0;
#elif defined(Q_OS_WINRT)
#if _MSC_VER >= 1900
hand = OpenFileMappingFromApp(FILE_MAP_ALL_ACCESS, FALSE, reinterpret_cast<PCWSTR>(nativeKey.utf16()));
#else
hand = CreateFileMappingFromApp(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, (PCWSTR)nativeKey.utf16());
#endif
#elif defined(Q_OS_WINCE)
// This works for opening a mapping too, but always opens it with read/write access in
// attach as it seems.