summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2021-06-21 15:52:32 +0200
committerKarsten Heimrich <karsten.heimrich@qt.io>2021-10-19 10:14:24 +0200
commit4ca7ba269dbafb38ba26e7bef2bb5587d75568f1 (patch)
treedd1a0e59aefbdf1e6c213d27c750745837e1d025 /src
parent411f25b232bb50aaac4964bb9cbdceaec168319b (diff)
downloadqtserialport-4ca7ba269dbafb38ba26e7bef2bb5587d75568f1.tar.gz
Revert "Avoid possible symbol clashes on static builds on Windows"
This reverts commit aa00e8eb623d5cb4ba32860dd3671a87f3763f89. Part of chain revert to go back to QWinOverlappedIoNotifier. Task-number: QTBUG-93865 Change-Id: I5456e792a22c76daf207d8c052ed14cd7976976c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/serialport/qserialport_win.cpp2
-rw-r--r--src/serialport/qtntdll_p.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/serialport/qserialport_win.cpp b/src/serialport/qserialport_win.cpp
index c131641..387c4f0 100644
--- a/src/serialport/qserialport_win.cpp
+++ b/src/serialport/qserialport_win.cpp
@@ -246,7 +246,7 @@ bool QSerialPortPrivate::open(QIODevice::OpenMode mode)
{
{
QMutexLocker locker(&helper()->mutex);
- static bool symbolsResolved = resolveNtdllSymbols(&helper()->ntLibrary);
+ static bool symbolsResolved = resolveSymbols(&helper()->ntLibrary);
if (!symbolsResolved) {
setError(QSerialPortErrorInfo(QSerialPort::OpenError,
helper()->ntLibrary.errorString()));
diff --git a/src/serialport/qtntdll_p.h b/src/serialport/qtntdll_p.h
index 2e57201..a8cdaf6 100644
--- a/src/serialport/qtntdll_p.h
+++ b/src/serialport/qtntdll_p.h
@@ -123,14 +123,14 @@ typedef VOID (WINAPI *PIO_APC_ROUTINE) (
static fp_##symbolName symbolName;
#define RESOLVE_SYMBOL(symbolName) \
- symbolName = reinterpret_cast<fp_##symbolName>(resolveNtdllSymbol(ntLibrary, #symbolName)); \
+ symbolName = reinterpret_cast<fp_##symbolName>(resolveSymbol(ntLibrary, #symbolName)); \
if (!symbolName) \
return false;
GENERATE_SYMBOL_VARIABLE(ULONG, RtlNtStatusToDosError, NTSTATUS)
GENERATE_SYMBOL_VARIABLE(NTSTATUS, NtDeviceIoControlFile, HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, ULONG, PVOID, ULONG, PVOID, ULONG)
-inline QFunctionPointer resolveNtdllSymbol(QLibrary *ntLibrary, const char *symbolName)
+inline QFunctionPointer resolveSymbol(QLibrary *ntLibrary, const char *symbolName)
{
QFunctionPointer symbolFunctionPointer = ntLibrary->resolve(symbolName);
if (!symbolFunctionPointer)
@@ -139,7 +139,7 @@ inline QFunctionPointer resolveNtdllSymbol(QLibrary *ntLibrary, const char *symb
return symbolFunctionPointer;
}
-inline bool resolveNtdllSymbols(QLibrary *ntLibrary)
+inline bool resolveSymbols(QLibrary *ntLibrary)
{
if (!ntLibrary->isLoaded()) {
ntLibrary->setFileName(QStringLiteral("ntdll"));