[9633] | 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 | */
|
---|
[10005] | 20 |
|
---|
| 21 | #include <windows.h>
|
---|
| 22 | #include <win32type.h>
|
---|
| 23 | #include <stdlib.h>
|
---|
| 24 | #include <stdio.h>
|
---|
| 25 | #include <string.h>
|
---|
| 26 | #include <odin.h>
|
---|
| 27 | #include <odinlx.h>
|
---|
| 28 | #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/
|
---|
| 29 | #include <initdll.h>
|
---|
| 30 | #include <exitlist.h>
|
---|
| 31 | #include <os2sel.h>
|
---|
| 32 |
|
---|
[9633] | 33 | #include "msvcrt.h"
|
---|
| 34 | #define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)
|
---|
| 35 | #include "msvcrt/locale.h"
|
---|
| 36 | #include "msvcrt/stdio.h"
|
---|
| 37 |
|
---|
| 38 | #include "wine/debug.h"
|
---|
| 39 |
|
---|
| 40 | WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
---|
| 41 |
|
---|
| 42 | /* Index to TLS */
|
---|
| 43 | DWORD MSVCRT_tls_index;
|
---|
| 44 |
|
---|
| 45 | static inline BOOL msvcrt_init_tls(void);
|
---|
| 46 | static inline BOOL msvcrt_free_tls(void);
|
---|
| 47 | const char* msvcrt_get_reason(DWORD reason) WINE_UNUSED;
|
---|
| 48 |
|
---|
| 49 | typedef void* (*MSVCRT_malloc_func)(unsigned int);
|
---|
| 50 | typedef void (*MSVCRT_free_func)(void*);
|
---|
| 51 |
|
---|
| 52 | static HMODULE dllHandle = 0;
|
---|
| 53 |
|
---|
| 54 | BOOL WINAPI MSVCRT40_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
|
---|
| 55 |
|
---|
| 56 |
|
---|
| 57 | unsigned long _DLL_InitTerm (unsigned long mod_handle,
|
---|
| 58 | unsigned long flag)
|
---|
| 59 | {
|
---|
| 60 | switch (flag)
|
---|
| 61 | {
|
---|
| 62 | case 0:
|
---|
| 63 | dllHandle = RegisterLxDll(mod_handle, MSVCRT40_Init, 0,0,0,0);
|
---|
[10005] | 64 | return 1;
|
---|
[9633] | 65 | case 1:
|
---|
| 66 |
|
---|
| 67 | if(dllHandle) {
|
---|
| 68 | UnregisterLxDll(dllHandle);
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 | return 1;
|
---|
| 72 | default:
|
---|
| 73 | return 0;
|
---|
| 74 | }
|
---|
| 75 | return 1;
|
---|
| 76 | }
|
---|
| 77 |
|
---|
| 78 | /*********************************************************************
|
---|
| 79 | * Init
|
---|
| 80 | */
|
---|
| 81 | BOOL WINAPI MSVCRT40_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
---|
| 82 | {
|
---|
[10005] | 83 | return TRUE;
|
---|
[9633] | 84 | }
|
---|
| 85 |
|
---|
| 86 |
|
---|