diff options
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qcoreapplication_win.cpp | 19 | ||||
-rw-r--r-- | src/corelib/kernel/qsharedmemory_win.cpp | 32 |
2 files changed, 3 insertions, 48 deletions
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp index 4057c03b84..856d2a2101 100644 --- a/src/corelib/kernel/qcoreapplication_win.cpp +++ b/src/corelib/kernel/qcoreapplication_win.cpp @@ -65,23 +65,6 @@ QT_BEGIN_NAMESPACE int appCmdShow = 0; -// GetModuleFileName only exists for MSVC2015 and upwards for WinRT, meaning -// Windows 10 (Mobile). Hence take the first argument passed to the -// QCoreApplication contructor for older versions as a fallback on older platforms. -#if defined(Q_OS_WINRT) && _MSC_VER < 1900 - -Q_CORE_EXPORT QString qAppFileName() -{ - return QFileInfo(QCoreApplication::arguments().constFirst()).filePath(); -} - -QString QCoreApplicationPrivate::appName() const -{ - return QFileInfo(QCoreApplication::arguments().constFirst()).baseName(); -} - -#else // !(defined(Q_OS_WINRT) && _MSC_VER < 1900) - Q_CORE_EXPORT QString qAppFileName() // get application file name { // We do MAX_PATH + 2 here, and request with MAX_PATH + 1, so we can handle all paths @@ -186,8 +169,6 @@ QString QCoreApplicationPrivate::appVersion() const return applicationVersion; } -#endif // !(defined(Q_OS_WINRT) && _MSC_VER < 1900) - #ifndef Q_OS_WINRT #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) diff --git a/src/corelib/kernel/qsharedmemory_win.cpp b/src/corelib/kernel/qsharedmemory_win.cpp index 07d4930332..be42a369c2 100644 --- a/src/corelib/kernel/qsharedmemory_win.cpp +++ b/src/corelib/kernel/qsharedmemory_win.cpp @@ -64,11 +64,6 @@ void QSharedMemoryPrivate::setErrorString(QLatin1String function) errorString = QSharedMemory::tr("%1: already exists").arg(function); break; case ERROR_FILE_NOT_FOUND: -#if defined(Q_OS_WINRT) && _MSC_VER < 1900 - // This happens on WinRT only if no file is present as CreateFileMappingW - // bails out with this error code - case ERROR_INVALID_PARAMETER: -#endif error = QSharedMemory::NotFound; errorString = QSharedMemory::tr("%1: doesn't exist").arg(function); break; @@ -103,16 +98,9 @@ HANDLE QSharedMemoryPrivate::handle() errorString = QSharedMemory::tr("%1: unable to make key").arg(function); return 0; } -#if defined(Q_OS_WINPHONE) - Q_UNIMPLEMENTED(); - hand = 0; -#elif defined(Q_OS_WINRT) -#if _MSC_VER >= 1900 +#if defined(Q_OS_WINRT) 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 -#else hand = OpenFileMapping(FILE_MAP_ALL_ACCESS, false, (wchar_t*)nativeKey.utf16()); #endif if (!hand) { @@ -144,11 +132,7 @@ bool QSharedMemoryPrivate::create(int size) } // Create the file mapping. -#if defined(Q_OS_WINPHONE) - Q_UNIMPLEMENTED(); - Q_UNUSED(size) - hand = 0; -#elif defined(Q_OS_WINRT) +#if defined(Q_OS_WINRT) hand = CreateFileMappingFromApp(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, size, (PCWSTR)nativeKey.utf16()); #else hand = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, size, (wchar_t*)nativeKey.utf16()); @@ -166,12 +150,7 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode) { // Grab a pointer to the memory block int permissions = (mode == QSharedMemory::ReadOnly ? FILE_MAP_READ : FILE_MAP_ALL_ACCESS); -#if defined(Q_OS_WINPHONE) - Q_UNIMPLEMENTED(); - Q_UNUSED(mode) - Q_UNUSED(permissions) - memory = 0; -#elif defined(Q_OS_WINRT) +#if defined(Q_OS_WINRT) memory = (void *)MapViewOfFileFromApp(handle(), permissions, 0, 0); #else memory = (void *)MapViewOfFile(handle(), permissions, 0, 0, 0); @@ -199,15 +178,10 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode) bool QSharedMemoryPrivate::detach() { // umap memory -#if defined(Q_OS_WINPHONE) - Q_UNIMPLEMENTED(); - return false; -#else if (!UnmapViewOfFile(memory)) { setErrorString(QLatin1String("QSharedMemory::detach")); return false; } -#endif memory = 0; size = 0; |