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

Side by Side Diff: chrome_elf/blacklist/blacklist.h

Issue 1851213002: Remove sandbox on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nacl compile issues Created 4 years, 8 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/blacklist/OWNERS ('k') | chrome_elf/blacklist/blacklist.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_ELF_BLACKLIST_BLACKLIST_H_
6 #define CHROME_ELF_BLACKLIST_BLACKLIST_H_
7
8 #if defined(_WIN64)
9 #include "sandbox/win/src/sandbox_nt_types.h"
10 #endif
11
12 #include <stddef.h>
13
14 namespace blacklist {
15
16 // Max size of the DLL blacklist.
17 const size_t kTroublesomeDllsMaxCount = 64;
18
19 // The DLL blacklist.
20 extern const wchar_t* g_troublesome_dlls[kTroublesomeDllsMaxCount];
21
22 #if defined(_WIN64)
23 extern NtMapViewOfSectionFunction g_nt_map_view_of_section_func;
24 #endif
25
26 // Attempts to leave a beacon in the current user's registry hive. If the
27 // blacklist beacon doesn't say it is enabled or there are any other errors when
28 // creating the beacon, returns false. Otherwise returns true. The intent of the
29 // beacon is to act as an extra failure mode protection whereby if Chrome
30 // repeatedly fails to start during blacklist setup, it will skip blacklisting
31 // on the subsequent run.
32 bool LeaveSetupBeacon();
33
34 // Looks for the setup running beacon that LeaveSetupBeacon() creates and resets
35 // it to to show the setup was successful.
36 // Returns true if the beacon was successfully set to BLACKLIST_ENABLED.
37 bool ResetBeacon();
38
39 // Return the size of the current blacklist.
40 extern "C" int BlacklistSize();
41
42 // Returns if true if the blacklist has been initialized.
43 extern "C" bool IsBlacklistInitialized();
44
45 // Returns the index of the DLL named |dll_name| on the blacklist, or -1 if not
46 // found.
47 extern "C" int GetBlacklistIndex(const wchar_t* dll_name);
48
49 // Adds the given dll name to the blacklist. Returns true if the dll name is in
50 // the blacklist when this returns, false on error. Note that this will copy
51 // |dll_name| and will leak it on exit if the string is not subsequently removed
52 // using RemoveDllFromBlacklist.
53 // Exposed for testing only, this shouldn't be exported from chrome_elf.dll.
54 extern "C" bool AddDllToBlacklist(const wchar_t* dll_name);
55
56 // Removes the given dll name from the blacklist. Returns true if it was
57 // removed, false on error.
58 // Exposed for testing only, this shouldn't be exported from chrome_elf.dll.
59 extern "C" bool RemoveDllFromBlacklist(const wchar_t* dll_name);
60
61 // Returns a list of all the dlls that have been successfully blocked by the
62 // blacklist via blocked_dlls, if there is enough space (according to |size|).
63 // |size| will always be modified to be the number of dlls that were blocked.
64 // The caller doesn't own the strings and isn't expected to free them. These
65 // strings won't be hanging unless RemoveDllFromBlacklist is called, but it
66 // is only exposed in tests (and should stay that way).
67 extern "C" void SuccessfullyBlocked(const wchar_t** blocked_dlls, int* size);
68
69 // Add the dlls, originally passed in through finch, from the registry to the
70 // blacklist so that they will be blocked identically to those hard coded in.
71 extern "C" void AddDllsFromRegistryToBlacklist();
72
73 // Record that the dll at the given index was blocked.
74 extern "C" void BlockedDll(size_t blocked_index);
75
76 // Initializes the DLL blacklist in the current process. This should be called
77 // before any undesirable DLLs might be loaded. If |force| is set to true, then
78 // initialization will take place even if a beacon is present. This is useful
79 // for tests.
80 bool Initialize(bool force);
81
82 } // namespace blacklist
83
84 #endif // CHROME_ELF_BLACKLIST_BLACKLIST_H_
OLDNEW
« no previous file with comments | « chrome_elf/blacklist/OWNERS ('k') | chrome_elf/blacklist/blacklist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698