msvcirt: Use proper operator_new and operator_delete types.
msvcirt's PARENTSRC imports exception.c from msvcp90, but it uses a function pointer for these functions, resulting in a type mismatch. Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
This commit is contained in:
parent
816c35e0ee
commit
c086a7eb31
2 changed files with 19 additions and 9 deletions
|
@ -38,9 +38,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcirt);
|
|||
#define RESERVE_SIZE 512
|
||||
#define STATEBUF_SIZE 8
|
||||
|
||||
void* (__cdecl *operator_new)(SIZE_T);
|
||||
void (__cdecl *operator_delete)(void*);
|
||||
|
||||
/* ?sh_none@filebuf@@2HB */
|
||||
const int filebuf_sh_none = 0x800;
|
||||
/* ?sh_read@filebuf@@2HB */
|
||||
|
@ -5132,19 +5129,32 @@ void __cdecl _mtunlock(CRITICAL_SECTION *crit)
|
|||
LeaveCriticalSection(crit);
|
||||
}
|
||||
|
||||
static void* (__cdecl *MSVCRT_operator_new)(SIZE_T);
|
||||
static void (__cdecl *MSVCRT_operator_delete)(void*);
|
||||
|
||||
void* __cdecl operator_new(SIZE_T size)
|
||||
{
|
||||
return MSVCRT_operator_new(size);
|
||||
}
|
||||
|
||||
void __cdecl operator_delete(void *mem)
|
||||
{
|
||||
MSVCRT_operator_delete(mem);
|
||||
}
|
||||
|
||||
static void init_cxx_funcs(void)
|
||||
{
|
||||
HMODULE hmod = GetModuleHandleA("msvcrt.dll");
|
||||
|
||||
if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */
|
||||
{
|
||||
operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z");
|
||||
operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z");
|
||||
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z");
|
||||
MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z");
|
||||
}
|
||||
else
|
||||
{
|
||||
operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z");
|
||||
operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z");
|
||||
MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z");
|
||||
MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ typedef enum {
|
|||
FLAGS_stdio = 0x4000
|
||||
} ios_flags;
|
||||
|
||||
extern void* (__cdecl *MSVCRT_operator_new)(SIZE_T);
|
||||
extern void (__cdecl *MSVCRT_operator_delete)(void*);
|
||||
void* __cdecl operator_new(SIZE_T);
|
||||
void __cdecl operator_delete(void*);
|
||||
|
||||
void init_exception(void*);
|
||||
|
|
Loading…
Add table
Reference in a new issue