OSDN Git Service

Added support for VS 2015.3 with KB3165756 installed.
[mutilities/MUtilities.git] / src / Utils_Win32.cpp
index 0be05b3..7be2757 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // MuldeR's Utilities for Qt
-// Copyright (C) 2004-2015 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2016 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -61,7 +61,7 @@ typedef QPair<QSharedPointer<QLibrary>, FunctionMap> LibraryItem;
 static QReadWriteLock              g_resolve_lock;
 static QHash<QString, LibraryItem> g_resolve_libs;
 
-uintptr_t MUtils::Win32Utils::resolve_helper(const QString &libraryName, const QString &functionName)
+const uintptr_t &MUtils::Win32Utils::resolve_helper(const QString &libraryName, const QString &functionName)
 {
        const QString libraryNameFolded = libraryName.toCaseFolded().trimmed();
        const QString functionIdTrimmed = functionName.trimmed();
@@ -97,7 +97,8 @@ uintptr_t MUtils::Win32Utils::resolve_helper(const QString &libraryName, const Q
        LibraryItem &lib = g_resolve_libs[libraryNameFolded];
        if (lib.first.isNull() || (!lib.first->isLoaded()))
        {
-               return NULL; /*library unavailable*/
+               static const uintptr_t null = NULL;
+               return null; /*library unavailable*/
        }
 
        //Lookup the function