How to create stack trace from SEH exception

I get an exception using Win32 SEH:

try
{
    // illegal operation that causes access violation
}
__except( seh_filter_func(GetExceptionInformation()) )
{
    // abort
}

where the filter function looks like this:

int seh_filter_func(EXCEPTION_POINTERS *xp)
{
    // log EIP, other registers etc. to file

    return 1;
}

This still works, and the value in xp->ContextRecord->Eiptells me which function caused the access violation (actually ntdll.dll! RtlEnterCriticalSection, and the value for EDX tells me that this function was called with a dummy argument).

However, this function is called in many places, including from other WinAPI functions, so I still don’t know which code is responsible for calling this function with a dummy argument.

- , , , EIP, EXCEPTION_POINTERS ? ( ).

EIP , , , , .

++ Builder 2006 , MSV++ .

+4

All Articles