Index: remoting/host/win/chromoting_module.cc |
diff --git a/remoting/host/win/chromoting_module.cc b/remoting/host/win/chromoting_module.cc |
index 630c6c254159ca8a71bbb64636c4f55a02eb6857..724ce7eb58ea759e2db6e035a21e173482131724 100644 |
--- a/remoting/host/win/chromoting_module.cc |
+++ b/remoting/host/win/chromoting_module.cc |
@@ -42,13 +42,12 @@ |
// Lowers the process integrity level such that it does not exceed |max_level|. |
// |max_level| is expected to be one of SECURITY_MANDATORY_XXX constants. |
bool LowerProcessIntegrityLevel(DWORD max_level) { |
- HANDLE temp_handle; |
+ base::win::ScopedHandle token; |
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY | TOKEN_WRITE, |
- &temp_handle)) { |
+ token.Receive())) { |
PLOG(ERROR) << "OpenProcessToken() failed"; |
return false; |
} |
- base::win::ScopedHandle token(temp_handle); |
TypedBuffer<TOKEN_MANDATORY_LABEL> mandatory_label; |
DWORD length = 0; |