ReactOS 0.4.15-dev-8002-gbbb3b00
RtlUnwind.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Test for x86 RtlUnwind
5 * COPYRIGHT: Copyright 2024 Timo Kreuzer <timo.kreuzer@reactos.org>
6 */
7
8#include <rtltests.h>
9
12
13VOID
16 _In_ PVOID TargetFrame,
17 _In_ PVOID TargetIp,
18 _In_ PEXCEPTION_RECORD ExceptionRecord,
20
22{
24
27
29 ok(ExcptReg != NULL, "ExcpReg is NULL\n");
30
31 g_InContext.Eax = 0xabcd0001;
32 g_InContext.Ebx = 0xabcd0002;
33 g_InContext.Ecx = 0xabcd0003;
34 g_InContext.Edx = 0xabcd0004;
35 g_InContext.Esi = 0xabcd0005;
36 g_InContext.Edi = 0xabcd0006;
37 RtlUnwindWrapper(ExcptReg, NULL, NULL, (PVOID)0x12345678);
38 ok_eq_hex(g_OutContext.Eax, 0x12345678ul);
45 {
50 }
51 else
52 {
57 }
58}
CONTEXT g_InContext
Definition: RtlUnwind.c:10
VOID WINAPI RtlUnwindWrapper(_In_ PVOID TargetFrame, _In_ PVOID TargetIp, _In_ PEXCEPTION_RECORD ExceptionRecord, _In_ PVOID ReturnValue)
CONTEXT g_OutContext
Definition: RtlUnwind.c:11
UINT32 void void ** ReturnValue
Definition: acevents.h:216
#define ok_eq_hex(value, expected)
Definition: apitest.h:77
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define NULL
Definition: types.h:112
struct _EXCEPTION_REGISTRATION_RECORD * PEXCEPTION_REGISTRATION_RECORD
#define IsWow64Process
Definition: compat.h:760
unsigned int BOOL
Definition: ntddk_ex.h:94
PPC_QUAL unsigned long __readfsdword(const unsigned long Offset)
Definition: intrin_ppc.h:382
#define _In_
Definition: ms_sal.h:308
NTSYSAPI VOID NTAPI RtlUnwind(_In_opt_ PVOID TargetFrame, _In_opt_ PVOID TargetIp, _In_opt_ PEXCEPTION_RECORD ExceptionRecord, _In_ PVOID ReturnValue)
Definition: unwind.c:912
#define NtCurrentProcess()
Definition: nt_native.h:1657
ULONG SegFs
Definition: nt_native.h:1454
ULONG Edx
Definition: nt_native.h:1466
ULONG Esi
Definition: nt_native.h:1464
ULONG Ecx
Definition: nt_native.h:1467
ULONG SegCs
Definition: nt_native.h:1477
ULONG SegDs
Definition: nt_native.h:1456
ULONG Eax
Definition: nt_native.h:1468
ULONG SegEs
Definition: nt_native.h:1455
ULONG Ebx
Definition: nt_native.h:1465
ULONG Edi
Definition: nt_native.h:1463
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
BOOL IsWow64(VOID)
Definition: user_lib.cpp:579
#define WINAPI
Definition: msvc.h:6