2004-12-09 22:28:35 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
2017-07-06 15:00:35 +03:00
|
|
|
|
2004-12-09 22:28:35 +03:00
|
|
|
#include <windows.h>
|
|
|
|
#include "nsToolkit.h"
|
2012-07-24 01:11:45 +04:00
|
|
|
#include "mozilla/Assertions.h"
|
2013-11-22 07:35:40 +04:00
|
|
|
#include "mozilla/WindowsVersion.h"
|
|
|
|
|
2004-12-09 22:28:35 +03:00
|
|
|
#if defined(__GNUC__)
|
|
|
|
// If DllMain gets name mangled, it won't be seen.
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2017-07-06 15:00:35 +03:00
|
|
|
BOOL APIENTRY DllMain(
|
|
|
|
HINSTANCE hModule,
|
|
|
|
DWORD reason,
|
2008-12-03 16:41:12 +03:00
|
|
|
LPVOID lpReserved )
|
2004-12-09 22:28:35 +03:00
|
|
|
{
|
|
|
|
switch( reason ) {
|
|
|
|
case DLL_PROCESS_ATTACH:
|
2008-12-03 16:41:12 +03:00
|
|
|
nsToolkit::Startup((HINSTANCE)hModule);
|
2004-12-09 22:28:35 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DLL_THREAD_ATTACH:
|
|
|
|
break;
|
2017-07-06 15:00:35 +03:00
|
|
|
|
2004-12-09 22:28:35 +03:00
|
|
|
case DLL_THREAD_DETACH:
|
|
|
|
break;
|
2017-07-06 15:00:35 +03:00
|
|
|
|
2004-12-09 22:28:35 +03:00
|
|
|
case DLL_PROCESS_DETACH:
|
|
|
|
nsToolkit::Shutdown();
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(__GNUC__)
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|