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

Unified Diff: remoting/host/win/launch_process_with_token.cc

Issue 602763003: Remove implicit HANDLE conversions from remoting. (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 | « remoting/host/win/elevated_controller.cc ('k') | remoting/host/win/unprivileged_process_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/win/launch_process_with_token.cc
diff --git a/remoting/host/win/launch_process_with_token.cc b/remoting/host/win/launch_process_with_token.cc
index afc6149f58ee904e2586fd6594d8e6beea8d0d5a..f37abc7b03d3adbe02514b1291e3ec1e57cacb32 100644
--- a/remoting/host/win/launch_process_with_token.cc
+++ b/remoting/host/win/launch_process_with_token.cc
@@ -132,7 +132,7 @@ bool CopyProcessToken(DWORD desired_access, ScopedHandle* token_out) {
}
ScopedHandle process_token(temp_handle);
- if (!DuplicateTokenEx(process_token,
+ if (!DuplicateTokenEx(process_token.Get(),
desired_access,
NULL,
SecurityImpersonation,
@@ -165,7 +165,8 @@ bool CreatePrivilegedToken(ScopedHandle* token_out) {
}
// Enable the SE_TCB_NAME privilege.
- if (!AdjustTokenPrivileges(privileged_token, FALSE, &state, 0, NULL, 0)) {
+ if (!AdjustTokenPrivileges(privileged_token.Get(), FALSE, &state, 0, NULL,
+ 0)) {
PLOG(ERROR) << "Failed to enable SE_TCB_NAME privilege in a token";
return false;
}
@@ -380,13 +381,13 @@ bool CreateRemoteSessionProcess(
if (!ConnectToExecutionServer(session_id, &pipe))
return false;
- if (!SendCreateProcessRequest(pipe, application_name, command_line,
+ if (!SendCreateProcessRequest(pipe.Get(), application_name, command_line,
creation_flags, desktop_name)) {
return false;
}
PROCESS_INFORMATION process_information;
- if (!ReceiveCreateProcessResponse(pipe, &process_information))
+ if (!ReceiveCreateProcessResponse(pipe.Get(), &process_information))
return false;
if (!ProcessCreateProcessResponse(creation_flags, &process_information)) {
@@ -421,14 +422,14 @@ bool CreateSessionToken(uint32 session_id, ScopedHandle* token_out) {
if (!CreatePrivilegedToken(&privileged_token)) {
return false;
}
- if (!ImpersonateLoggedOnUser(privileged_token)) {
+ if (!ImpersonateLoggedOnUser(privileged_token.Get())) {
PLOG(ERROR) << "Failed to impersonate the privileged token";
return false;
}
// Change the session ID of the token.
DWORD new_session_id = session_id;
- if (!SetTokenInformation(session_token,
+ if (!SetTokenInformation(session_token.Get(),
TokenSessionId,
&new_session_id,
sizeof(new_session_id))) {
« no previous file with comments | « remoting/host/win/elevated_controller.cc ('k') | remoting/host/win/unprivileged_process_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698