add 64-bit mangled names of new and delete
parent
3344b3eef1
commit
32b47f1a66
16
dll.cpp
16
dll.cpp
|
|
@ -96,14 +96,24 @@ static void SetNewAndDeleteFunctionPointers()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// try getting these directly using mangled names of new and delete operators
|
||||||
|
|
||||||
hModule = GetModuleHandle("msvcrtd");
|
hModule = GetModuleHandle("msvcrtd");
|
||||||
if (!hModule)
|
if (!hModule)
|
||||||
hModule = GetModuleHandle("msvcrt");
|
hModule = GetModuleHandle("msvcrt");
|
||||||
if (hModule)
|
if (hModule)
|
||||||
{
|
{
|
||||||
s_pNew = (PNew)GetProcAddress(hModule, "??2@YAPAXI@Z"); // operator new
|
// 32-bit versions
|
||||||
s_pDelete = (PDelete)GetProcAddress(hModule, "??3@YAXPAX@Z"); // operator delete
|
s_pNew = (PNew)GetProcAddress(hModule, "??2@YAPAXI@Z");
|
||||||
return;
|
s_pDelete = (PDelete)GetProcAddress(hModule, "??3@YAXPAX@Z");
|
||||||
|
if (s_pNew && s_pDelete)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// 64-bit versions
|
||||||
|
s_pNew = (PNew)GetProcAddress(hModule, "??2@YAPEAX_K@Z");
|
||||||
|
s_pDelete = (PDelete)GetProcAddress(hModule, "??3@YAXPEAX@Z");
|
||||||
|
if (s_pNew && s_pDelete)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputDebugString("Crypto++ was not able to obtain new and delete function pointers.\n");
|
OutputDebugString("Crypto++ was not able to obtain new and delete function pointers.\n");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue