summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2013-06-17 12:05:55 +0200
committerKai Koehne <kai.koehne@digia.com>2013-06-17 16:28:43 +0200
commit0dcb65d57587b0507eedb5b6b4388bb96fc21ce5 (patch)
tree76183502e72fe9dcbaf36b5aad61ff23e2f09e00 /src/libs
parent44ff53c7ade1be12f070d718b284372d9910b6b8 (diff)
Check return value of ShellExecuteExW instead of GetLastError
It's unclear from the MSDN documentation whether LastError is also set if ShellExecuteEx succeeds. Therefore rather check for the return value. Task-number: QTBUG-31788 Change-Id: Id74377445c5e64a056d4f1c0ec6ae29b02a0d98e Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/installer/adminauthorization_win.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libs/installer/adminauthorization_win.cpp b/src/libs/installer/adminauthorization_win.cpp
index d162f9d2d..5337747fc 100644
--- a/src/libs/installer/adminauthorization_win.cpp
+++ b/src/libs/installer/adminauthorization_win.cpp
@@ -139,9 +139,8 @@ bool AdminAuthorization::execute(QWidget *, const QString &program, const QStrin
shellExecuteInfo.lpParameters = (wchar_t *)args.utf16();
qDebug() << QString::fromLatin1("Starting elevated process %1 with arguments: %2.").arg(file, args);
- ShellExecuteExW(&shellExecuteInfo);
- if (GetLastError() == ERROR_SUCCESS) {
+ if (ShellExecuteExW(&shellExecuteInfo)) {
qDebug() << "Finished starting elevated process.";
return true;
} else {