(remove old disabled code)
[reactos.git] / reactos / ntoskrnl / ps / i386 / continue.c
1 /* $Id: continue.c,v 1.2 2004/07/02 01:23:26 royce Exp $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/ps/i386/continue.c
6 * PURPOSE: i386 implementation of NtContinue()
7 * PROGRAMMER: Royce Mitchell III, kjk_hyperion
8 * REVISION HISTORY:
9 * 29/06/04: Created
10 */
11
12 /* INCLUDES ****************************************************************/
13
14 #include <ddk/ntddk.h>
15 #include <internal/ke.h>
16 #include <internal/ob.h>
17 #include <internal/ps.h>
18 #include <internal/ob.h>
19 #include <internal/pool.h>
20 #include <ntos/minmax.h>
21 #include <internal/ldr.h>
22 #include <rosrtl/string.h>
23
24 #define NDEBUG
25 #include <internal/debug.h>
26
27 VOID
28 FASTCALL
29 KeRosTrapReturn ( PKTRAP_FRAME TrapFrame, PKTRAP_FRAME PrevTrapFrame );
30
31 VOID STDCALL
32 KeRosDumpStackFrames ( PULONG Frame, ULONG FrameCount );
33
34 /*
35 * @implemented
36 */
37 NTSTATUS STDCALL
38 NtContinue (
39 IN PCONTEXT Context,
40 IN BOOLEAN TestAlert)
41 {
42 PKTRAP_FRAME TrapFrame = KeGetCurrentThread()->TrapFrame;
43 PKTRAP_FRAME PrevTrapFrame = (PKTRAP_FRAME)TrapFrame->Edx;
44
45 DPRINT1("NtContinue: Context: Eip=0x%x, Esp=0x%x\n", Context->Eip, Context->Esp );
46 PULONG Frame = 0;
47 __asm__("mov %%ebp, %%ebx" : "=b" (Frame) : );
48 DbgPrint ( "NtContinue(): Ebp=%x, prev/TF=%x/%x\n", Frame, Frame[0], TrapFrame );
49 KeRosDumpStackFrames(NULL,5);
50
51 if ( Context == NULL )
52 {
53 DPRINT1("NtContinue called with NULL Context\n");
54 return STATUS_INVALID_PARAMETER;
55 }
56
57 if ( TrapFrame == NULL )
58 {
59 CPRINT("NtContinue called but TrapFrame was NULL\n");
60 KEBUGCHECK(0);
61 }
62
63 /*
64 * Copy the supplied context over the register information that was saved
65 * on entry to kernel mode, it will then be restored on exit
66 * FIXME: Validate the context
67 */
68 KeContextToTrapFrame ( Context, TrapFrame );
69
70 KeRosTrapReturn ( TrapFrame, PrevTrapFrame );
71
72 return STATUS_SUCCESS; /* this doesn't actually happen b/c KeRosTrapReturn() won't return */
73 }