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

Side by Side Diff: sandbox/win/src/process_mitigations.cc

Issue 1232723002: win/clang: Remove unused variables in 32-bit builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | sandbox/win/src/service_resolver_32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sandbox/win/src/process_mitigations.h" 5 #include "sandbox/win/src/process_mitigations.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/win/windows_version.h" 9 #include "base/win/windows_version.h"
10 #include "sandbox/win/src/nt_internals.h" 10 #include "sandbox/win/src/nt_internals.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 reinterpret_cast<SetProcessDEPPolicyFunction>( 80 reinterpret_cast<SetProcessDEPPolicyFunction>(
81 ::GetProcAddress(module, "SetProcessDEPPolicy")); 81 ::GetProcAddress(module, "SetProcessDEPPolicy"));
82 if (set_process_dep_policy) { 82 if (set_process_dep_policy) {
83 if (!set_process_dep_policy(dep_flags) && 83 if (!set_process_dep_policy(dep_flags) &&
84 ERROR_ACCESS_DENIED != ::GetLastError() && return_on_fail) { 84 ERROR_ACCESS_DENIED != ::GetLastError() && return_on_fail) {
85 return false; 85 return false;
86 } 86 }
87 } else { 87 } else {
88 // We're on XP sp2, so use the less standard approach. 88 // We're on XP sp2, so use the less standard approach.
89 // For reference: http://www.uninformed.org/?v=2&a=4 89 // For reference: http://www.uninformed.org/?v=2&a=4
90 static const int MEM_EXECUTE_OPTION_ENABLE = 1;
91 static const int MEM_EXECUTE_OPTION_DISABLE = 2; 90 static const int MEM_EXECUTE_OPTION_DISABLE = 2;
92 static const int MEM_EXECUTE_OPTION_ATL7_THUNK_EMULATION = 4; 91 static const int MEM_EXECUTE_OPTION_ATL7_THUNK_EMULATION = 4;
93 static const int MEM_EXECUTE_OPTION_PERMANENT = 8; 92 static const int MEM_EXECUTE_OPTION_PERMANENT = 8;
94 93
95 NtSetInformationProcessFunction set_information_process = NULL; 94 NtSetInformationProcessFunction set_information_process = NULL;
96 ResolveNTFunctionPtr("NtSetInformationProcess", 95 ResolveNTFunctionPtr("NtSetInformationProcess",
97 &set_information_process); 96 &set_information_process);
98 if (!set_information_process) 97 if (!set_information_process)
99 return false; 98 return false;
100 ULONG dep = MEM_EXECUTE_OPTION_DISABLE | MEM_EXECUTE_OPTION_PERMANENT; 99 ULONG dep = MEM_EXECUTE_OPTION_DISABLE | MEM_EXECUTE_OPTION_PERMANENT;
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } 321 }
323 322
324 bool CanSetProcessMitigationsPreStartup(MitigationFlags flags) { 323 bool CanSetProcessMitigationsPreStartup(MitigationFlags flags) {
325 // These mitigations cannot be enabled prior to startup. 324 // These mitigations cannot be enabled prior to startup.
326 return !(flags & (MITIGATION_STRICT_HANDLE_CHECKS | 325 return !(flags & (MITIGATION_STRICT_HANDLE_CHECKS |
327 MITIGATION_DLL_SEARCH_ORDER)); 326 MITIGATION_DLL_SEARCH_ORDER));
328 } 327 }
329 328
330 } // namespace sandbox 329 } // namespace sandbox
331 330
OLDNEW
« no previous file with comments | « no previous file | sandbox/win/src/service_resolver_32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698