|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include <windows.h> |
|
7 #include "nsToolkit.h" |
|
8 #include "mozilla/Assertions.h" |
|
9 #include "mozilla/WindowsVersion.h" |
|
10 |
|
11 #if defined(__GNUC__) |
|
12 // If DllMain gets name mangled, it won't be seen. |
|
13 extern "C" { |
|
14 #endif |
|
15 |
|
16 BOOL APIENTRY DllMain( |
|
17 HINSTANCE hModule, |
|
18 DWORD reason, |
|
19 LPVOID lpReserved ) |
|
20 { |
|
21 switch( reason ) { |
|
22 case DLL_PROCESS_ATTACH: |
|
23 nsToolkit::Startup((HINSTANCE)hModule); |
|
24 break; |
|
25 |
|
26 case DLL_THREAD_ATTACH: |
|
27 break; |
|
28 |
|
29 case DLL_THREAD_DETACH: |
|
30 break; |
|
31 |
|
32 case DLL_PROCESS_DETACH: |
|
33 nsToolkit::Shutdown(); |
|
34 break; |
|
35 |
|
36 } |
|
37 |
|
38 return TRUE; |
|
39 } |
|
40 |
|
41 #if defined(__GNUC__) |
|
42 } // extern "C" |
|
43 #endif |