diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2010-08-31 08:23:30 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2010-09-03 08:22:25 (GMT) |
commit | 5738dcd705e7edde816940f9c0ab2c364c81ad20 (patch) | |
tree | e6be0a4b0f11289a7f0e8f6b4d4cce1de28aee8e /src/gui | |
parent | dac9e5dd5644d29d6a8dde752e7c594727f16661 (diff) | |
download | Qt-5738dcd705e7edde816940f9c0ab2c364c81ad20.zip Qt-5738dcd705e7edde816940f9c0ab2c364c81ad20.tar.gz Qt-5738dcd705e7edde816940f9c0ab2c364c81ad20.tar.bz2 |
Ensure that we load system libraries from the correct location.
This was a security hole that has been there for a while, but the
public awareness have recently rised so the threat is more imminent
now.
The solution is to fix all places where we dynamically load system
libraries. More specifically, we now load all system libraries with
an absolute path that points to a library in the system directory
(usually c:\windows\system32).
We therefore introduce a small class named QSystemLibrary that only loads
libraries located in the system path. This shares some of the API with
QLibrary (in order to make the patch as small as possible).
We don't fix QLibrary due to risk of regressions. In
addition, applications can fix the code that calls QLibrary themselves.
The problem does not apply to Windows CE, since the search order is
documented as not searching in the current directory.
However, it touches some CE-specific code - therefore QSystemLibrary
is sometimes used on WinCE (however, it will just do a normal
LoadLibrary() since its safe anyway).
This change does not affect the testability plugin (it is not clearly
documented where that plugin is located, and the plugin should never
be used in production code anyway)
Loading OpenSSL libraries
The ssl libraries are handled specially, and searched in this order
(we cannot expect them to always be in the system folder):
1. Application path
2. System libraries path
3. Trying all paths inside the PATH environment variable
Task-number: QT-3825
Reviewed-by: Thiago Macieira
Reviewed-by: Peter Hartmann
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/accessible/qaccessible_win.cpp | 4 | ||||
-rw-r--r-- | src/gui/dialogs/qfiledialog_win.cpp | 12 | ||||
-rw-r--r-- | src/gui/dialogs/qwizard_win.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_win.cpp | 38 | ||||
-rw-r--r-- | src/gui/kernel/qdesktopwidget_win.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_win.cpp | 6 | ||||
-rw-r--r-- | src/gui/styles/qwindowsstyle.cpp | 8 | ||||
-rw-r--r-- | src/gui/styles/qwindowsvistastyle.cpp | 3 | ||||
-rw-r--r-- | src/gui/styles/qwindowsxpstyle.cpp | 4 | ||||
-rw-r--r-- | src/gui/text/qfontdatabase_win.cpp | 10 | ||||
-rw-r--r-- | src/gui/text/qfontengine_win.cpp | 4 | ||||
-rw-r--r-- | src/gui/util/qdesktopservices_win.cpp | 6 | ||||
-rw-r--r-- | src/gui/util/qsystemtrayicon_win.cpp | 8 |
13 files changed, 57 insertions, 58 deletions
diff --git a/src/gui/accessible/qaccessible_win.cpp b/src/gui/accessible/qaccessible_win.cpp index fc8575f..132d01f 100644 --- a/src/gui/accessible/qaccessible_win.cpp +++ b/src/gui/accessible/qaccessible_win.cpp @@ -42,7 +42,7 @@ #ifndef QT_NO_ACCESSIBILITY #include "qapplication.h" -#include "qlibrary.h" +#include <private/qsystemlibrary_p.h> #include "qmessagebox.h" // ### dependency #include "qt_windows.h" #include "qwidget.h" @@ -243,7 +243,7 @@ void QAccessible::updateAccessibility(QObject *o, int who, Event reason) static bool resolvedNWE = false; if (!resolvedNWE) { resolvedNWE = true; - ptrNotifyWinEvent = (PtrNotifyWinEvent)QLibrary::resolve(QLatin1String("user32"), "NotifyWinEvent"); + ptrNotifyWinEvent = (PtrNotifyWinEvent)QSystemLibrary::resolve(QLatin1String("user32"), "NotifyWinEvent"); } if (!ptrNotifyWinEvent) return; diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp index 5a7ace9..bd97527 100644 --- a/src/gui/dialogs/qfiledialog_win.cpp +++ b/src/gui/dialogs/qfiledialog_win.cpp @@ -52,7 +52,7 @@ #include <qbuffer.h> #include <qdir.h> #include <qstringlist.h> -#include <qlibrary.h> +#include <private/qsystemlibrary_p.h> #ifndef QT_NO_THREAD # include <private/qmutexpool_p.h> @@ -126,10 +126,10 @@ static void qt_win_resolve_libs() triedResolve = true; #if !defined(Q_WS_WINCE) - QLibrary lib(QLatin1String("shell32")); - ptrSHBrowseForFolder = (PtrSHBrowseForFolder) lib.resolve("SHBrowseForFolderW"); - ptrSHGetPathFromIDList = (PtrSHGetPathFromIDList) lib.resolve("SHGetPathFromIDListW"); - ptrSHGetMalloc = (PtrSHGetMalloc) lib.resolve("SHGetMalloc"); + QSystemLibrary lib(L"shell32"); + ptrSHBrowseForFolder = (PtrSHBrowseForFolder)lib.resolve("SHBrowseForFolderW"); + ptrSHGetPathFromIDList = (PtrSHGetPathFromIDList)lib.resolve("SHGetPathFromIDListW"); + ptrSHGetMalloc = (PtrSHGetMalloc)lib.resolve("SHGetMalloc"); #else // CE stores them in a different lib and does not use unicode version HINSTANCE handle = LoadLibraryW(L"Ceshell"); @@ -436,7 +436,7 @@ static bool qt_win_set_IFileDialogOptions(IFileDialog *pfd, { if (!pSHCreateItemFromParsingName) { // This function is available only in Vista & above. - QLibrary shellLib(QLatin1String("Shell32")); + QSystemLibrary shellLib(QLatin1String("Shell32")); pSHCreateItemFromParsingName = (PtrSHCreateItemFromParsingName) shellLib.resolve("SHCreateItemFromParsingName"); if (!pSHCreateItemFromParsingName) diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp index 1390b21..449ad62 100644 --- a/src/gui/dialogs/qwizard_win.cpp +++ b/src/gui/dialogs/qwizard_win.cpp @@ -43,7 +43,7 @@ #ifndef QT_NO_STYLE_WINDOWSVISTA #include "qwizard_win_p.h" -#include "qlibrary.h" +#include <private/qsystemlibrary_p.h> #include "qwizard.h" #include "qpaintengine.h" #include "qapplication.h" @@ -691,7 +691,7 @@ bool QVistaHelper::resolveSymbols() static bool tried = false; if (!tried) { tried = true; - QLibrary dwmLib(QString::fromAscii("dwmapi")); + QSystemLibrary dwmLib(L"dwmapi"); pDwmIsCompositionEnabled = (PtrDwmIsCompositionEnabled)dwmLib.resolve("DwmIsCompositionEnabled"); if (pDwmIsCompositionEnabled) { @@ -699,7 +699,7 @@ bool QVistaHelper::resolveSymbols() pDwmExtendFrameIntoClientArea = (PtrDwmExtendFrameIntoClientArea)dwmLib.resolve("DwmExtendFrameIntoClientArea"); } - QLibrary themeLib(QString::fromAscii("uxtheme")); + QSystemLibrary themeLib(L"uxtheme"); pIsAppThemed = (PtrIsAppThemed)themeLib.resolve("IsAppThemed"); if (pIsAppThemed) { pDrawThemeBackground = (PtrDrawThemeBackground)themeLib.resolve("DrawThemeBackground"); diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index d6896c0..b6b49cc 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -66,7 +66,6 @@ extern void qt_wince_hide_taskbar(HWND hwnd); //defined in qguifunctions_wince.c #include "qdatetime.h" #include "qpointer.h" #include "qhash.h" -#include "qlibrary.h" #include "qmetaobject.h" #include "qmime.h" #include "qpainter.h" @@ -91,6 +90,7 @@ extern void qt_wince_hide_taskbar(HWND hwnd); //defined in qguifunctions_wince.c #include "qdebug.h" #include <private/qkeymapper_p.h> #include <private/qlocale_p.h> +#include <private/qsystemlibrary_p.h> #include "qevent_p.h" //#define ALIEN_DEBUG @@ -204,7 +204,7 @@ static void resolveAygLibs() { if (!aygResolved) { aygResolved = true; - QLibrary ayglib(QLatin1String("aygshell")); + QSystemLibrary ayglib(QLatin1String("aygshell")); if (!ayglib.load()) return; ptrRecognizeGesture = (AygRecognizeGesture) ayglib.resolve("SHRecognizeGesture"); @@ -811,10 +811,10 @@ void qt_init(QApplicationPrivate *priv, int) #ifndef Q_OS_WINCE ptrUpdateLayeredWindowIndirect = - (PtrUpdateLayeredWindowIndirect) QLibrary::resolve(QLatin1String("user32"), + (PtrUpdateLayeredWindowIndirect) QSystemLibrary::resolve(QLatin1String("user32"), "UpdateLayeredWindowIndirect"); ptrUpdateLayeredWindow = - (PtrUpdateLayeredWindow) QLibrary::resolve(QLatin1String("user32"), + (PtrUpdateLayeredWindow) QSystemLibrary::resolve(QLatin1String("user32"), "UpdateLayeredWindow"); if (ptrUpdateLayeredWindow && !ptrUpdateLayeredWindowIndirect) @@ -822,7 +822,7 @@ void qt_init(QApplicationPrivate *priv, int) // Notify Vista and Windows 7 that we support highter DPI settings ptrSetProcessDPIAware = (PtrSetProcessDPIAware) - QLibrary::resolve(QLatin1String("user32"), "SetProcessDPIAware"); + QSystemLibrary::resolve(QLatin1String("user32"), "SetProcessDPIAware"); if (ptrSetProcessDPIAware) ptrSetProcessDPIAware(); #endif @@ -842,30 +842,28 @@ void qt_init(QApplicationPrivate *priv, int) #elif !defined(Q_WS_WINCE) #if !defined(QT_NO_NATIVE_GESTURES) priv->GetGestureInfo = - (PtrGetGestureInfo)QLibrary::resolve(QLatin1String("user32"), + (PtrGetGestureInfo)QSystemLibrary::resolve(QLatin1String("user32"), "GetGestureInfo"); priv->GetGestureExtraArgs = - (PtrGetGestureExtraArgs)QLibrary::resolve(QLatin1String("user32"), + (PtrGetGestureExtraArgs)QSystemLibrary::resolve(QLatin1String("user32"), "GetGestureExtraArgs"); priv->CloseGestureInfoHandle = - (PtrCloseGestureInfoHandle)QLibrary::resolve(QLatin1String("user32"), + (PtrCloseGestureInfoHandle)QSystemLibrary::resolve(QLatin1String("user32"), "CloseGestureInfoHandle"); priv->SetGestureConfig = - (PtrSetGestureConfig)QLibrary::resolve(QLatin1String("user32"), + (PtrSetGestureConfig)QSystemLibrary::resolve(QLatin1String("user32"), "SetGestureConfig"); priv->GetGestureConfig = - (PtrGetGestureConfig)QLibrary::resolve(QLatin1String("user32"), + (PtrGetGestureConfig)QSystemLibrary::resolve(QLatin1String("user32"), "GetGestureConfig"); #endif // QT_NO_NATIVE_GESTURES + QSystemLibrary libTheme(QLatin1String("uxtheme")); priv->BeginPanningFeedback = - (PtrBeginPanningFeedback)QLibrary::resolve(QLatin1String("uxtheme"), - "BeginPanningFeedback"); + (PtrBeginPanningFeedback)libTheme.resolve("BeginPanningFeedback"); priv->UpdatePanningFeedback = - (PtrUpdatePanningFeedback)QLibrary::resolve(QLatin1String("uxtheme"), - "UpdatePanningFeedback"); + (PtrUpdatePanningFeedback)libTheme.resolve("UpdatePanningFeedback"); priv->EndPanningFeedback = - (PtrEndPanningFeedback)QLibrary::resolve(QLatin1String("uxtheme"), - "EndPanningFeedback"); + (PtrEndPanningFeedback)libTheme.resolve("EndPanningFeedback"); #endif } @@ -2294,7 +2292,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam if (!oleaccChecked) { oleaccChecked = true; #if !defined(Q_OS_WINCE) - ptrLresultFromObject = (PtrLresultFromObject)QLibrary::resolve(QLatin1String("oleacc.dll"), "LresultFromObject"); + ptrLresultFromObject = (PtrLresultFromObject)QSystemLibrary::resolve(QLatin1String("oleacc"), "LresultFromObject"); #endif } if (ptrLresultFromObject) { @@ -3080,7 +3078,7 @@ bool QETWidget::translateMouseEvent(const MSG &msg) static PtrTrackMouseEvent ptrTrackMouseEvent = 0; if (!trackMouseEventLookup) { trackMouseEventLookup = true; - ptrTrackMouseEvent = (PtrTrackMouseEvent)QLibrary::resolve(QLatin1String("comctl32"), "_TrackMouseEvent"); + ptrTrackMouseEvent = (PtrTrackMouseEvent)QSystemLibrary::resolve(QLatin1String("comctl32"), "_TrackMouseEvent"); } if (ptrTrackMouseEvent && !qApp->d_func()->inPopupMode()) { // We always have to set the tracking, since @@ -3600,7 +3598,7 @@ static void initWinTabFunctions() if (!qt_is_gui_used) return; - QLibrary library(QLatin1String("wintab32")); + QSystemLibrary library(QLatin1String("wintab32")); if (library.load()) { ptrWTInfo = (PtrWTInfo)library.resolve("WTInfoW"); ptrWTGet = (PtrWTGet)library.resolve("WTGetW"); @@ -4044,7 +4042,7 @@ void QApplicationPrivate::initializeMultitouch_sys() iInkTablets->Release(); } - QLibrary library(QLatin1String("user32")); + QSystemLibrary library(QLatin1String("user32")); // MinGW (g++ 3.4.5) accepts only C casts. RegisterTouchWindow = (PtrRegisterTouchWindow)(library.resolve("RegisterTouchWindow")); GetTouchInputInfo = (PtrGetTouchInputInfo)(library.resolve("GetTouchInputInfo")); diff --git a/src/gui/kernel/qdesktopwidget_win.cpp b/src/gui/kernel/qdesktopwidget_win.cpp index 1fea8d6..7d7caac 100644 --- a/src/gui/kernel/qdesktopwidget_win.cpp +++ b/src/gui/kernel/qdesktopwidget_win.cpp @@ -42,7 +42,7 @@ #include "qdesktopwidget.h" #include "qt_windows.h" #include "qapplication_p.h" -#include "qlibrary.h" +#include <private/qsystemlibrary_p.h> #include <qvector.h> #include <limits.h> #ifdef Q_WS_WINCE @@ -155,7 +155,7 @@ void QDesktopWidgetPrivate::init(QDesktopWidget *that) screenCount = 0; #ifndef Q_OS_WINCE - QLibrary user32Lib(QLatin1String("user32")); + QSystemLibrary user32Lib(QLatin1String("user32")); if (user32Lib.load()) { enumDisplayMonitors = (EnumFunc)user32Lib.resolve("EnumDisplayMonitors"); getMonitorInfo = (InfoFunc)user32Lib.resolve("GetMonitorInfoW"); @@ -173,7 +173,7 @@ void QDesktopWidgetPrivate::init(QDesktopWidget *that) enumDisplayMonitors = 0; getMonitorInfo = 0; #else - QLibrary coreLib(QLatin1String("coredll")); + QSystemLibrary coreLib(QLatin1String("coredll")); if (coreLib.load()) { // CE >= 4.0 case enumDisplayMonitors = (EnumFunc)coreLib.resolve("EnumDisplayMonitors"); diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 9acfb70..10d6345 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -47,7 +47,6 @@ #include "qevent.h" #include "qimage.h" #include "qlayout.h" -#include "qlibrary.h" #include "qpainter.h" #include "qstack.h" #include "qt_windows.h" @@ -65,6 +64,7 @@ #include <private/qapplication_p.h> #include <private/qwininputcontext_p.h> #include <private/qpaintengine_raster_p.h> +#include <private/qsystemlibrary_p.h> #if defined(Q_WS_WINCE) #include "qguifunctions_wince.h" @@ -143,7 +143,7 @@ static void init_wintab_functions() #else if (!qt_is_gui_used) return; - QLibrary library(QLatin1String("wintab32")); + QSystemLibrary library(QLatin1String("wintab32")); ptrWTOpen = (PtrWTOpen)library.resolve("WTOpenW"); ptrWTInfo = (PtrWTInfo)library.resolve("WTInfoW"); ptrWTClose = (PtrWTClose)library.resolve("WTClose"); @@ -1860,7 +1860,7 @@ void QWidgetPrivate::setWindowOpacity_sys(qreal level) static bool function_resolved = false; if (!function_resolved) { ptrSetLayeredWindowAttributes = - (PtrSetLayeredWindowAttributes) QLibrary::resolve(QLatin1String("user32"), + (PtrSetLayeredWindowAttributes) QSystemLibrary::resolve(QLatin1String("user32"), "SetLayeredWindowAttributes"); function_resolved = true; } diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp index 6c48590..53d32da 100644 --- a/src/gui/styles/qwindowsstyle.cpp +++ b/src/gui/styles/qwindowsstyle.cpp @@ -45,7 +45,7 @@ #if !defined(QT_NO_STYLE_WINDOWS) || defined(QT_PLUGIN) -#include "qlibrary.h" +#include <private/qsystemlibrary_p.h> #include "qapplication.h" #include "qbitmap.h" #include "qdrawutil.h" // for now @@ -126,7 +126,7 @@ QWindowsStylePrivate::QWindowsStylePrivate() #if defined(Q_WS_WIN) && !defined(Q_OS_WINCE) if ((QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) { - QLibrary shellLib(QLatin1String("shell32")); + QSystemLibrary shellLib(QLatin1String("shell32")); pSHGetStockIconInfo = (PtrSHGetStockIconInfo)shellLib.resolve("SHGetStockIconInfo"); } #endif @@ -921,9 +921,9 @@ static const char *const question_xpm[] = { static QPixmap loadIconFromShell32( int resourceId, int size ) { #ifdef Q_OS_WINCE - HMODULE hmod = LoadLibrary(L"ceshell.dll"); + HMODULE hmod = LoadLibrary(L"ceshell"); #else - HMODULE hmod = LoadLibrary(L"shell32.dll"); + HMODULE hmod = QSystemLibrary::load(L"shell32"); #endif if( hmod ) { HICON iconHandle = (HICON)LoadImage(hmod, MAKEINTRESOURCE(resourceId), IMAGE_ICON, size, size, 0); diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp index 67a7b85..92688c0 100644 --- a/src/gui/styles/qwindowsvistastyle.cpp +++ b/src/gui/styles/qwindowsvistastyle.cpp @@ -42,6 +42,7 @@ #include "qwindowsvistastyle.h" #include "qwindowsvistastyle_p.h" #include <private/qstylehelper_p.h> +#include <private/qsystemlibrary_p.h> #if !defined(QT_NO_STYLE_WINDOWSVISTA) || defined(QT_PLUGIN) @@ -2597,7 +2598,7 @@ bool QWindowsVistaStylePrivate::resolveSymbols() static bool tried = false; if (!tried) { tried = true; - QLibrary themeLib(QLatin1String("uxtheme")); + QSystemLibrary themeLib(QLatin1String("uxtheme")); pSetWindowTheme = (PtrSetWindowTheme )themeLib.resolve("SetWindowTheme"); pIsThemePartDefined = (PtrIsThemePartDefined )themeLib.resolve("IsThemePartDefined"); pGetThemePartSize = (PtrGetThemePartSize )themeLib.resolve("GetThemePartSize"); diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp index efb1224..a2538fe 100644 --- a/src/gui/styles/qwindowsxpstyle.cpp +++ b/src/gui/styles/qwindowsxpstyle.cpp @@ -48,7 +48,7 @@ #include <private/qapplication_p.h> #include <private/qstylehelper_p.h> #include <private/qwidget_p.h> -#include <qlibrary.h> +#include <private/qsystemlibrary_p.h> #include <qpainter.h> #include <qpaintengine.h> #include <qwidget.h> @@ -344,7 +344,7 @@ bool QWindowsXPStylePrivate::resolveSymbols() static bool tried = false; if (!tried) { tried = true; - QLibrary themeLib(QLatin1String("uxtheme")); + QSystemLibrary themeLib(QLatin1String("uxtheme")); pIsAppThemed = (PtrIsAppThemed)themeLib.resolve("IsAppThemed"); if (pIsAppThemed) { pIsThemeActive = (PtrIsThemeActive )themeLib.resolve("IsThemeActive"); diff --git a/src/gui/text/qfontdatabase_win.cpp b/src/gui/text/qfontdatabase_win.cpp index a6ceee1..160b139 100644 --- a/src/gui/text/qfontdatabase_win.cpp +++ b/src/gui/text/qfontdatabase_win.cpp @@ -45,7 +45,7 @@ #include "qfont_p.h" #include "qfontengine_p.h" #include "qpaintdevice.h" -#include "qlibrary.h" +#include <private/qsystemlibrary_p.h> #include "qabstractfileengine.h" #include "qendian.h" @@ -1049,7 +1049,7 @@ static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt) { if(!fnt->data.isEmpty()) { #ifndef Q_OS_WINCE - PtrAddFontMemResourceEx ptrAddFontMemResourceEx = (PtrAddFontMemResourceEx)QLibrary::resolve(QLatin1String("gdi32"), + PtrAddFontMemResourceEx ptrAddFontMemResourceEx = (PtrAddFontMemResourceEx)QSystemLibrary::resolve(QLatin1String("gdi32"), "AddFontMemResourceEx"); if (!ptrAddFontMemResourceEx) return; @@ -1112,7 +1112,7 @@ static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt) return; #else // supported from 2000 on, so no need to deal with the *A variant - PtrAddFontResourceExW ptrAddFontResourceExW = (PtrAddFontResourceExW)QLibrary::resolve(QLatin1String("gdi32"), + PtrAddFontResourceExW ptrAddFontResourceExW = (PtrAddFontResourceExW)QSystemLibrary::resolve(QLatin1String("gdi32"), "AddFontResourceExW"); if (!ptrAddFontResourceExW || ptrAddFontResourceExW((wchar_t*)fnt->fileName.utf16(), FR_PRIVATE, 0) == 0) @@ -1141,7 +1141,7 @@ bool QFontDatabase::removeApplicationFont(int handle) if (!removeSucceeded) return false; #else - PtrRemoveFontMemResourceEx ptrRemoveFontMemResourceEx = (PtrRemoveFontMemResourceEx)QLibrary::resolve(QLatin1String("gdi32"), + PtrRemoveFontMemResourceEx ptrRemoveFontMemResourceEx = (PtrRemoveFontMemResourceEx)QSystemLibrary::resolve(QLatin1String("gdi32"), "RemoveFontMemResourceEx"); if (!ptrRemoveFontMemResourceEx || !ptrRemoveFontMemResourceEx(font.handle)) @@ -1152,7 +1152,7 @@ bool QFontDatabase::removeApplicationFont(int handle) if (!RemoveFontResource((LPCWSTR)font.fileName.utf16())) return false; #else - PtrRemoveFontResourceExW ptrRemoveFontResourceExW = (PtrRemoveFontResourceExW)QLibrary::resolve(QLatin1String("gdi32"), + PtrRemoveFontResourceExW ptrRemoveFontResourceExW = (PtrRemoveFontResourceExW)QSystemLibrary::resolve(QLatin1String("gdi32"), "RemoveFontResourceExW"); if (!ptrRemoveFontResourceExW || !ptrRemoveFontResourceExW((LPCWSTR)font.fileName.utf16(), FR_PRIVATE, 0)) diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index eea196e..be90f1c 100644 --- a/src/gui/text/qfontengine_win.cpp +++ b/src/gui/text/qfontengine_win.cpp @@ -50,7 +50,7 @@ #include "qt_windows.h" #include <private/qapplication_p.h> -#include <qlibrary.h> +#include <private/qsystemlibrary_p.h> #include <qpaintdevice.h> #include <qpainter.h> #include <limits.h> @@ -140,7 +140,7 @@ static void resolveGetCharWidthI() if (resolvedGetCharWidthI) return; resolvedGetCharWidthI = true; - ptrGetCharWidthI = (PtrGetCharWidthI)QLibrary::resolve(QLatin1String("gdi32"), "GetCharWidthI"); + ptrGetCharWidthI = (PtrGetCharWidthI)QSystemLibrary::resolve(QLatin1String("gdi32"), "GetCharWidthI"); } #endif // !defined(Q_WS_WINCE) diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp index 9f3b6e1..359710f 100644 --- a/src/gui/util/qdesktopservices_win.cpp +++ b/src/gui/util/qdesktopservices_win.cpp @@ -41,7 +41,7 @@ #include <qsettings.h> #include <qdir.h> -#include <qlibrary.h> +#include <private/qsystemlibrary_p.h> #include <qurl.h> #include <qstringlist.h> #include <qprocess.h> @@ -177,9 +177,9 @@ QString QDesktopServices::storageLocation(StandardLocation type) QString result; #ifndef Q_OS_WINCE - QLibrary library(QLatin1String("shell32")); + QSystemLibrary library(QLatin1String("shell32")); #else - QLibrary library(QLatin1String("coredll")); + QSystemLibrary library(QLatin1String("coredll")); #endif // Q_OS_WINCE typedef BOOL (WINAPI*GetSpecialFolderPath)(HWND, LPWSTR, int, BOOL); static GetSpecialFolderPath SHGetSpecialFolderPath = diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp index 1571b94..6e78dfd 100644 --- a/src/gui/util/qsystemtrayicon_win.cpp +++ b/src/gui/util/qsystemtrayicon_win.cpp @@ -55,7 +55,7 @@ #include <commctrl.h> #include <shlwapi.h> #include <QBitmap> -#include <QLibrary> +#include <private/qsystemlibrary_p.h> #include <QApplication> #include <QToolTip> #include <QDesktopWidget> @@ -134,14 +134,14 @@ QSystemTrayIconSys::QSystemTrayIconSys(QSystemTrayIcon *object) // Allow the WM_TASKBARCREATED message through the UIPI filter on Windows Vista and higher static PtrChangeWindowMessageFilterEx pChangeWindowMessageFilterEx = - (PtrChangeWindowMessageFilterEx)QLibrary::resolve(QLatin1String("user32"), "ChangeWindowMessageFilterEx"); + (PtrChangeWindowMessageFilterEx)QSystemLibrary::resolve(QLatin1String("user32"), "ChangeWindowMessageFilterEx"); if (pChangeWindowMessageFilterEx) { // Call the safer ChangeWindowMessageFilterEx API if available pChangeWindowMessageFilterEx(winId(), MYWM_TASKBARCREATED, Q_MSGFLT_ALLOW, 0); } else { static PtrChangeWindowMessageFilter pChangeWindowMessageFilter = - (PtrChangeWindowMessageFilter)QLibrary::resolve(QLatin1String("user32"), "ChangeWindowMessageFilter"); + (PtrChangeWindowMessageFilter)QSystemLibrary::resolve(QLatin1String("user32"), "ChangeWindowMessageFilter"); if (pChangeWindowMessageFilter) { // Call the deprecated ChangeWindowMessageFilter API otherwise @@ -352,7 +352,7 @@ void QSystemTrayIconPrivate::install_sys() QRect QSystemTrayIconSys::findIconGeometry(const int iconId) { static PtrShell_NotifyIconGetRect Shell_NotifyIconGetRect = - (PtrShell_NotifyIconGetRect)QLibrary::resolve(QLatin1String("shell32"), "Shell_NotifyIconGetRect"); + (PtrShell_NotifyIconGetRect)QSystemLibrary::resolve(QLatin1String("shell32"), "Shell_NotifyIconGetRect"); if (Shell_NotifyIconGetRect) { Q_NOTIFYICONIDENTIFIER nid; |