Index: chrome_elf/blacklist/blacklist_interceptions.cc |
diff --git a/chrome_elf/blacklist/blacklist_interceptions.cc b/chrome_elf/blacklist/blacklist_interceptions.cc |
index b3f3d8256fceedfb74fd01dcc7382b16403079d3..8496c485cd7cb3761bcea865bbb92622ee3fbd92 100644 |
--- a/chrome_elf/blacklist/blacklist_interceptions.cc |
+++ b/chrome_elf/blacklist/blacklist_interceptions.cc |
@@ -35,12 +35,12 @@ FARPROC GetNtDllExportByName(const char* export_name) { |
return ::GetProcAddress(ntdll, export_name); |
} |
-bool DllMatch(const base::string16& module_name) { |
+int DllMatch(const base::string16& module_name) { |
for (int i = 0; blacklist::g_troublesome_dlls[i] != NULL; ++i) { |
if (_wcsicmp(module_name.c_str(), blacklist::g_troublesome_dlls[i]) == 0) |
- return true; |
+ return i; |
} |
- return false; |
+ return -1; |
} |
// TODO(robertshield): Some of the helper functions below overlap somewhat with |
@@ -203,10 +203,15 @@ NTSTATUS BlNtMapViewOfSectionImpl( |
module_name = ExtractLoadedModuleName(file_name); |
} |
- if (!module_name.empty() && DllMatch(module_name)) { |
- DCHECK_NT(g_nt_unmap_view_of_section_func); |
- g_nt_unmap_view_of_section_func(process, *base); |
- ret = STATUS_UNSUCCESSFUL; |
+ if (!module_name.empty()) { |
+ int blocked_index = DllMatch(module_name); |
+ if (blocked_index != -1) { |
+ DCHECK_NT(g_nt_unmap_view_of_section_func); |
+ g_nt_unmap_view_of_section_func(process, *base); |
+ ret = STATUS_UNSUCCESSFUL; |
+ |
+ blacklist::BlockedDll(blocked_index); |
+ } |
} |
} |