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

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

Issue 4642970720534528: Issue #1147 (Closed)
Patch Set: Created July 31, 2014, 3:32 p.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,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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld