Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: installer/src/installer-lib/process.cpp

Issue 5643369099296768: Issue 1147 - Fix installation when IE is opened (Closed)
Patch Set: Created Aug. 8, 2014, 9:01 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld