HEAP[IEXPLORE.EXE]: Invalid allocation size - 89FF7630 (exceeded 7ffdefff)
First-chance exception in IEXPLORE.EXE (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
Warning: Uncaught exception in WindowProc (returning 0).
static _CRT_ALLOC_HOOK pfnOldCrtAllocHook = NULL;
int catchMemoryAllocHook(int allocType,
void *userData,
size_t size,
int blockType,
long requestNumber,
const unsigned char *filename,
int lineNumber);
class Init {
public:
Init() {
pfnOldCrtAllocHook = _CrtSetAllocHook(catchMemoryAllocHook);
}
~Init() {
if ( pfnOldCrtAllocHook )
_CrtSetAllocHook(pfnOldCrtAllocHook);
}
};
static Init init;
int catchMemoryAllocHook(int allocType,
void *userData,
size_t size,
int blockType,
long requestNumber,
const unsigned char *filename,
int lineNumber)
{
// internal C library internal allocations
if ( blockType == _CRT_BLOCK )
{
return( TRUE );
}
// check if someone has turned off mem tracing
if ((( _CRTDBG_ALLOC_MEM_DF & _crtDbgFlag) == 0) &&
(( allocType == _HOOK_ALLOC)||
( allocType == _HOOK_REALLOC)))
{
if (pfnOldCrtAllocHook)
{
pfnOldCrtAllocHook(allocType, userData, size, blockType, requestNumber, filename, lineNumber);
}
return TRUE;
}
if (allocType == _HOOK_ALLOC && false)
{
if ( size > 0x7ffdefff ) _CrtDbgBreak();
}
if (pfnOldCrtAllocHook)
{
if ( size > 0x7ffdefff )
_CrtDbgBreak();
pfnOldCrtAllocHook(allocType, userData, size, blockType, requestNumber, filename, lineNumber);
}
return TRUE;
}