Commit 3a86f0a6 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp90: Remove MSVCRT_ prefix from new() and delete().

parent 6cca4e25
...@@ -58,8 +58,8 @@ DEFINE_VTBL_WRAPPER(56); ...@@ -58,8 +58,8 @@ DEFINE_VTBL_WRAPPER(56);
/* ?_Fpz@std@@3_JB */ /* ?_Fpz@std@@3_JB */
const __int64 std_Fpz = 0; const __int64 std_Fpz = 0;
void* (__cdecl *MSVCRT_operator_new)(size_t); void* (__cdecl *operator_new)(size_t);
void (__cdecl *MSVCRT_operator_delete)(void*); void (__cdecl *operator_delete)(void*);
void* (__cdecl *MSVCRT_set_new_handler)(void*); void* (__cdecl *MSVCRT_set_new_handler)(void*);
static void init_cxx_funcs(void) static void init_cxx_funcs(void)
...@@ -68,14 +68,14 @@ static void init_cxx_funcs(void) ...@@ -68,14 +68,14 @@ static void init_cxx_funcs(void)
if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */ if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */
{ {
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z"); operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z");
MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z"); operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z");
MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z"); MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z");
} }
else else
{ {
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z"); operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z");
MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z"); operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z");
MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z"); MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z");
} }
} }
......
...@@ -32,8 +32,8 @@ void __cdecl _invalid_parameter(const wchar_t*, const wchar_t*, ...@@ -32,8 +32,8 @@ void __cdecl _invalid_parameter(const wchar_t*, const wchar_t*,
const wchar_t*, unsigned int, uintptr_t); const wchar_t*, unsigned int, uintptr_t);
BOOL __cdecl __uncaught_exception(void); BOOL __cdecl __uncaught_exception(void);
extern void* (__cdecl *MSVCRT_operator_new)(size_t); extern void* (__cdecl *operator_new)(size_t);
extern void (__cdecl *MSVCRT_operator_delete)(void*); extern void (__cdecl *operator_delete)(void*);
/* basic_string<char, char_traits<char>, allocator<char>> */ /* basic_string<char, char_traits<char>, allocator<char>> */
typedef struct typedef struct
......
...@@ -100,7 +100,7 @@ _Concurrent_queue_base_v4* __thiscall _Concurrent_queue_base_v4_ctor( ...@@ -100,7 +100,7 @@ _Concurrent_queue_base_v4* __thiscall _Concurrent_queue_base_v4_ctor(
{ {
TRACE("(%p %Iu)\n", this, size); TRACE("(%p %Iu)\n", this, size);
this->data = MSVCRT_operator_new(sizeof(*this->data)); this->data = operator_new(sizeof(*this->data));
memset(this->data, 0, sizeof(*this->data)); memset(this->data, 0, sizeof(*this->data));
this->vtable = &_Concurrent_queue_base_v4_vtable; this->vtable = &_Concurrent_queue_base_v4_vtable;
...@@ -122,7 +122,7 @@ DEFINE_THISCALL_WRAPPER(_Concurrent_queue_base_v4_dtor, 4) ...@@ -122,7 +122,7 @@ DEFINE_THISCALL_WRAPPER(_Concurrent_queue_base_v4_dtor, 4)
void __thiscall _Concurrent_queue_base_v4_dtor(_Concurrent_queue_base_v4 *this) void __thiscall _Concurrent_queue_base_v4_dtor(_Concurrent_queue_base_v4 *this)
{ {
TRACE("(%p)\n", this); TRACE("(%p)\n", this);
MSVCRT_operator_delete(this->data); operator_delete(this->data);
} }
DEFINE_THISCALL_WRAPPER(_Concurrent_queue_base_v4_vector_dtor, 8) DEFINE_THISCALL_WRAPPER(_Concurrent_queue_base_v4_vector_dtor, 8)
...@@ -136,11 +136,11 @@ _Concurrent_queue_base_v4* __thiscall _Concurrent_queue_base_v4_vector_dtor( ...@@ -136,11 +136,11 @@ _Concurrent_queue_base_v4* __thiscall _Concurrent_queue_base_v4_vector_dtor(
for(i=*ptr-1; i>=0; i--) for(i=*ptr-1; i>=0; i--)
_Concurrent_queue_base_v4_dtor(this+i); _Concurrent_queue_base_v4_dtor(this+i);
MSVCRT_operator_delete(ptr); operator_delete(ptr);
} else { } else {
if(flags & 1) if(flags & 1)
_Concurrent_queue_base_v4_dtor(this); _Concurrent_queue_base_v4_dtor(this);
MSVCRT_operator_delete(this); operator_delete(this);
} }
return this; return this;
......
...@@ -133,11 +133,11 @@ void * __thiscall MSVCP_exception_vector_dtor(exception *this, unsigned int flag ...@@ -133,11 +133,11 @@ void * __thiscall MSVCP_exception_vector_dtor(exception *this, unsigned int flag
for(i=*ptr-1; i>=0; i--) for(i=*ptr-1; i>=0; i--)
MSVCP_exception_dtor(this+i); MSVCP_exception_dtor(this+i);
MSVCRT_operator_delete(ptr); operator_delete(ptr);
} else { } else {
MSVCP_exception_dtor(this); MSVCP_exception_dtor(this);
if(flags & 1) if(flags & 1)
MSVCRT_operator_delete(this); operator_delete(this);
} }
return this; return this;
...@@ -149,7 +149,7 @@ void * __thiscall MSVCP_exception_scalar_dtor(exception *this, unsigned int flag ...@@ -149,7 +149,7 @@ void * __thiscall MSVCP_exception_scalar_dtor(exception *this, unsigned int flag
{ {
TRACE("(%p %x)\n", this, flags); TRACE("(%p %x)\n", this, flags);
MSVCP_exception_dtor(this); MSVCP_exception_dtor(this);
if (flags & 1) MSVCRT_operator_delete(this); if (flags & 1) operator_delete(this);
return this; return this;
} }
...@@ -249,11 +249,11 @@ void * __thiscall MSVCP_bad_alloc_vector_dtor(bad_alloc *this, unsigned int flag ...@@ -249,11 +249,11 @@ void * __thiscall MSVCP_bad_alloc_vector_dtor(bad_alloc *this, unsigned int flag
for(i=*ptr-1; i>=0; i--) for(i=*ptr-1; i>=0; i--)
MSVCP_bad_alloc_dtor(this+i); MSVCP_bad_alloc_dtor(this+i);
MSVCRT_operator_delete(ptr); operator_delete(ptr);
} else { } else {
MSVCP_bad_alloc_dtor(this); MSVCP_bad_alloc_dtor(this);
if(flags & 1) if(flags & 1)
MSVCRT_operator_delete(this); operator_delete(this);
} }
return this; return this;
...@@ -353,11 +353,11 @@ void* __thiscall MSVCP_logic_error_vector_dtor( ...@@ -353,11 +353,11 @@ void* __thiscall MSVCP_logic_error_vector_dtor(
for(i=*ptr-1; i>=0; i--) for(i=*ptr-1; i>=0; i--)
MSVCP_logic_error_dtor(this+i); MSVCP_logic_error_dtor(this+i);
MSVCRT_operator_delete(ptr); operator_delete(ptr);
} else { } else {
MSVCP_logic_error_dtor(this); MSVCP_logic_error_dtor(this);
if(flags & 1) if(flags & 1)
MSVCRT_operator_delete(this); operator_delete(this);
} }
return this; return this;
...@@ -369,7 +369,7 @@ void * __thiscall MSVCP_logic_error_scalar_dtor(logic_error *this, unsigned int ...@@ -369,7 +369,7 @@ void * __thiscall MSVCP_logic_error_scalar_dtor(logic_error *this, unsigned int
{ {
TRACE("(%p %x)\n", this, flags); TRACE("(%p %x)\n", this, flags);
MSVCP_logic_error_dtor(this); MSVCP_logic_error_dtor(this);
if (flags & 1) MSVCRT_operator_delete(this); if (flags & 1) operator_delete(this);
return this; return this;
} }
...@@ -597,11 +597,11 @@ void* __thiscall MSVCP_runtime_error_vector_dtor( ...@@ -597,11 +597,11 @@ void* __thiscall MSVCP_runtime_error_vector_dtor(
for(i=*ptr-1; i>=0; i--) for(i=*ptr-1; i>=0; i--)
MSVCP_runtime_error_dtor(this+i); MSVCP_runtime_error_dtor(this+i);
MSVCRT_operator_delete(ptr); operator_delete(ptr);
} else { } else {
MSVCP_runtime_error_dtor(this); MSVCP_runtime_error_dtor(this);
if(flags & 1) if(flags & 1)
MSVCRT_operator_delete(this); operator_delete(this);
} }
return this; return this;
...@@ -793,11 +793,11 @@ void * __thiscall MSVCP_bad_cast_vector_dtor(bad_cast *this, unsigned int flags) ...@@ -793,11 +793,11 @@ void * __thiscall MSVCP_bad_cast_vector_dtor(bad_cast *this, unsigned int flags)
for(i=*ptr-1; i>=0; i--) for(i=*ptr-1; i>=0; i--)
MSVCP_bad_cast_dtor(this+i); MSVCP_bad_cast_dtor(this+i);
MSVCRT_operator_delete(ptr); operator_delete(ptr);
} else { } else {
MSVCP_bad_cast_dtor(this); MSVCP_bad_cast_dtor(this);
if(flags & 1) if(flags & 1)
MSVCRT_operator_delete(this); operator_delete(this);
} }
return this; return this;
......
...@@ -70,7 +70,7 @@ void* __thiscall MSVCP_allocator_char_assign(void *this, const void *assign) ...@@ -70,7 +70,7 @@ void* __thiscall MSVCP_allocator_char_assign(void *this, const void *assign)
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_deallocate, 12) DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_deallocate, 12)
void __thiscall MSVCP_allocator_char_deallocate(void *this, char *ptr, size_t size) void __thiscall MSVCP_allocator_char_deallocate(void *this, char *ptr, size_t size)
{ {
MSVCRT_operator_delete(ptr); operator_delete(ptr);
} }
/* ?allocate@?$allocator@D@std@@QAEPADI@Z */ /* ?allocate@?$allocator@D@std@@QAEPADI@Z */
...@@ -78,7 +78,7 @@ void __thiscall MSVCP_allocator_char_deallocate(void *this, char *ptr, size_t si ...@@ -78,7 +78,7 @@ void __thiscall MSVCP_allocator_char_deallocate(void *this, char *ptr, size_t si
DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_allocate, 8) DEFINE_THISCALL_WRAPPER(MSVCP_allocator_char_allocate, 8)
char* __thiscall MSVCP_allocator_char_allocate(void *this, size_t count) char* __thiscall MSVCP_allocator_char_allocate(void *this, size_t count)
{ {
return MSVCRT_operator_new(count); return operator_new(count);
} }
/* ?allocate@?$allocator@D@std@@QAEPADIPBX@Z */ /* ?allocate@?$allocator@D@std@@QAEPADIPBX@Z */
...@@ -162,7 +162,7 @@ DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_deallocate, 12) ...@@ -162,7 +162,7 @@ DEFINE_THISCALL_WRAPPER(MSVCP_allocator_wchar_deallocate, 12)
void __thiscall MSVCP_allocator_wchar_deallocate(void *this, void __thiscall MSVCP_allocator_wchar_deallocate(void *this,
wchar_t *ptr, size_t size) wchar_t *ptr, size_t size)
{ {
MSVCRT_operator_delete(ptr); operator_delete(ptr);
} }
/* ?allocate@?$allocator@_W@std@@QAEPA_WI@Z */ /* ?allocate@?$allocator@_W@std@@QAEPA_WI@Z */
...@@ -175,7 +175,7 @@ wchar_t* __thiscall MSVCP_allocator_wchar_allocate(void *this, size_t count) ...@@ -175,7 +175,7 @@ wchar_t* __thiscall MSVCP_allocator_wchar_allocate(void *this, size_t count)
return NULL; return NULL;
} }
return MSVCRT_operator_new(count * sizeof(wchar_t)); return operator_new(count * sizeof(wchar_t));
} }
/* ?allocate@?$allocator@_W@std@@QAEPA_WIPBX@Z */ /* ?allocate@?$allocator@_W@std@@QAEPA_WIPBX@Z */
...@@ -260,7 +260,7 @@ DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_deallocate, 12) ...@@ -260,7 +260,7 @@ DEFINE_THISCALL_WRAPPER(MSVCP_allocator_short_deallocate, 12)
void __thiscall MSVCP_allocator_short_deallocate(void *this, void __thiscall MSVCP_allocator_short_deallocate(void *this,
unsigned short *ptr, size_t size) unsigned short *ptr, size_t size)
{ {
MSVCRT_operator_delete(ptr); operator_delete(ptr);
} }
/* ?allocate@?$allocator@G@std@@QAEPAGI@Z */ /* ?allocate@?$allocator@G@std@@QAEPAGI@Z */
...@@ -274,7 +274,7 @@ unsigned short* __thiscall MSVCP_allocator_short_allocate( ...@@ -274,7 +274,7 @@ unsigned short* __thiscall MSVCP_allocator_short_allocate(
return NULL; return NULL;
} }
return MSVCRT_operator_new(count * sizeof(unsigned short)); return operator_new(count * sizeof(unsigned short));
} }
/* ?allocate@?$allocator@G@std@@QAEPAGIPBX@Z */ /* ?allocate@?$allocator@G@std@@QAEPAGIPBX@Z */
......
...@@ -262,7 +262,7 @@ typedef struct __Container_proxy { ...@@ -262,7 +262,7 @@ typedef struct __Container_proxy {
DEFINE_THISCALL_WRAPPER(mutex_ctor, 4) DEFINE_THISCALL_WRAPPER(mutex_ctor, 4)
mutex* __thiscall mutex_ctor(mutex *this) mutex* __thiscall mutex_ctor(mutex *this)
{ {
CRITICAL_SECTION *cs = MSVCRT_operator_new(sizeof(*cs)); CRITICAL_SECTION *cs = operator_new(sizeof(*cs));
if(!cs) { if(!cs) {
ERR("Out of memory\n"); ERR("Out of memory\n");
throw_exception(EXCEPTION_BAD_ALLOC, NULL); throw_exception(EXCEPTION_BAD_ALLOC, NULL);
...@@ -281,7 +281,7 @@ void __thiscall mutex_dtor(mutex *this) ...@@ -281,7 +281,7 @@ void __thiscall mutex_dtor(mutex *this)
{ {
((CRITICAL_SECTION*)this->mutex)->DebugInfo->Spare[0] = 0; ((CRITICAL_SECTION*)this->mutex)->DebugInfo->Spare[0] = 0;
DeleteCriticalSection(this->mutex); DeleteCriticalSection(this->mutex);
MSVCRT_operator_delete(this->mutex); operator_delete(this->mutex);
} }
/* ?_Lock@_Mutex@std@@QAEXXZ */ /* ?_Lock@_Mutex@std@@QAEXXZ */
...@@ -765,7 +765,7 @@ void __cdecl _Mtx_init_in_situ(_Mtx_t mtx, int flags) ...@@ -765,7 +765,7 @@ void __cdecl _Mtx_init_in_situ(_Mtx_t mtx, int flags)
int __cdecl _Mtx_init(_Mtx_t *mtx, int flags) int __cdecl _Mtx_init(_Mtx_t *mtx, int flags)
{ {
*mtx = MSVCRT_operator_new(sizeof(**mtx)); *mtx = operator_new(sizeof(**mtx));
_Mtx_init_in_situ(*mtx, flags); _Mtx_init_in_situ(*mtx, flags);
return 0; return 0;
} }
...@@ -778,7 +778,7 @@ void __cdecl _Mtx_destroy_in_situ(_Mtx_t mtx) ...@@ -778,7 +778,7 @@ void __cdecl _Mtx_destroy_in_situ(_Mtx_t mtx)
void __cdecl _Mtx_destroy(_Mtx_arg_t mtx) void __cdecl _Mtx_destroy(_Mtx_arg_t mtx)
{ {
call_func1(critical_section_dtor, &MTX_T_FROM_ARG(mtx)->cs); call_func1(critical_section_dtor, &MTX_T_FROM_ARG(mtx)->cs);
MSVCRT_operator_delete(MTX_T_FROM_ARG(mtx)); operator_delete(MTX_T_FROM_ARG(mtx));
} }
int __cdecl _Mtx_current_owns(_Mtx_arg_t mtx) int __cdecl _Mtx_current_owns(_Mtx_arg_t mtx)
...@@ -875,7 +875,7 @@ void __cdecl _Cnd_init_in_situ(_Cnd_t cnd) ...@@ -875,7 +875,7 @@ void __cdecl _Cnd_init_in_situ(_Cnd_t cnd)
int __cdecl _Cnd_init(_Cnd_t *cnd) int __cdecl _Cnd_init(_Cnd_t *cnd)
{ {
*cnd = MSVCRT_operator_new(sizeof(**cnd)); *cnd = operator_new(sizeof(**cnd));
_Cnd_init_in_situ(*cnd); _Cnd_init_in_situ(*cnd);
return 0; return 0;
} }
...@@ -940,7 +940,7 @@ void __cdecl _Cnd_destroy(_Cnd_arg_t cnd) ...@@ -940,7 +940,7 @@ void __cdecl _Cnd_destroy(_Cnd_arg_t cnd)
{ {
if(cnd) { if(cnd) {
_Cnd_broadcast(cnd); _Cnd_broadcast(cnd);
MSVCRT_operator_delete(CND_T_FROM_ARG(cnd)); operator_delete(CND_T_FROM_ARG(cnd));
} }
} }
...@@ -1075,10 +1075,10 @@ custom_category* __thiscall custom_category_vector_dtor(custom_category *this, u ...@@ -1075,10 +1075,10 @@ custom_category* __thiscall custom_category_vector_dtor(custom_category *this, u
INT_PTR i, *ptr = (INT_PTR *)this-1; INT_PTR i, *ptr = (INT_PTR *)this-1;
for(i=*ptr-1; i>=0; i--) for(i=*ptr-1; i>=0; i--)
MSVCRT_operator_delete(ptr); operator_delete(ptr);
} else { } else {
if(flags & 1) if(flags & 1)
MSVCRT_operator_delete(this); operator_delete(this);
} }
return this; return this;
...@@ -1624,7 +1624,7 @@ LONGLONG __cdecl _Query_perf_frequency(void) ...@@ -1624,7 +1624,7 @@ LONGLONG __cdecl _Query_perf_frequency(void)
void __cdecl threads__Mtx_new(void **mtx) void __cdecl threads__Mtx_new(void **mtx)
{ {
*mtx = MSVCRT_operator_new(sizeof(CRITICAL_SECTION)); *mtx = operator_new(sizeof(CRITICAL_SECTION));
InitializeCriticalSection(*mtx); InitializeCriticalSection(*mtx);
} }
......
...@@ -41,8 +41,13 @@ void __cdecl _invalid_parameter_noinfo(void); ...@@ -41,8 +41,13 @@ void __cdecl _invalid_parameter_noinfo(void);
BOOL __cdecl __uncaught_exception(void); BOOL __cdecl __uncaught_exception(void);
int __cdecl _callnewh(size_t); int __cdecl _callnewh(size_t);
extern void* (__cdecl *MSVCRT_operator_new)(size_t); #if _MSVCP_VER >= 140
extern void (__cdecl *MSVCRT_operator_delete)(void*); void* __cdecl operator_new(size_t);
void __cdecl operator_delete(void*);
#else
extern void* (__cdecl *operator_new)(size_t);
extern void (__cdecl *operator_delete)(void*);
#endif
extern void* (__cdecl *MSVCRT_set_new_handler)(void*); extern void* (__cdecl *MSVCRT_set_new_handler)(void*);
#if _MSVCP_VER >= 110 #if _MSVCP_VER >= 110
......
...@@ -54,8 +54,6 @@ DEFINE_VTBL_WRAPPER(56); ...@@ -54,8 +54,6 @@ DEFINE_VTBL_WRAPPER(56);
#endif #endif
void* (__cdecl *MSVCRT_operator_new)(size_t);
void (__cdecl *MSVCRT_operator_delete)(void*);
void* (__cdecl *MSVCRT_set_new_handler)(void*); void* (__cdecl *MSVCRT_set_new_handler)(void*);
#if _MSVCP_VER >= 110 #if _MSVCP_VER >= 110
...@@ -79,7 +77,7 @@ bool (__cdecl *Context_IsCurrentTaskCollectionCanceling)(void); ...@@ -79,7 +77,7 @@ bool (__cdecl *Context_IsCurrentTaskCollectionCanceling)(void);
#endif #endif
#if _MSVCP_VER >= 140 #if _MSVCP_VER >= 140
static void* __cdecl operator_new(size_t size) void* __cdecl operator_new(size_t size)
{ {
void *retval; void *retval;
int freed; int freed;
...@@ -100,7 +98,7 @@ static void* __cdecl operator_new(size_t size) ...@@ -100,7 +98,7 @@ static void* __cdecl operator_new(size_t size)
return NULL; return NULL;
} }
static void __cdecl operator_delete(void *mem) void __cdecl operator_delete(void *mem)
{ {
TRACE("(%p)\n", mem); TRACE("(%p)\n", mem);
free(mem); free(mem);
...@@ -110,6 +108,9 @@ void __cdecl _invalid_parameter(const wchar_t *expr, const wchar_t *func, const ...@@ -110,6 +108,9 @@ void __cdecl _invalid_parameter(const wchar_t *expr, const wchar_t *func, const
{ {
_invalid_parameter_noinfo(); _invalid_parameter_noinfo();
} }
#else
void* (__cdecl *operator_new)(size_t);
void (__cdecl *operator_delete)(void*);
#endif #endif
static void init_cxx_funcs(void) static void init_cxx_funcs(void)
...@@ -122,8 +123,6 @@ static void init_cxx_funcs(void) ...@@ -122,8 +123,6 @@ static void init_cxx_funcs(void)
if (!hmod) FIXME( "%s not loaded\n", MSVCRT_NAME(_MSVCP_VER) ); if (!hmod) FIXME( "%s not loaded\n", MSVCRT_NAME(_MSVCP_VER) );
#if _MSVCP_VER >= 140 #if _MSVCP_VER >= 140
MSVCRT_operator_new = operator_new;
MSVCRT_operator_delete = operator_delete;
MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "_set_new_handler"); MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "_set_new_handler");
hcon = LoadLibraryA( CONCRT_NAME(_MSVCP_VER) ); hcon = LoadLibraryA( CONCRT_NAME(_MSVCP_VER) );
...@@ -131,14 +130,14 @@ static void init_cxx_funcs(void) ...@@ -131,14 +130,14 @@ static void init_cxx_funcs(void)
#else #else
if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */ if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */
{ {
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z"); operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z");
MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z"); operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z");
MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z"); MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z");
} }
else else
{ {
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z"); operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z");
MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z"); operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z");
MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z"); MSVCRT_set_new_handler = (void*)GetProcAddress(hmod, "?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z");
} }
#endif #endif
......
...@@ -1630,7 +1630,7 @@ void __thiscall _Yarn_char__Tidy(_Yarn_char *this) ...@@ -1630,7 +1630,7 @@ void __thiscall _Yarn_char__Tidy(_Yarn_char *this)
TRACE("(%p)\n", this); TRACE("(%p)\n", this);
if(this->str) if(this->str)
MSVCRT_operator_delete(this->str); operator_delete(this->str);
this->str = NULL; this->str = NULL;
} }
...@@ -1647,7 +1647,7 @@ _Yarn_char* __thiscall _Yarn_char_op_assign_cstr(_Yarn_char *this, const char *s ...@@ -1647,7 +1647,7 @@ _Yarn_char* __thiscall _Yarn_char_op_assign_cstr(_Yarn_char *this, const char *s
if(str) { if(str) {
size_t len = strlen(str); size_t len = strlen(str);
this->str = MSVCRT_operator_new((len+1)*sizeof(char)); this->str = operator_new((len+1)*sizeof(char));
if(!this->str) { if(!this->str) {
ERR("out of memory\n"); ERR("out of memory\n");
return NULL; return NULL;
...@@ -1741,7 +1741,7 @@ void __thiscall _Yarn_wchar__Tidy(_Yarn_wchar *this) ...@@ -1741,7 +1741,7 @@ void __thiscall _Yarn_wchar__Tidy(_Yarn_wchar *this)
TRACE("(%p)\n", this); TRACE("(%p)\n", this);
if(this->str) if(this->str)
MSVCRT_operator_delete(this->str); operator_delete(this->str);
this->str = NULL; this->str = NULL;
} }
...@@ -1767,7 +1767,7 @@ _Yarn_wchar* __thiscall _Yarn_wchar_op_assign_cstr(_Yarn_wchar *this, const wcha ...@@ -1767,7 +1767,7 @@ _Yarn_wchar* __thiscall _Yarn_wchar_op_assign_cstr(_Yarn_wchar *this, const wcha
if(str) { if(str) {
size_t len = wcslen(str); size_t len = wcslen(str);
this->str = MSVCRT_operator_new((len+1)*sizeof(wchar_t)); this->str = operator_new((len+1)*sizeof(wchar_t));
if(!this->str) { if(!this->str) {
ERR("out of memory\n"); ERR("out of memory\n");
return NULL; return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment