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

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

Issue 5663180676136960: Make sure IE and Engine are actually being closed by custom action (Closed)
Patch Set: Use handle class for HMODULE. Add back a test for immersive case. Created June 26, 2014, 1:24 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 | « installer/src/installer-lib/handle.h ('k') | installer/src/installer-lib/test/process_test.cpp » ('j') | 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
@@ -6,6 +6,8 @@
#include "installer-lib.h"
#include "process.h"
+#include "handle.h"
+#include "session.h"
//-------------------------------------------------------
//-------------------------------------------------------
@@ -15,7 +17,7 @@
if (processNames.find(process.szExeFile) != processNames.end())
{
// Make sure the process is still alive
- HANDLE procHandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, process.th32ProcessID);
+ Windows_Handle procHandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, process.th32ProcessID);
if ((procHandle == NULL) || (procHandle == INVALID_HANDLE_VALUE)) return false;
DWORD exitCode;
@@ -24,14 +26,13 @@
if (exitCode != STILL_ACTIVE) return false;
// Check if this is a Windows Store app process (we don't care for IE in Modern UI)
- HINSTANCE user32Dll = LoadLibrary(L"user32.dll");
+ Windows_Module_Handle user32Dll(LoadLibrary(L"user32.dll"));
if (!user32Dll) return true;
IsImmersiveDynamicFunc IsImmersiveDynamicCall = (IsImmersiveDynamicFunc)GetProcAddress(user32Dll, "IsImmersiveProcess");
if (!IsImmersiveDynamicCall) return true;
BOOL retValue = !IsImmersiveDynamicCall(procHandle);
- CloseHandle(procHandle);
return retValue;
}
« no previous file with comments | « installer/src/installer-lib/handle.h ('k') | installer/src/installer-lib/test/process_test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld