ntdll: Implement RtlWalkFrameChain on ARM64EC.
This commit is contained in:
parent
6184f74ef5
commit
3418bf6ccd
1 changed files with 32 additions and 0 deletions
|
@ -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.@)
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue