Index: installer/src/installer-lib/process.cpp |
=================================================================== |
--- a/installer/src/installer-lib/process.cpp |
+++ b/installer/src/installer-lib/process.cpp |
@@ -216,7 +216,7 @@ |
* - MSDN [WM_QUERYENDSESSION message](http://msdn.microsoft.com/en-us/library/windows/desktop/aa376890%28v=vs.85%29.aspx) |
* - MSDN [WM_ENDSESSION message](http://msdn.microsoft.com/en-us/library/windows/desktop/aa376889%28v=vs.85%29.aspx) |
*/ |
-bool ProcessCloser::ShutDown() |
+bool ProcessCloser::ShutDown(ImmediateSession& session) |
{ |
/* |
* If we're not running, we don't need to shut down. |
@@ -280,18 +280,30 @@ |
case 4: |
/* |
- * We're out of ways to try to shut down. Oh well. Take cover. It gets violent here. |
+ * Oh well. Take cover. It gets violent here. Try to kill all matching processes. |
*/ |
for (auto it = pid_set.begin(); it != pid_set.end(); ++it) |
{ |
HANDLE tmpHandle = OpenProcess(PROCESS_TERMINATE, FALSE, *it); |
- if (!tmpHandle) continue; |
+ if (!tmpHandle) |
+ { |
+ std::ostringstream stream; |
+ stream << "Can't open process for termination. Error: " << GetLastError(); |
Eric
2015/05/14 15:09:25
This message should indicate a warning rather than
|
+ session.Log(stream.str()); |
+ continue; |
+ } |
Windows_Handle procHandle(tmpHandle); |
- TerminateProcess(tmpHandle, 0); |
+ if (!TerminateProcess(tmpHandle, 0)) |
+ { |
+ std::ostringstream stream; |
+ stream << "Can't terminate process. Error: " << GetLastError(); |
+ session.Log(stream.str()); |
+ } |
} |
break; |
default: |
+ // We're out of ways to try to shut down. |
return false; |
} |