From 0316c8c5aeaf692dc460b7aaeeef18d8e892f0a8 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 6 Mar 2017 06:34:06 +0100 Subject: [PATCH] Added workaround for crash on Windows 7 for Qt versions with gcc 5.3.0. The call to GetProcAddress in openssl (cryptlib.c) finds an function pointer to the not existing function _OPENSSL_isservice in the executable running on Windows 7. --- retroshare-gui/src/main.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/retroshare-gui/src/main.cpp b/retroshare-gui/src/main.cpp index 88c947aa0..ad618d3bc 100644 --- a/retroshare-gui/src/main.cpp +++ b/retroshare-gui/src/main.cpp @@ -59,6 +59,23 @@ #endif #endif +#ifdef Q_OS_WIN +#if QT_VERSION >= QT_VERSION_CHECK (5, 7, 0) +// see INSTALL.W32 in openssl +// Needed as workaround for gcc 5.3.0 because the call to GetProcAddress in cryptlib.c finds an function pointer +// to the not existing function _OPENSSL_isservice in the executable running on Windows 7. +extern "C" { +__declspec(dllexport) __cdecl BOOL _OPENSSL_isservice(void) +{ + DWORD sess; + if (ProcessIdToSessionId(GetCurrentProcessId(),&sess)) + return sess==0; + return FALSE; +} +} +#endif +#endif + /*** WINDOWS DON'T LIKE THIS - REDEFINES VER numbers. #include ****/