Index: chrome/installer/gcapi/gcapi_dll.cc |
diff --git a/chrome/installer/gcapi/gcapi_dll.cc b/chrome/installer/gcapi/gcapi_dll.cc |
index 26f4098447c89ef1f32ea87117b985f9328666ec..744321a516ae41b35dde5ab7c72dd06d784b4f4b 100644 |
--- a/chrome/installer/gcapi/gcapi_dll.cc |
+++ b/chrome/installer/gcapi/gcapi_dll.cc |
@@ -2,4 +2,37 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include <windows.h> |
+ |
+#include "base/at_exit.h" |
+#include "base/command_line.h" |
+#include "base/logging.h" |
+ |
// Visual Studio needs at least one C++ file in project http://goo.gl/roro9 |
+ |
+namespace { |
+base::AtExitManager* g_exit_manager = NULL; |
+} |
+ |
+// DLL Entry Point - This is necessary to initialize basic things like the |
+// CommandLine and Logging components needed by functions in the DLL. |
+extern "C" BOOL WINAPI DllMain(HINSTANCE instance, |
+ DWORD reason, |
+ LPVOID reserved) { |
+ if (reason == DLL_PROCESS_ATTACH) { |
+ g_exit_manager = new base::AtExitManager(); |
+ CommandLine::Init(0, NULL); |
+ logging::InitLogging( |
+ NULL, |
+ logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG, |
+ logging::LOCK_LOG_FILE, |
+ logging::DELETE_OLD_LOG_FILE, |
+ logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); |
+ } else if (reason == DLL_PROCESS_DETACH) { |
+ CommandLine::Reset(); |
+ delete g_exit_manager; |
+ g_exit_manager = NULL; |
+ } |
+ |
+ return TRUE; |
+} |