1*b146d3b3SDamjan Jovanovic /**************************************************************
2*b146d3b3SDamjan Jovanovic *
3*b146d3b3SDamjan Jovanovic * Licensed to the Apache Software Foundation (ASF) under one
4*b146d3b3SDamjan Jovanovic * or more contributor license agreements. See the NOTICE file
5*b146d3b3SDamjan Jovanovic * distributed with this work for additional information
6*b146d3b3SDamjan Jovanovic * regarding copyright ownership. The ASF licenses this file
7*b146d3b3SDamjan Jovanovic * to you under the Apache License, Version 2.0 (the
8*b146d3b3SDamjan Jovanovic * "License"); you may not use this file except in compliance
9*b146d3b3SDamjan Jovanovic * with the License. You may obtain a copy of the License at
10*b146d3b3SDamjan Jovanovic *
11*b146d3b3SDamjan Jovanovic * http://www.apache.org/licenses/LICENSE-2.0
12*b146d3b3SDamjan Jovanovic *
13*b146d3b3SDamjan Jovanovic * Unless required by applicable law or agreed to in writing,
14*b146d3b3SDamjan Jovanovic * software distributed under the License is distributed on an
15*b146d3b3SDamjan Jovanovic * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b146d3b3SDamjan Jovanovic * KIND, either express or implied. See the License for the
17*b146d3b3SDamjan Jovanovic * specific language governing permissions and limitations
18*b146d3b3SDamjan Jovanovic * under the License.
19*b146d3b3SDamjan Jovanovic *
20*b146d3b3SDamjan Jovanovic *************************************************************/
21*b146d3b3SDamjan Jovanovic
22*b146d3b3SDamjan Jovanovic
23*b146d3b3SDamjan Jovanovic
24*b146d3b3SDamjan Jovanovic
25*b146d3b3SDamjan Jovanovic // MARKER(update_precomp.py): autogen include statement, do not remove
26*b146d3b3SDamjan Jovanovic #include "precompiled_bridges.hxx"
27*b146d3b3SDamjan Jovanovic
28*b146d3b3SDamjan Jovanovic
29*b146d3b3SDamjan Jovanovic #pragma warning(push,1) // disable warnings within system headers
30*b146d3b3SDamjan Jovanovic #include <windows.h>
31*b146d3b3SDamjan Jovanovic #pragma warning(pop)
32*b146d3b3SDamjan Jovanovic
33*b146d3b3SDamjan Jovanovic
34*b146d3b3SDamjan Jovanovic void dso_init(void);
35*b146d3b3SDamjan Jovanovic void dso_exit(void);
36*b146d3b3SDamjan Jovanovic
37*b146d3b3SDamjan Jovanovic
DllMain(HMODULE hModule,DWORD dwReason,LPVOID lpvReserved)38*b146d3b3SDamjan Jovanovic extern "C" BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved)
39*b146d3b3SDamjan Jovanovic {
40*b146d3b3SDamjan Jovanovic switch(dwReason) {
41*b146d3b3SDamjan Jovanovic case DLL_PROCESS_ATTACH:
42*b146d3b3SDamjan Jovanovic DisableThreadLibraryCalls(hModule);
43*b146d3b3SDamjan Jovanovic
44*b146d3b3SDamjan Jovanovic dso_init();
45*b146d3b3SDamjan Jovanovic break;
46*b146d3b3SDamjan Jovanovic
47*b146d3b3SDamjan Jovanovic case DLL_PROCESS_DETACH:
48*b146d3b3SDamjan Jovanovic if (!lpvReserved)
49*b146d3b3SDamjan Jovanovic dso_exit();
50*b146d3b3SDamjan Jovanovic break;
51*b146d3b3SDamjan Jovanovic }
52*b146d3b3SDamjan Jovanovic
53*b146d3b3SDamjan Jovanovic return TRUE;
54*b146d3b3SDamjan Jovanovic }
55