5#ifndef QSYSTEMLIBRARY_P_H
6#define QSYSTEMLIBRARY_P_H
19#include <QtCore/private/qglobal_p.h>
21# include <QtCore/qstring.h>
22# include <qt_windows.h>
29 explicit QSystemLibrary(
const QString &libraryName)
31 m_libraryName = libraryName;
34 explicit QSystemLibrary(
const wchar_t *libraryName)
36 m_libraryName = QString::fromWCharArray(libraryName);
39 bool load(
bool onlySystemDirectory =
true)
41 m_handle = load((
const wchar_t *)m_libraryName.utf16(), onlySystemDirectory);
43 return (m_handle !=
nullptr);
48 return (m_handle !=
nullptr);
51 QFunctionPointer resolve(
const char *symbol)
57 return QFunctionPointer(GetProcAddress(m_handle, symbol));
60 static QFunctionPointer resolve(
const QString &libraryName,
const char *symbol)
62 return QSystemLibrary(libraryName).resolve(symbol);
65 static Q_CORE_EXPORT HINSTANCE load(
const wchar_t *lpFileName,
bool onlySystemDirectory =
true);
68 HINSTANCE m_handle =
nullptr;
69 QString m_libraryName = {};
70 bool m_didLoad =
false;
static QString qSystemDirectory()