Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(587)

Unified Diff: sandbox/win/src/target_process.cc

Issue 606443002: Remove implicit HANDLE conversions from sandbox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/win/src/sync_policy_test.cc ('k') | sandbox/win/tests/common/controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/target_process.cc
diff --git a/sandbox/win/src/target_process.cc b/sandbox/win/src/target_process.cc
index 5f73adcd4f9b14a3d79268d29ba0b3f41aea9bdc..fea52b2a6885459b29e6fa671d32ba5705a331ea 100644
--- a/sandbox/win/src/target_process.cc
+++ b/sandbox/win/src/target_process.cc
@@ -132,7 +132,7 @@ DWORD TargetProcess::Create(const wchar_t* exe_path,
}
PROCESS_INFORMATION temp_process_info = {};
- if (!::CreateProcessAsUserW(lockdown_token_,
+ if (!::CreateProcessAsUserW(lockdown_token_.Get(),
exe_path,
cmd_line.get(),
NULL, // No security attribute.
@@ -164,7 +164,7 @@ DWORD TargetProcess::Create(const wchar_t* exe_path,
// impersonation token with more rights. This allows the target to start;
// otherwise it will crash too early for us to help.
HANDLE temp_thread = process_info.thread_handle();
- if (!::SetThreadToken(&temp_thread, initial_token_)) {
+ if (!::SetThreadToken(&temp_thread, initial_token_.Get())) {
win_result = ::GetLastError();
// It might be a security breach if we let the target run outside the job
// so kill it before it causes damage.
@@ -261,13 +261,13 @@ DWORD TargetProcess::Init(Dispatcher* ipc_dispatcher, void* policy,
DWORD access = FILE_MAP_READ | FILE_MAP_WRITE;
HANDLE target_shared_section;
- if (!::DuplicateHandle(::GetCurrentProcess(), shared_section_,
+ if (!::DuplicateHandle(::GetCurrentProcess(), shared_section_.Get(),
sandbox_process_info_.process_handle(),
&target_shared_section, access, FALSE, 0)) {
return ::GetLastError();
}
- void* shared_memory = ::MapViewOfFile(shared_section_,
+ void* shared_memory = ::MapViewOfFile(shared_section_.Get(),
FILE_MAP_WRITE|FILE_MAP_READ,
0, 0, 0);
if (NULL == shared_memory) {
« no previous file with comments | « sandbox/win/src/sync_policy_test.cc ('k') | sandbox/win/tests/common/controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698