OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdint.h> | 5 #include <stdint.h> |
6 #include <windows.h> | 6 #include <windows.h> |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 "MSVC*.dll", | 81 "MSVC*.dll", |
82 "VCRUNTIME*.dll", | 82 "VCRUNTIME*.dll", |
83 "api-ms-win-crt-*.dll", | 83 "api-ms-win-crt-*.dll", |
84 #endif | 84 #endif |
85 #if defined(SYZYASAN) | 85 #if defined(SYZYASAN) |
86 "syzyasan_rtl.dll", | 86 "syzyasan_rtl.dll", |
87 #endif | 87 #endif |
88 #if defined(ADDRESS_SANITIZER) && defined(COMPONENT_BUILD) | 88 #if defined(ADDRESS_SANITIZER) && defined(COMPONENT_BUILD) |
89 "clang_rt.asan_dynamic-i386.dll", | 89 "clang_rt.asan_dynamic-i386.dll", |
90 #endif | 90 #endif |
91 "ADVAPI32.dll", | 91 "ADVAPI32.dll" |
92 // On 64 bit the Version API's like VerQueryValue come from VERSION.dll. | |
93 // It depends on kernel32, advapi32 and api-ms-win-crt*.dll. This should | |
94 // be ok. | |
95 "VERSION.dll", | |
96 }; | 92 }; |
97 | 93 |
98 // Make sure all of ELF's imports are in the valid imports list. | 94 // Make sure all of ELF's imports are in the valid imports list. |
99 for (const std::string& import : elf_imports) { | 95 for (const std::string& import : elf_imports) { |
100 bool match = false; | 96 bool match = false; |
101 for (const char* kValidFilePattern : kValidFilePatterns) { | 97 for (const char* kValidFilePattern : kValidFilePatterns) { |
102 if (base::MatchPattern(import, kValidFilePattern)) { | 98 if (base::MatchPattern(import, kValidFilePattern)) { |
103 match = true; | 99 match = true; |
104 break; | 100 break; |
105 } | 101 } |
(...skipping 15 matching lines...) Expand all Loading... |
121 ASSERT_LT(0u, exe_imports.size()) << "Ensure the chrome_elf_unittests " | 117 ASSERT_LT(0u, exe_imports.size()) << "Ensure the chrome_elf_unittests " |
122 "target was built, instead of chrome_elf_unittests.exe"; | 118 "target was built, instead of chrome_elf_unittests.exe"; |
123 | 119 |
124 // Chrome.exe's first import must be ELF. | 120 // Chrome.exe's first import must be ELF. |
125 EXPECT_EQ("chrome_elf.dll", exe_imports[0]) << | 121 EXPECT_EQ("chrome_elf.dll", exe_imports[0]) << |
126 "Illegal import order in chrome.exe (ensure the chrome_elf_unittest " | 122 "Illegal import order in chrome.exe (ensure the chrome_elf_unittest " |
127 "target was built, instead of just chrome_elf_unittests.exe)"; | 123 "target was built, instead of just chrome_elf_unittests.exe)"; |
128 } | 124 } |
129 | 125 |
130 } // namespace | 126 } // namespace |
OLD | NEW |