| Index: installer/src/installer-lib/process.cpp |
| =================================================================== |
| --- a/installer/src/installer-lib/process.cpp |
| +++ b/installer/src/installer-lib/process.cpp |
| @@ -17,7 +17,11 @@ |
| if (processNames.find(process.szExeFile) != processNames.end()) |
| { |
| // Make sure the process is still alive |
| - Windows_Handle procHandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, process.th32ProcessID); |
| + HANDLE tmpHandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, process.th32ProcessID); |
| + if (tmpHandle == NULL) |
| + return false; |
| + |
| + Windows_Handle procHandle(tmpHandle); |
| if ((procHandle == NULL) || (procHandle == INVALID_HANDLE_VALUE)) return false; |
|
Eric
2014/08/08 14:14:58
This line is redundant. The previous check on tmpH
sergei
2014/08/08 15:17:36
- There is no reason to have tmpHandle.
- As Eric
Eric
2014/08/08 15:34:19
No. See below.
|
| DWORD exitCode; |
| @@ -26,7 +30,10 @@ |
| 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")); |
| + HMODULE tmpModule = LoadLibrary(L"user32.dll"); |
| + if (tmpModule == NULL) |
| + return true; |
| + Windows_Module_Handle user32Dll(tmpModule); |
|
sergei
2014/08/08 15:17:36
Similar here. The problem was in the missed valida
Eric
2014/08/08 15:34:19
It would help to understand the class in question
sergei
2014/08/08 15:45:25
But why? No one standard smart pointer or wrapper
|
| if (!user32Dll) return true; |
| IsImmersiveDynamicFunc IsImmersiveDynamicCall = (IsImmersiveDynamicFunc)GetProcAddress(user32Dll, "IsImmersiveProcess"); |