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

Side by Side Diff: chrome_elf/chrome_elf_security.cc

Issue 2242323002: Revert of [chrome_elf] Big cleanup and removing dependencies that recently crept in. Part 1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « chrome_elf/chrome_elf_security.h ('k') | chrome_elf/chrome_elf_util_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome_elf/chrome_elf_security.h" 5 #include "chrome_elf/chrome_elf_security.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <windows.h> 8 #include <windows.h>
9 #include <versionhelpers.h> // windows.h must be before 9 #include <versionhelpers.h> // windows.h must be before
10 10
11 #include "chrome_elf/chrome_elf_constants.h" 11 #include "chrome_elf/chrome_elf_constants.h"
12 #include "chrome_elf/nt_registry/nt_registry.h" 12 #include "chrome_elf/nt_registry/nt_registry.h"
13 13
14 namespace elf_security {
15
16 void EarlyBrowserSecurity() { 14 void EarlyBrowserSecurity() {
17 typedef decltype(SetProcessMitigationPolicy)* SetProcessMitigationPolicyFunc; 15 typedef decltype(SetProcessMitigationPolicy)* SetProcessMitigationPolicyFunc;
18 16
19 // This function is called from within DllMain. 17 // This function is called from within DllMain.
20 // Don't do anything naughty while we have the loader lock. 18 // Don't do anything naughty while we have the loader lock.
21 NTSTATUS ret_val = STATUS_SUCCESS; 19 NTSTATUS ret_val = STATUS_SUCCESS;
22 HANDLE handle = INVALID_HANDLE_VALUE; 20 HANDLE handle = INVALID_HANDLE_VALUE;
23 21
24 // Check for kRegistrySecurityFinchPath. If it exists, 22 // Check for kRegistrySecurityFinchPath. If it exists,
25 // we do NOT disable extension points. (Emergency off flag.) 23 // we do NOT disable extension points. (Emergency off flag.)
(...skipping 16 matching lines...) Expand all
42 // Disable extension points in this process. 40 // Disable extension points in this process.
43 // (Legacy hooking.) 41 // (Legacy hooking.)
44 PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY policy = {}; 42 PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY policy = {};
45 policy.DisableExtensionPoints = true; 43 policy.DisableExtensionPoints = true;
46 set_process_mitigation_policy(ProcessExtensionPointDisablePolicy, &policy, 44 set_process_mitigation_policy(ProcessExtensionPointDisablePolicy, &policy,
47 sizeof(policy)); 45 sizeof(policy));
48 } 46 }
49 } 47 }
50 return; 48 return;
51 } 49 }
52 } // namespace elf_security
OLDNEW
« no previous file with comments | « chrome_elf/chrome_elf_security.h ('k') | chrome_elf/chrome_elf_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698