| Index: installer/src/installer-lib/process.cpp |
| =================================================================== |
| --- a/installer/src/installer-lib/process.cpp |
| +++ b/installer/src/installer-lib/process.cpp |
| @@ -17,8 +17,10 @@ |
| if (processNames.find(process.szExeFile) != processNames.end()) |
| { |
| // Make sure the process is still alive |
| - Windows_Handle procHandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, process.th32ProcessID); |
| - if ((procHandle == NULL) || (procHandle == INVALID_HANDLE_VALUE)) return false; |
| + HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, process.th32ProcessID); |
| + // OpenProcess does not return INVALID_HANDLE VALUE, so a simple check is fine. |
|
Eric
2014/07/31 15:37:08
You can kill this comment in your own patch set.
|
| + if (!h) return false; |
|
Eric
2014/07/31 15:44:24
OOPS! This should be 'return true'. If the process
|
| + Windows_Handle procHandle(h); |
| DWORD exitCode; |
| if (!GetExitCodeProcess(procHandle, &exitCode)) return false; |
| @@ -26,8 +28,9 @@ |
| if (exitCode != STILL_ACTIVE) return false; |
| // Check if this is a Windows Store app process (we don't care for IE in Modern UI) |
| - Windows_Module_Handle user32Dll(LoadLibrary(L"user32.dll")); |
| - if (!user32Dll) return true; |
| + HMODULE m = LoadLibrary(L"user32.dll"); |
| + if (!m) return true; |
| + Windows_Module_Handle user32Dll(m); |
| IsImmersiveDynamicFunc IsImmersiveDynamicCall = (IsImmersiveDynamicFunc)GetProcAddress(user32Dll, "IsImmersiveProcess"); |
| if (!IsImmersiveDynamicCall) return true; |