1 | /*
|
---|
2 | * msvcrt.dll initialisation functions
|
---|
3 | *
|
---|
4 | * Copyright 2000 Jon Griffiths
|
---|
5 | *
|
---|
6 | * This library is free software; you can redistribute it and/or
|
---|
7 | * modify it under the terms of the GNU Lesser General Public
|
---|
8 | * License as published by the Free Software Foundation; either
|
---|
9 | * version 2.1 of the License, or (at your option) any later version.
|
---|
10 | *
|
---|
11 | * This library is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
14 | * Lesser General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU Lesser General Public
|
---|
17 | * License along with this library; if not, write to the Free Software
|
---|
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
19 | */
|
---|
20 | #include <windows.h>
|
---|
21 | #include <win32type.h>
|
---|
22 | #include <stdlib.h>
|
---|
23 | #include <stdio.h>
|
---|
24 | #include <string.h>
|
---|
25 | #include <odin.h>
|
---|
26 | #include <odinlx.h>
|
---|
27 | #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/
|
---|
28 | #include <initdll.h>
|
---|
29 | #include <exitlist.h>
|
---|
30 | #include <os2sel.h>
|
---|
31 |
|
---|
32 | #include "msvcrt.h"
|
---|
33 | #define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
|
---|
34 | #include "msvcrt/locale.h"
|
---|
35 | #include "msvcrt/stdio.h"
|
---|
36 |
|
---|
37 | #include "wine/debug.h"
|
---|
38 |
|
---|
39 | WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
---|
40 |
|
---|
41 | /* Index to TLS */
|
---|
42 | DWORD MSVCRT_tls_index;
|
---|
43 |
|
---|
44 | static inline BOOL msvcrt_init_tls(void);
|
---|
45 | static inline BOOL msvcrt_free_tls(void);
|
---|
46 | const char* msvcrt_get_reason(DWORD reason) WINE_UNUSED;
|
---|
47 |
|
---|
48 | typedef void* (*MSVCRT_malloc_func)(unsigned int);
|
---|
49 | typedef void (*MSVCRT_free_func)(void*);
|
---|
50 |
|
---|
51 | static HMODULE dllHandle = 0;
|
---|
52 |
|
---|
53 | BOOL WINAPI MSVCRT20_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
|
---|
54 |
|
---|
55 |
|
---|
56 | unsigned long _DLL_InitTerm (unsigned long mod_handle,
|
---|
57 | unsigned long flag)
|
---|
58 | {
|
---|
59 | switch (flag)
|
---|
60 | {
|
---|
61 | case 0:
|
---|
62 |
|
---|
63 | dllHandle = RegisterLxDll(mod_handle, MSVCRT20_Init, 0,0,0,0);
|
---|
64 | return 1;
|
---|
65 |
|
---|
66 | case 1:
|
---|
67 |
|
---|
68 | if(dllHandle) {
|
---|
69 | UnregisterLxDll(dllHandle);
|
---|
70 | }
|
---|
71 | return 1;
|
---|
72 |
|
---|
73 | default:
|
---|
74 | return 0;
|
---|
75 | }
|
---|
76 | return 1;
|
---|
77 | }
|
---|
78 |
|
---|
79 | /*********************************************************************
|
---|
80 | * Init
|
---|
81 | */
|
---|
82 | BOOL WINAPI MSVCRT20_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
---|
83 | {
|
---|
84 | return TRUE;
|
---|
85 | }
|
---|
86 |
|
---|
87 |
|
---|