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 #include "chrome_elf/blacklist/blacklist.h" | 5 #include "chrome_elf/blacklist/blacklist.h" |
6 | 6 |
7 #include <assert.h> | 7 #include <assert.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 0, | 190 0, |
191 &type, | 191 &type, |
192 reinterpret_cast<LPBYTE>(&blacklist_state), | 192 reinterpret_cast<LPBYTE>(&blacklist_state), |
193 &blacklist_state_size); | 193 &blacklist_state_size); |
194 | 194 |
195 if (result != ERROR_SUCCESS || type != REG_DWORD) { | 195 if (result != ERROR_SUCCESS || type != REG_DWORD) { |
196 ::RegCloseKey(key); | 196 ::RegCloseKey(key); |
197 return false; | 197 return false; |
198 } | 198 } |
199 | 199 |
200 // Reaching this point with the setup running state means the setup | 200 // Reaching this point with the setup running state means the setup did not |
201 // succeeded and so we reset to enabled. Any other state indicates that setup | 201 // crash, so we reset to enabled. Any other state indicates that setup was |
202 // was skipped; in that case we leave the state alone for later recording. | 202 // skipped; in that case we leave the state alone for later recording. |
203 if (blacklist_state == BLACKLIST_SETUP_RUNNING) | 203 if (blacklist_state == BLACKLIST_SETUP_RUNNING) |
204 result = SetDWValue(&key, kBeaconState, BLACKLIST_ENABLED); | 204 result = SetDWValue(&key, kBeaconState, BLACKLIST_ENABLED); |
205 | 205 |
206 ::RegCloseKey(key); | 206 ::RegCloseKey(key); |
207 return (result == ERROR_SUCCESS); | 207 return (result == ERROR_SUCCESS); |
208 } | 208 } |
209 | 209 |
210 int BlacklistSize() { | 210 int BlacklistSize() { |
211 int size = -1; | 211 int size = -1; |
212 while (blacklist::g_troublesome_dlls[++size] != NULL) {} | 212 while (blacklist::g_troublesome_dlls[++size] != NULL) {} |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 } | 416 } |
417 | 417 |
418 // Delete the finch registry key to clear the values. | 418 // Delete the finch registry key to clear the values. |
419 result = ::RegDeleteKey(key, L""); | 419 result = ::RegDeleteKey(key, L""); |
420 | 420 |
421 ::RegCloseKey(key); | 421 ::RegCloseKey(key); |
422 return result == ERROR_SUCCESS; | 422 return result == ERROR_SUCCESS; |
423 } | 423 } |
424 | 424 |
425 } // namespace blacklist | 425 } // namespace blacklist |
OLD | NEW |