michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include michael@0: #include "nsToolkit.h" michael@0: #include "mozilla/Assertions.h" michael@0: #include "mozilla/WindowsVersion.h" michael@0: michael@0: #if defined(__GNUC__) michael@0: // If DllMain gets name mangled, it won't be seen. michael@0: extern "C" { michael@0: #endif michael@0: michael@0: BOOL APIENTRY DllMain( michael@0: HINSTANCE hModule, michael@0: DWORD reason, michael@0: LPVOID lpReserved ) michael@0: { michael@0: switch( reason ) { michael@0: case DLL_PROCESS_ATTACH: michael@0: nsToolkit::Startup((HINSTANCE)hModule); michael@0: break; michael@0: michael@0: case DLL_THREAD_ATTACH: michael@0: break; michael@0: michael@0: case DLL_THREAD_DETACH: michael@0: break; michael@0: michael@0: case DLL_PROCESS_DETACH: michael@0: nsToolkit::Shutdown(); michael@0: break; michael@0: michael@0: } michael@0: michael@0: return TRUE; michael@0: } michael@0: michael@0: #if defined(__GNUC__) michael@0: } // extern "C" michael@0: #endif