Commit 3418bf6c authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Implement RtlWalkFrameChain on ARM64EC.

parent 6184f74e
......@@ -1995,6 +1995,38 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec
}
/*************************************************************************
* RtlWalkFrameChain (NTDLL.@)
*/
ULONG WINAPI RtlWalkFrameChain( void **buffer, ULONG count, ULONG flags )
{
UNWIND_HISTORY_TABLE table;
RUNTIME_FUNCTION *func;
PEXCEPTION_ROUTINE handler;
ULONG_PTR pc, frame, base;
CONTEXT context;
void *data;
ULONG i, skip = flags >> 8, num_entries = 0;
RtlCaptureContext( &context );
for (i = 0; i < count; i++)
{
pc = context.Rip;
if ((context.ContextFlags & CONTEXT_UNWOUND_TO_CALL) && RtlIsEcCode( pc )) pc -= 4;
func = RtlLookupFunctionEntry( pc, &base, &table );
if (RtlVirtualUnwind2( UNW_FLAG_NHANDLER, base, pc, func, &context, NULL,
&data, &frame, NULL, NULL, NULL, &handler, 0 ))
break;
if (!context.Rip) break;
if (!frame || !is_valid_frame( frame )) break;
if (context.Rsp == (ULONG_PTR)NtCurrentTeb()->Tib.StackBase) break;
if (i >= skip) buffer[num_entries++] = (void *)context.Rip;
}
return num_entries;
}
/*******************************************************************
* __C_specific_handler (NTDLL.@)
*/
......
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