2 * Copyright 2010 Piotr Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(msvcp90);
31 void* (__cdecl *MSVCRT_operator_new)(MSVCP_size_t);
32 void (__cdecl *MSVCRT_operator_delete)(void*);
33 void* (__cdecl *MSVCRT_set_new_handler)(void*);
35 static void init_cxx_funcs(void)
37 HMODULE hmod = GetModuleHandleA("msvcrt.dll");
39 if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */
41 MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z");
42 MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z");
43 MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z");
47 MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z");
48 MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z");
49 MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z");
53 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
55 TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
59 case DLL_WINE_PREATTACH:
60 return FALSE; /* prefer native version */
61 case DLL_PROCESS_ATTACH:
63 set_exception_vtable();
66 case DLL_PROCESS_DETACH:
74 /* ?_BADOFF@std@@3JB -> long const std::_BADOFF */
75 /* ?_BADOFF@std@@3_JB -> __int64 const std::_BADOFF */
76 const INT_PTR std_BADOFF = -1;
78 /* ?_BADOFF_func@std@@YAABJXZ -> long const & __cdecl std::_BADOFF_func(void) */
79 /* ?_BADOFF_func@std@@YAAEB_JXZ -> __int64 const & __ptr64 __cdecl std::_BADOFF_func(void) */
80 const INT_PTR * __cdecl std_BADOFF_func(void)
85 /* ?_Fpz@std@@3_JA __int64 std::_Fpz */
88 /* ?_Fpz_func@std@@YAAA_JXZ -> __int64 & __cdecl std::_Fpz_func(void) */
89 /* ?_Fpz_func@std@@YAAEA_JXZ -> __int64 & __ptr64 __cdecl std::_Fpz_func(void) */
90 __int64 * __cdecl std_Fpz_func(void)