From 50e18de5161633802a88bd405b7c33cfcaaca3f7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 3 Jan 2012 10:40:32 +0100 Subject: Windows: Run on Windows XP. Replace Q_ASSERT() on missing functions from User32.dll by qFatal() with error message. Do not check "UpdateLayeredWindowIndirect" as it was introduced with Windows Vista. Task-number: QTBUG-23351 Change-Id: I0064611351c687f0c3c6e13156dd534b9f7a5d75 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowscontext.cpp | 7 +++---- src/plugins/platforms/windows/qwindowscontext.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 70d879e19f..3600c66114 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -164,11 +164,10 @@ void QWindowsUser32DLL::init() // MinGW (g++ 3.4.5) accepts only C casts. setLayeredWindowAttributes = (SetLayeredWindowAttributes)(library.resolve("SetLayeredWindowAttributes")); updateLayeredWindow = (UpdateLayeredWindow)(library.resolve("UpdateLayeredWindow")); - updateLayeredWindowIndirect = (UpdateLayeredWindowIndirect)(library.resolve("UpdateLayeredWindowIndirect")); - - Q_ASSERT(setLayeredWindowAttributes && updateLayeredWindow - && updateLayeredWindowIndirect); + if (!setLayeredWindowAttributes || !updateLayeredWindow) + qFatal("This version of Windows is not supported (User32.dll is missing the symbols 'SetLayeredWindowAttributes', 'UpdateLayeredWindow')."); + updateLayeredWindowIndirect = (UpdateLayeredWindowIndirect)(library.resolve("UpdateLayeredWindowIndirect")); isHungAppWindow = (IsHungAppWindow)library.resolve("IsHungAppWindow"); } diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h index db57f7c097..9a8acbbb51 100644 --- a/src/plugins/platforms/windows/qwindowscontext.h +++ b/src/plugins/platforms/windows/qwindowscontext.h @@ -77,9 +77,9 @@ struct QWindowsUser32DLL // Functions missing in Q_CC_GNU stub libraries. SetLayeredWindowAttributes setLayeredWindowAttributes; UpdateLayeredWindow updateLayeredWindow; - UpdateLayeredWindowIndirect updateLayeredWindowIndirect; // Functions missing in older versions of Windows + UpdateLayeredWindowIndirect updateLayeredWindowIndirect; IsHungAppWindow isHungAppWindow; // Touch functions from Windows 7 onwards (also for use with Q_CC_MSVC). -- cgit v1.2.3