| OLD | NEW |
| 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 #ifndef CHROME_ELF_BLACKLIST_BLACKLIST_H_ | 5 #ifndef CHROME_ELF_BLACKLIST_BLACKLIST_H_ |
| 6 #define CHROME_ELF_BLACKLIST_BLACKLIST_H_ | 6 #define CHROME_ELF_BLACKLIST_BLACKLIST_H_ |
| 7 | 7 |
| 8 #if defined(_WIN64) |
| 9 #include "sandbox/win/src/sandbox_nt_types.h" |
| 10 #endif |
| 11 |
| 8 namespace blacklist { | 12 namespace blacklist { |
| 9 | 13 |
| 10 // Max size of the DLL blacklist. | 14 // Max size of the DLL blacklist. |
| 11 const int kTroublesomeDllsMaxCount = 64; | 15 const int kTroublesomeDllsMaxCount = 64; |
| 12 | 16 |
| 13 // The DLL blacklist. | 17 // The DLL blacklist. |
| 14 extern const wchar_t* g_troublesome_dlls[kTroublesomeDllsMaxCount]; | 18 extern const wchar_t* g_troublesome_dlls[kTroublesomeDllsMaxCount]; |
| 15 | 19 |
| 16 // The registry path of the blacklist beacon. | 20 // The registry path of the blacklist beacon. |
| 17 extern const wchar_t kRegistryBeaconPath[]; | 21 extern const wchar_t kRegistryBeaconPath[]; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 30 // The blacklist thunk setup code is running. If this is still set at startup, | 34 // The blacklist thunk setup code is running. If this is still set at startup, |
| 31 // it means the last setup crashed during thunk setup. | 35 // it means the last setup crashed during thunk setup. |
| 32 BLACKLIST_THUNK_SETUP, | 36 BLACKLIST_THUNK_SETUP, |
| 33 // The blacklist code is currently intercepting MapViewOfSection. If this is | 37 // The blacklist code is currently intercepting MapViewOfSection. If this is |
| 34 // still set at startup, it means we crashed during interception. | 38 // still set at startup, it means we crashed during interception. |
| 35 BLACKLIST_INTERCEPTING, | 39 BLACKLIST_INTERCEPTING, |
| 36 // Always keep this at the end. | 40 // Always keep this at the end. |
| 37 BLACKLIST_STATE_MAX, | 41 BLACKLIST_STATE_MAX, |
| 38 }; | 42 }; |
| 39 | 43 |
| 44 #if defined(_WIN64) |
| 45 extern NtMapViewOfSectionFunction g_nt_map_view_of_section_func; |
| 46 #endif |
| 47 |
| 40 // Attempts to leave a beacon in the current user's registry hive. | 48 // Attempts to leave a beacon in the current user's registry hive. |
| 41 // If the blacklist beacon doesn't say it is enabled or there are any other | 49 // If the blacklist beacon doesn't say it is enabled or there are any other |
| 42 // errors when creating the beacon, returns false. Otherwise returns true. | 50 // errors when creating the beacon, returns false. Otherwise returns true. |
| 43 // The intent of the beacon is to act as an extra failure mode protection | 51 // The intent of the beacon is to act as an extra failure mode protection |
| 44 // whereby if Chrome for some reason fails to start during blacklist setup, | 52 // whereby if Chrome for some reason fails to start during blacklist setup, |
| 45 // it will skip blacklisting on the subsequent run. | 53 // it will skip blacklisting on the subsequent run. |
| 46 bool LeaveSetupBeacon(); | 54 bool LeaveSetupBeacon(); |
| 47 | 55 |
| 48 // Looks for the beacon that LeaveSetupBeacon() creates and resets it to | 56 // Looks for the beacon that LeaveSetupBeacon() creates and resets it to |
| 49 // to show the setup was successful. | 57 // to show the setup was successful. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 65 | 73 |
| 66 // Initializes the DLL blacklist in the current process. This should be called | 74 // Initializes the DLL blacklist in the current process. This should be called |
| 67 // before any undesirable DLLs might be loaded. If |force| is set to true, then | 75 // before any undesirable DLLs might be loaded. If |force| is set to true, then |
| 68 // initialization will take place even if a beacon is present. This is useful | 76 // initialization will take place even if a beacon is present. This is useful |
| 69 // for tests. | 77 // for tests. |
| 70 bool Initialize(bool force); | 78 bool Initialize(bool force); |
| 71 | 79 |
| 72 } // namespace blacklist | 80 } // namespace blacklist |
| 73 | 81 |
| 74 #endif // CHROME_ELF_BLACKLIST_BLACKLIST_H_ | 82 #endif // CHROME_ELF_BLACKLIST_BLACKLIST_H_ |
| OLD | NEW |