diff options
Diffstat (limited to 'src/helper.cpp')
| -rw-r--r-- | src/helper.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/helper.cpp b/src/helper.cpp index bec5d51e..41784fe5 100644 --- a/src/helper.cpp +++ b/src/helper.cpp @@ -18,8 +18,8 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. */
#include "helper.h"
-#include "report.h"
#include "utility.h"
+#include <report.h>
#include <LMCons.h>
#define WIN32_LEAN_AND_MEAN
@@ -27,6 +27,8 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include <QDir>
+using MOBase::reportError;
+
namespace Helper {
@@ -40,7 +42,7 @@ static bool helperExec(LPCWSTR moDirectory, LPCWSTR commandLine) execInfo.cbSize = sizeof(SHELLEXECUTEINFOW);
execInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
- execInfo.hwnd = NULL;
+ execInfo.hwnd = nullptr;
execInfo.lpVerb = L"runas";
execInfo.lpFile = fileName;
execInfo.lpParameters = commandLine;
@@ -49,7 +51,7 @@ static bool helperExec(LPCWSTR moDirectory, LPCWSTR commandLine) ::ShellExecuteExW(&execInfo);
- if (::WaitForSingleObject(execInfo.hProcess, INFINITE) != WAIT_OBJECT_0) {
+ if ((execInfo.hProcess == 0) || (::WaitForSingleObject(execInfo.hProcess, INFINITE) != WAIT_OBJECT_0)) {
reportError(QObject::tr("helper failed"));
return false;
}
|
