mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
msvcr90: Don't forward new and delete to msvcrt.
This commit is contained in:
parent
4237b85063
commit
1d02768f94
2 changed files with 46 additions and 6 deletions
|
@ -24,6 +24,25 @@
|
|||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
|
||||
static void* (__cdecl *MSVCRT_operator_new)(size_t);
|
||||
static void (__cdecl *MSVCRT_operator_delete)(void*);
|
||||
|
||||
static void init_cxx_funcs(void)
|
||||
{
|
||||
HMODULE hmod = GetModuleHandleA("msvcrt.dll");
|
||||
|
||||
if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */
|
||||
{
|
||||
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z");
|
||||
MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z");
|
||||
}
|
||||
else
|
||||
{
|
||||
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z");
|
||||
MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z");
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* DllMain (MSVCR90.@)
|
||||
*/
|
||||
|
@ -33,6 +52,7 @@ BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved)
|
|||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls(hdll);
|
||||
init_cxx_funcs();
|
||||
_set_printf_count_output(0);
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -59,3 +79,23 @@ void * CDECL MSVCR90_encode_pointer(void * ptr)
|
|||
{
|
||||
return EncodePointer(ptr);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* ??2@YAPAXI@Z (MSVCR90.@)
|
||||
*
|
||||
* Naver LINE expects that this function is implemented inside msvcr90
|
||||
*/
|
||||
void* CDECL MSVCR90_operator_new(size_t size)
|
||||
{
|
||||
return MSVCRT_operator_new(size);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* ??3@YAXPAX@Z (MSVCR90.@)
|
||||
*
|
||||
* Naver LINE expects that this function is implemented inside msvcr90
|
||||
*/
|
||||
void CDECL MSVCR90_operator_delete(void *ptr)
|
||||
{
|
||||
return MSVCRT_operator_delete(ptr);
|
||||
}
|
||||
|
|
|
@ -30,12 +30,12 @@
|
|||
@ cdecl -arch=win64 ??1exception@std@@UEAA@XZ(ptr) msvcrt.??1exception@@UEAA@XZ
|
||||
@ thiscall -arch=i386 ??1type_info@@UAE@XZ(ptr) msvcrt.??1type_info@@UAE@XZ
|
||||
@ cdecl -arch=win64 ??1type_info@@UEAA@XZ(ptr) msvcrt.??1type_info@@UEAA@XZ
|
||||
@ cdecl -arch=win32 ??2@YAPAXI@Z(long) msvcrt.??2@YAPAXI@Z
|
||||
@ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) msvcrt.??2@YAPEAX_K@Z
|
||||
@ cdecl -arch=win32 ??2@YAPAXI@Z(long) MSVCR90_operator_new
|
||||
@ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) MSVCR90_operator_new
|
||||
@ cdecl -arch=win32 ??2@YAPAXIHPBDH@Z(long long str long) msvcrt.??2@YAPAXIHPBDH@Z
|
||||
@ cdecl -arch=win64 ??2@YAPEAX_KHPEBDH@Z(long long str long) msvcrt.??2@YAPEAX_KHPEBDH@Z
|
||||
@ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) msvcrt.??3@YAXPAX@Z
|
||||
@ cdecl -arch=win64 ??3@YAXPEAX@Z(ptr) msvcrt.??3@YAXPEAX@Z
|
||||
@ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) MSVCR90_operator_delete
|
||||
@ cdecl -arch=win64 ??3@YAXPEAX@Z(ptr) MSVCR90_operator_delete
|
||||
@ thiscall -arch=i386 ??4__non_rtti_object@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4__non_rtti_object@@QAEAAV0@ABV0@@Z
|
||||
@ cdecl -arch=win64 ??4__non_rtti_object@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z
|
||||
@ thiscall -arch=i386 ??4bad_cast@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4bad_cast@@QAEAAV0@ABV0@@Z
|
||||
|
@ -61,8 +61,8 @@
|
|||
@ cdecl -arch=win64 ??_U@YAPEAX_K@Z(long) msvcrt.??_U@YAPEAX_K@Z
|
||||
@ cdecl -arch=win32 ??_U@YAPAXIHPBDH@Z(long long str long) msvcrt.??_U@YAPAXIHPBDH@Z
|
||||
@ cdecl -arch=win64 ??_U@YAPEAX_KHPEBDH@Z(long long str long) msvcrt.??_U@YAPEAX_KHPEBDH@Z
|
||||
@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) msvcrt.??_V@YAXPAX@Z
|
||||
@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) msvcrt.??_V@YAXPEAX@Z
|
||||
@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) MSVCR90_operator_delete
|
||||
@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) MSVCR90_operator_delete
|
||||
@ stub -arch=win32 ?_Name_base@type_info@@CAPBDPBV1@PAU__type_info_node@@@Z # private: static char const * __cdecl type_info::_Name_base(class type_info const *,struct __type_info_node *)
|
||||
@ stub -arch=win64 ?_Name_base@type_info@@CAPEBDPEBV1@PEAU__type_info_node@@@Z # private: static char const * __ptr64 __cdecl type_info::_Name_base(class type_info const * __ptr64,struct __type_info_node * __ptr64)
|
||||
@ stub -arch=win32 ?_Name_base_internal@type_info@@CAPBDPBV1@PAU__type_info_node@@@Z # private: static char const * __cdecl type_info::_Name_base_internal(class type_info const *,struct __type_info_node *)
|
||||
|
|
Loading…
Reference in a new issue