https://git.reactos.org/?p=reactos.git;a=commitdiff;h=75e2fb4566b7d01437992…
commit 75e2fb4566b7d0143799254fe1ef9a787b9bcc1d
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Mon Apr 18 01:20:22 2022 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Apr 18 02:40:32 2022 +0200
[KERNEL32] Improve annotation of BaseProcess/ThreadStartup(); remove useless cast; fix
PPROCESS_START_ROUTINE return type.
---
dll/win32/kernel32/client/proc.c | 6 +++---
dll/win32/kernel32/client/thread.c | 9 +++++----
dll/win32/kernel32/include/kernel32.h | 15 +++++++++------
3 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/dll/win32/kernel32/client/proc.c b/dll/win32/kernel32/client/proc.c
index 3b7d6f05ec5..a659101137a 100644
--- a/dll/win32/kernel32/client/proc.c
+++ b/dll/win32/kernel32/client/proc.c
@@ -445,12 +445,12 @@ BasepSxsCloseHandles(IN PBASE_MSG_SXS_HANDLES Handles)
}
}
+DECLSPEC_NORETURN
VOID
WINAPI
-BaseProcessStartup(PPROCESS_START_ROUTINE lpStartAddress)
+BaseProcessStartup(
+ _In_ PPROCESS_START_ROUTINE lpStartAddress)
{
- DPRINT("BaseProcessStartup(..) - setting up exception frame.\n");
-
_SEH2_TRY
{
/* Set our Start Address */
diff --git a/dll/win32/kernel32/client/thread.c b/dll/win32/kernel32/client/thread.c
index 6d31a1b394d..0df088d510e 100644
--- a/dll/win32/kernel32/client/thread.c
+++ b/dll/win32/kernel32/client/thread.c
@@ -50,11 +50,12 @@ BasepNotifyCsrOfThread(IN HANDLE ThreadHandle,
return STATUS_SUCCESS;
}
-__declspec(noreturn)
+DECLSPEC_NORETURN
VOID
WINAPI
-BaseThreadStartup(IN LPTHREAD_START_ROUTINE lpStartAddress,
- IN LPVOID lpParameter)
+BaseThreadStartup(
+ _In_ LPTHREAD_START_ROUTINE lpStartAddress,
+ _In_ LPVOID lpParameter)
{
/* Attempt to call the Thread Start Address */
_SEH2_TRY
@@ -67,7 +68,7 @@ BaseThreadStartup(IN LPTHREAD_START_ROUTINE lpStartAddress,
}
/* Get the exit code from the Thread Start */
- ExitThread((lpStartAddress)((PVOID)lpParameter));
+ ExitThread(lpStartAddress(lpParameter));
}
_SEH2_EXCEPT(UnhandledExceptionFilter(_SEH2_GetExceptionInformation()))
{
diff --git a/dll/win32/kernel32/include/kernel32.h
b/dll/win32/kernel32/include/kernel32.h
index ef47d4d946c..c331e45f465 100644
--- a/dll/win32/kernel32/include/kernel32.h
+++ b/dll/win32/kernel32/include/kernel32.h
@@ -234,22 +234,25 @@ BasepProbeForDllManifest(
OUT PVOID *ActCtx
);
-__declspec(noreturn)
+DECLSPEC_NORETURN
VOID
WINAPI
-BaseThreadStartup(LPTHREAD_START_ROUTINE lpStartAddress,
- LPVOID lpParameter);
+BaseThreadStartup(
+ _In_ LPTHREAD_START_ROUTINE lpStartAddress,
+ _In_ LPVOID lpParameter);
-__declspec(noreturn)
+DECLSPEC_NORETURN
VOID
WINAPI
BaseFiberStartup(VOID);
-typedef UINT (WINAPI *PPROCESS_START_ROUTINE)(VOID);
+typedef DWORD (WINAPI *PPROCESS_START_ROUTINE)(VOID);
+DECLSPEC_NORETURN
VOID
WINAPI
-BaseProcessStartup(PPROCESS_START_ROUTINE lpStartAddress);
+BaseProcessStartup(
+ _In_ PPROCESS_START_ROUTINE lpStartAddress);
PVOID
WINAPI