4#ifndef QSYSTEMLIBRARY_P_H
5#define QSYSTEMLIBRARY_P_H
18#include <QtCore/private/qglobal_p.h>
20# include <QtCore/qstring.h>
21# include <qt_windows.h>
28 explicit QSystemLibrary(
const QString &libraryName)
30 m_libraryName = libraryName;
33 explicit QSystemLibrary(
const wchar_t *libraryName)
35 m_libraryName = QString::fromWCharArray(libraryName);
38 bool load(
bool onlySystemDirectory =
true)
40 m_handle = load((
const wchar_t *)m_libraryName.utf16(), onlySystemDirectory);
42 return (m_handle !=
nullptr);
47 return (m_handle !=
nullptr);
50 QFunctionPointer resolve(
const char *symbol)
56 return QFunctionPointer(GetProcAddress(m_handle, symbol));
59 static QFunctionPointer resolve(
const QString &libraryName,
const char *symbol)
61 return QSystemLibrary(libraryName).resolve(symbol);
64 static Q_CORE_EXPORT HINSTANCE load(
const wchar_t *lpFileName,
bool onlySystemDirectory =
true);
67 HINSTANCE m_handle =
nullptr;
68 QString m_libraryName = {};
69 bool m_didLoad =
false;
static QString qSystemDirectory()