xref: /aoo41x/main/sal/osl/os2/dllentry.c (revision 647f063d)
1*647f063dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*647f063dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*647f063dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*647f063dSAndrew Rist  * distributed with this work for additional information
6*647f063dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*647f063dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*647f063dSAndrew Rist  * "License"); you may not use this file except in compliance
9*647f063dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*647f063dSAndrew Rist  *
11*647f063dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*647f063dSAndrew Rist  *
13*647f063dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*647f063dSAndrew Rist  * software distributed under the License is distributed on an
15*647f063dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*647f063dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*647f063dSAndrew Rist  * specific language governing permissions and limitations
18*647f063dSAndrew Rist  * under the License.
19*647f063dSAndrew Rist  *
20*647f063dSAndrew Rist  *************************************************************/
21*647f063dSAndrew Rist 
22*647f063dSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "system.h"
25cdf0e10cSrcweir #include "sockimpl.h"
26cdf0e10cSrcweir #include "secimpl.h"
27cdf0e10cSrcweir //#include "daemimpl.h"
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <osl/diagnose.h>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #ifndef GCC
_DLL_InitTerm(sal_uInt32 nModule,sal_uInt32 nFlag)32cdf0e10cSrcweir sal_uInt32 _System _DLL_InitTerm( sal_uInt32 nModule,
33cdf0e10cSrcweir 									 sal_uInt32 nFlag )
34cdf0e10cSrcweir {
35cdf0e10cSrcweir 	switch( nFlag )
36cdf0e10cSrcweir 	{
37cdf0e10cSrcweir 		case 0:
38cdf0e10cSrcweir 		{
39cdf0e10cSrcweir 			/* initialize C runtime library */
40cdf0e10cSrcweir 			_CRT_init();
41cdf0e10cSrcweir 			{
42cdf0e10cSrcweir 				LONG fhToAdd = 0;
43cdf0e10cSrcweir 				ULONG fhOld = 0;
44cdf0e10cSrcweir 				ULONG ngLastError = DosSetRelMaxFH(&fhToAdd, &fhOld);
45cdf0e10cSrcweir 				if (fhOld < 200)
46cdf0e10cSrcweir 					ngLastError = DosSetMaxFH(200);
47cdf0e10cSrcweir 			}
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 			/* turn off hardware-errors and exception popups */
50cdf0e10cSrcweir 			DosError(FERR_DISABLEHARDERR | FERR_DISABLEEXCEPTION);
51cdf0e10cSrcweir 
52cdf0e10cSrcweir 			break;
53cdf0e10cSrcweir 		}
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 		case 1:
56cdf0e10cSrcweir 		{
57cdf0e10cSrcweir 			/* unload libs (sockets) */
58cdf0e10cSrcweir 			ImplFreeTCPIP();
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 			/* unload libs (security) */
61cdf0e10cSrcweir 			ImplFreeUPM();
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 			break;
64cdf0e10cSrcweir 		}
65cdf0e10cSrcweir 	}
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 	return (sal_True);
68cdf0e10cSrcweir }
69cdf0e10cSrcweir #endif
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 
72