From 48d69bb1fc07e793003c0a282eccdda162ddc150 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 17 Nov 2008 19:52:30 +0000 Subject: [PATCH] Add RtlUnwind stub to rtl... svn path=/branches/ros-amd64-bringup/; revision=37419 --- reactos/lib/rtl/amd64/unwind.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/reactos/lib/rtl/amd64/unwind.c b/reactos/lib/rtl/amd64/unwind.c index ac3c3568b89..20ed21fd976 100644 --- a/reactos/lib/rtl/amd64/unwind.c +++ b/reactos/lib/rtl/amd64/unwind.c @@ -1,7 +1,8 @@ -/* COPYRIGHT: See COPYING in the top level directory +/* + * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries * PURPOSE: Exception related functions - * PROGRAMMER: Timo Kreuzer + * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org) */ /* INCLUDES *****************************************************************/ @@ -132,7 +133,6 @@ RtlLookupFunctionEntry( /* Do a binary search */ IndexLo = 0; IndexHi = TableLength; - while (IndexHi > IndexLo) { IndexMid = (IndexLo + IndexHi) / 2; @@ -293,7 +293,7 @@ RtlVirtualUnwind( /* Unwind is finished, pop new Rip from Stack */ Context->Rip = *(DWORD64*)Context->Rsp; - Context->Rsp += 8; + Context->Rsp += sizeof(DWORD64); return 0; } @@ -312,6 +312,18 @@ RtlUnwindEx( return; } +VOID +NTAPI +RtlUnwind( + IN PVOID TargetFrame, + IN PVOID TargetIp, + IN PEXCEPTION_RECORD ExceptionRecord, + IN PVOID ReturnValue) +{ + UNIMPLEMENTED; + return; +} + ULONG NTAPI RtlWalkFrameChain(OUT PVOID *Callers, @@ -345,9 +357,9 @@ DPRINT1("RtlWalkFrameChain called\n"); /* Is this a leaf function? */ if (!FunctionEntry) { - Context.Rip = *(ULONG64*)Context.Rsp; - Context.Rsp += sizeof(ULONG64); - DPRINT1("leaf funtion, new Rip = %p, new Rsp = %p\n", (PVOID)Context.Rip, (PVOID)Context.Rsp); + Context.Rip = *(DWORD64*)Context.Rsp; + Context.Rsp += sizeof(DWORD64); + DPRINT("leaf funtion, new Rip = %p, new Rsp = %p\n", (PVOID)Context.Rip, (PVOID)Context.Rsp); } else { @@ -359,7 +371,7 @@ DPRINT1("RtlWalkFrameChain called\n"); &HandlerData, &EstablisherFrame, NULL); - DPRINT1("normal funtion, new Rip = %p, new Rsp = %p\n", (PVOID)Context.Rip, (PVOID)Context.Rsp); + DPRINT("normal funtion, new Rip = %p, new Rsp = %p\n", (PVOID)Context.Rip, (PVOID)Context.Rsp); } ControlPc = Context.Rip;