From 36575a2e7a04d671d6f9cbe7d261bdbd433f6e33 Mon Sep 17 00:00:00 2001 From: Jinoh Kang Date: Sat, 28 Jan 2023 14:08:07 +0900 Subject: [PATCH] include: Add noreturn attribute to RtlRaiseStatus. This informs the compiler that no code following a RtlRaiseStatus() call will execute, which increases the accuracy of compiler warnings and static analyses. --- dlls/ntdll/exception.c | 4 ++-- include/winternl.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index 556b424ac6e..5b3076387d6 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -191,7 +191,7 @@ LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ) * * Implementation of RtlRaiseStatus with a specific exception record. */ -void raise_status( NTSTATUS status, EXCEPTION_RECORD *rec ) +void DECLSPEC_NORETURN raise_status( NTSTATUS status, EXCEPTION_RECORD *rec ) { EXCEPTION_RECORD ExceptionRec; @@ -208,7 +208,7 @@ void raise_status( NTSTATUS status, EXCEPTION_RECORD *rec ) * * Raise an exception with ExceptionCode = status */ -void WINAPI RtlRaiseStatus( NTSTATUS status ) +void DECLSPEC_NORETURN WINAPI RtlRaiseStatus( NTSTATUS status ) { raise_status( status, NULL ); } diff --git a/include/winternl.h b/include/winternl.h index 4097a574e34..a7f82073ad5 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -4516,7 +4516,7 @@ NTSYSAPI NTSTATUS WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION* NTSYSAPI BOOL WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG*); NTSYSAPI NTSTATUS WINAPI RtlQueueWorkItem(PRTL_WORK_ITEM_ROUTINE,PVOID,ULONG); NTSYSAPI void WINAPI RtlRaiseException(PEXCEPTION_RECORD); -NTSYSAPI void WINAPI RtlRaiseStatus(NTSTATUS); +NTSYSAPI void DECLSPEC_NORETURN WINAPI RtlRaiseStatus(NTSTATUS); NTSYSAPI ULONG WINAPI RtlRandom(PULONG); NTSYSAPI PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,SIZE_T) __WINE_ALLOC_SIZE(4) __WINE_DEALLOC(RtlFreeHeap,3); NTSYSAPI NTSTATUS WINAPI RtlRegisterWait(PHANDLE,HANDLE,RTL_WAITORTIMERCALLBACKFUNC,PVOID,ULONG,ULONG);