summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-23 13:06:36 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-23 14:00:51 +0200
commit86515f2a650c8e6acc6906d5308061c8cd064408 (patch)
treefc6e8baa2a78f05d2dbccac8bfd013b8aec93feb /src/tools
parent9fa5b516f49bb252d6c57d14d54151d8ee3bf9d1 (diff)
parent21fa3e04b0febc0fa0a84d01eacd3831fd6628f8 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: src/tools/idc/main.cpp Change-Id: Id1b539313912cfc5a3e94d997761f0cc737f7024
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/idc/main.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/tools/idc/main.cpp b/src/tools/idc/main.cpp
index 43d814f..cceae07 100644
--- a/src/tools/idc/main.cpp
+++ b/src/tools/idc/main.cpp
@@ -176,9 +176,14 @@ static bool attachTypeLibrary(const QString &applicationName, int resource, cons
static HMODULE loadLibraryQt(const QString &input)
{
+ const wchar_t *inputC = reinterpret_cast<const wchar_t *>(input.utf16());
// Load DLL with the folder containing the DLL temporarily added to the search path when loading dependencies
- return LoadLibraryEx(reinterpret_cast<const wchar_t *>(input.utf16()), NULL,
- LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
+ HMODULE result =
+ LoadLibraryEx(inputC, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
+ // If that fails, call with flags=0 to get LoadLibrary() behavior (search %PATH%).
+ if (!result)
+ result = LoadLibraryEx(inputC, NULL, 0);
+ return result;
}
static bool registerServer(const QString &input)
@@ -230,7 +235,9 @@ static HRESULT dumpIdl(const QString &input, const QString &idlfile, const QStri
HRESULT res = E_FAIL;
if (hasExeExtension(input)) {
- if (runWithQtInEnvironment(quotePath(input) + QLatin1String(" -dumpidl ") + idlfile + QLatin1String(" -version ") + version))
+ const QString command = quotePath(input) + QLatin1String(" -dumpidl ")
+ + quotePath(idlfile) + QLatin1String(" -version ") + version;
+ if (runWithQtInEnvironment(command))
res = S_OK;
} else {
HMODULE hdll = loadLibraryQt(input);
@@ -373,7 +380,7 @@ int runIdc(int argc, char **argv)
fprintf(stderr, "%s\n", qPrintable(error));
return ok ? 0 : 4;
} else if (!idlfile.isEmpty()) {
- idlfile = quotePath(QDir::toNativeSeparators(idlfile));
+ idlfile = QDir::toNativeSeparators(idlfile);
fprintf(stderr, "\n\n%s\n\n", qPrintable(idlfile));
const HRESULT res = dumpIdl(input, idlfile, version);