| Index: chrome_elf/blacklist/test/blacklist_test_main_dll.cc
|
| diff --git a/chrome_elf/blacklist/test/blacklist_test_main_dll.cc b/chrome_elf/blacklist/test/blacklist_test_main_dll.cc
|
| index 8dd16a61d97b872892d3163fe5a248d7fc329bcc..520aa25f082257ea2fc75efcf10c8b45c8b30890 100644
|
| --- a/chrome_elf/blacklist/test/blacklist_test_main_dll.cc
|
| +++ b/chrome_elf/blacklist/test/blacklist_test_main_dll.cc
|
| @@ -2,16 +2,51 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "chrome_elf/blacklist/blacklist.h"
|
| +
|
| #include <windows.h>
|
|
|
| #include "chrome/install_static/install_util.h"
|
| -#include "chrome_elf/blacklist/blacklist.h"
|
| +#include "chrome_elf/nt_registry/nt_registry.h"
|
| +
|
| +namespace {
|
| +
|
| +void GetIpcOverrides() {
|
| + DWORD buffer_size = ::GetEnvironmentVariableW(L"hkcu_override", nullptr, 0);
|
| + if (buffer_size > 0) {
|
| + std::wstring content;
|
| + content.resize(buffer_size);
|
| + buffer_size =
|
| + ::GetEnvironmentVariableW(L"hkcu_override", &content[0], buffer_size);
|
| + if (!buffer_size)
|
| + return;
|
| + nt::HKCU_override.assign(content);
|
| + }
|
| +
|
| + buffer_size = ::GetEnvironmentVariableW(L"hklm_override", nullptr, 0);
|
| + if (buffer_size > 0) {
|
| + std::wstring content;
|
| + content.resize(buffer_size);
|
| + buffer_size =
|
| + ::GetEnvironmentVariableW(L"hklm_override", &content[0], buffer_size);
|
| + if (!buffer_size)
|
| + return;
|
| + nt::HKLM_override.assign(content);
|
| + }
|
| +
|
| + return;
|
| +}
|
| +
|
| +} // namespace
|
|
|
| -extern "C" void InitBlacklistTestDll() {
|
| +extern "C" __declspec(dllexport) void InitTestDll() {
|
| + // Make sure we've got the latest registry overrides.
|
| + GetIpcOverrides();
|
| }
|
|
|
| BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) {
|
| if (reason == DLL_PROCESS_ATTACH) {
|
| + GetIpcOverrides();
|
| install_static::InitializeProcessType();
|
| blacklist::Initialize(true); // force always on, no beacon
|
| }
|
|
|