summaryrefslogtreecommitdiffstats
path: root/chrome_elf
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-06 23:38:46 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-06 23:38:46 +0000
commit83b651b30ee5d1b03a1ba5ba806c2714c9622f08 (patch)
tree3b52c5d4ea8630622fc7cb22bdd2298a40553221 /chrome_elf
parent00a9b9404d60a44af6de37fb22b8e05558a6096c (diff)
downloadchromium_src-83b651b30ee5d1b03a1ba5ba806c2714c9622f08.zip
chromium_src-83b651b30ee5d1b03a1ba5ba806c2714c9622f08.tar.gz
chromium_src-83b651b30ee5d1b03a1ba5ba806c2714c9622f08.tar.bz2
Add export to query for blacklisted-ness.
BUG=394532 TEST=unit_tests Review URL: https://codereview.chromium.org/444543002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287899 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_elf')
-rw-r--r--chrome_elf/blacklist/blacklist.cc8
-rw-r--r--chrome_elf/blacklist/blacklist.h4
-rw-r--r--chrome_elf/chrome_elf.def2
3 files changed, 14 insertions, 0 deletions
diff --git a/chrome_elf/blacklist/blacklist.cc b/chrome_elf/blacklist/blacklist.cc
index e6450c1..824a9e9 100644
--- a/chrome_elf/blacklist/blacklist.cc
+++ b/chrome_elf/blacklist/blacklist.cc
@@ -230,6 +230,14 @@ bool IsBlacklistInitialized() {
return g_blacklist_initialized;
}
+int GetBlacklistIndex(const wchar_t* dll_name) {
+ for (int i = 0; i < kTroublesomeDllsMaxCount, g_troublesome_dlls[i]; ++i) {
+ if (_wcsicmp(dll_name, g_troublesome_dlls[i]) == 0)
+ return i;
+ }
+ return -1;
+}
+
bool AddDllToBlacklist(const wchar_t* dll_name) {
int blacklist_size = BlacklistSize();
// We need to leave one space at the end for the null pointer.
diff --git a/chrome_elf/blacklist/blacklist.h b/chrome_elf/blacklist/blacklist.h
index 9ea680c..8a06ef0 100644
--- a/chrome_elf/blacklist/blacklist.h
+++ b/chrome_elf/blacklist/blacklist.h
@@ -40,6 +40,10 @@ int BlacklistSize();
// Returns if true if the blacklist has been initialized.
extern "C" bool IsBlacklistInitialized();
+// Returns the index of the DLL named |dll_name| on the blacklist, or -1 if not
+// found.
+extern "C" int GetBlacklistIndex(const wchar_t* dll_name);
+
// Adds the given dll name to the blacklist. Returns true if the dll name is in
// the blacklist when this returns, false on error. Note that this will copy
// |dll_name| and will leak it on exit if the string is not subsequently removed
diff --git a/chrome_elf/chrome_elf.def b/chrome_elf/chrome_elf.def
index 566a8fb..07541e2 100644
--- a/chrome_elf/chrome_elf.def
+++ b/chrome_elf/chrome_elf.def
@@ -10,3 +10,5 @@ EXPORTS
IsBlacklistInitialized
SignalChromeElf
SuccessfullyBlocked
+ GetBlacklistIndex
+ AddDllToBlacklist