2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
#include "nsToolkit.h"
|
2012-07-23 14:11:45 -07:00
|
|
|
#include "mozilla/Assertions.h"
|
2013-11-21 19:35:40 -08:00
|
|
|
#include "mozilla/WindowsVersion.h"
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#if defined(__GNUC__)
|
|
|
|
// If DllMain gets name mangled, it won't be seen.
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2008-12-03 05:41:12 -08:00
|
|
|
BOOL APIENTRY DllMain(
|
|
|
|
HINSTANCE hModule,
|
|
|
|
DWORD reason,
|
|
|
|
LPVOID lpReserved )
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
switch( reason ) {
|
|
|
|
case DLL_PROCESS_ATTACH:
|
2008-12-03 05:41:12 -08:00
|
|
|
nsToolkit::Startup((HINSTANCE)hModule);
|
2007-03-22 10:30:00 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DLL_THREAD_ATTACH:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DLL_THREAD_DETACH:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
nsToolkit::Shutdown();
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(__GNUC__)
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|