https://git.reactos.org/?p=reactos.git;a=commitdiff;h=addc01d90b41245624ef3…
commit addc01d90b41245624ef3d5c739ad4b79f0a3bdb
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Thu Jul 12 15:36:11 2018 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Wed Mar 6 00:39:25 2019 +0100
[NTOS:KE] Add function comments
---
ntoskrnl/ke/i386/ctxswitch.S | 48 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/ntoskrnl/ke/i386/ctxswitch.S b/ntoskrnl/ke/i386/ctxswitch.S
index bbeb462d11..1151a021b1 100644
--- a/ntoskrnl/ke/i386/ctxswitch.S
+++ b/ntoskrnl/ke/i386/ctxswitch.S
@@ -23,6 +23,27 @@ EXTERN _KeI386FxsrPresent:DWORD
/* FUNCTIONS ****************************************************************/
.code
+/*++
+ * KiSwapContextInternal
+ *
+ * \brief
+ * The KiSwapContextInternal routine switches context to another thread.
+ *
+ * BOOLEAN USERCALL KiSwapContextInternal();
+ *
+ * Params:
+ * ESI - Pointer to the KTHREAD to which the caller wishes to
+ * switch to.
+ * EDI - Pointer to the KTHREAD to which the caller wishes to
+ * switch from.
+ *
+ * \returns
+ * APC state.
+ *
+ * \remarks
+ * Absolutely all registers except ESP can be trampled here for maximum code flexibility.
+ *
+ *--*/
PUBLIC @KiSwapContextInternal@0
@KiSwapContextInternal@0:
/* Build switch frame */
@@ -31,6 +52,33 @@ PUBLIC @KiSwapContextInternal@0
jmp @KiSwapContextEntry@8
+/**
+ * KiSwapContext
+ *
+ * \brief
+ * The KiSwapContext routine switches context to another thread.
+ *
+ * BOOLEAN FASTCALL
+ * KiSwapContext(PKTHREAD CurrentThread, PKTHREAD TargetThread);
+ *
+ * \param CurrentThread
+ * Pointer to the KTHREAD of the current thread.
+ *
+ * \param TargetThread
+ * Pointer to the KTHREAD to which the caller wishes to switch to.
+ *
+ * \returns
+ * The WaitStatus of the Target Thread.
+ *
+ * \remarks
+ * This is a wrapper around KiSwapContextInternal which will save all the
+ * non-volatile registers so that the Internal function can use all of
+ * them. It will also save the old current thread and set the new one.
+ *
+ * The calling thread does not return after KiSwapContextInternal until
+ * another thread switches to IT.
+ *
+ *--*/
PUBLIC @KiSwapContext@8
@KiSwapContext@8:
/* Save 4 registers */
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7dabd235ec1ac0ae9dfb2…
commit 7dabd235ec1ac0ae9dfb2a1b0e78cef2216bc987
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sun Jan 13 15:29:13 2019 +0100
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Mon Mar 4 21:58:42 2019 +0100
[GDI32] Add casts to silence warnings on x64
The cast is required, because FARPROC is only compatible with function pointer types that return INT_PTR and the ones used return int/BOOL.
---
win32ss/gdi/gdi32/misc/wingl.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/win32ss/gdi/gdi32/misc/wingl.c b/win32ss/gdi/gdi32/misc/wingl.c
index 13fee27278..3e993443f9 100644
--- a/win32ss/gdi/gdi32/misc/wingl.c
+++ b/win32ss/gdi/gdi32/misc/wingl.c
@@ -84,20 +84,20 @@ static BOOL OpenGLEnable(void)
thread-safe */
}
-
- if (!OpenGLInitFunction("wglChoosePixelFormat", &glChoosePixelFormat))
+ /* The cast is required on x64, because FARPROC has INT_PTR sized return */
+ if (!OpenGLInitFunction("wglChoosePixelFormat", (FARPROC*)&glChoosePixelFormat))
Ret = FALSE;
- if (!OpenGLInitFunction("wglSetPixelFormat", &glSetPixelFormat))
+ if (!OpenGLInitFunction("wglSetPixelFormat", (FARPROC*)&glSetPixelFormat))
Ret = FALSE;
- if (!OpenGLInitFunction("wglSwapBuffers", &glSwapBuffers))
+ if (!OpenGLInitFunction("wglSwapBuffers", (FARPROC*)&glSwapBuffers))
Ret = FALSE;
- if (!OpenGLInitFunction("wglDescribePixelFormat", &glDescribePixelFormat))
+ if (!OpenGLInitFunction("wglDescribePixelFormat", (FARPROC*)&glDescribePixelFormat))
Ret = FALSE;
- if (!OpenGLInitFunction("wglGetPixelFormat", &glGetPixelFormat))
+ if (!OpenGLInitFunction("wglGetPixelFormat", (FARPROC*)&glGetPixelFormat))
Ret = FALSE;
return Ret;