Skip to content

Commit 91b613f

Browse files
committed
[NDK][RTL] Fix signature of RtlInitializeContext
1 parent 3a03117 commit 91b613f

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

‎sdk/include/ndk/rtlfuncs.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2801,7 +2801,7 @@ RtlInitializeContext(
28012801
_Out_ PCONTEXT ThreadContext,
28022802
_In_opt_ PVOID ThreadStartParam,
28032803
_In_ PTHREAD_START_ROUTINE ThreadStartAddress,
2804-
_In_ PINITIAL_TEB InitialTeb
2804+
_In_ PVOID StackBase
28052805
);
28062806

28072807
#ifdef _M_AMD64

‎sdk/lib/rtl/amd64/stubs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RtlInitializeContext(
2525
_Out_ PCONTEXT ThreadContext,
2626
_In_opt_ PVOID ThreadStartParam,
2727
_In_ PTHREAD_START_ROUTINE ThreadStartAddress,
28-
_In_ PINITIAL_TEB StackBase)
28+
_In_ PVOID StackBase)
2929
{
3030
/* Initialize everything to 0 */
3131
RtlZeroMemory(ThreadContext, sizeof(*ThreadContext));

‎sdk/lib/rtl/i386/thread.c‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
*/
2525
VOID
2626
NTAPI
27-
RtlInitializeContext(IN HANDLE ProcessHandle,
28-
OUT PCONTEXT ThreadContext,
29-
IN PVOID ThreadStartParam OPTIONAL,
30-
IN PTHREAD_START_ROUTINE ThreadStartAddress,
31-
IN PINITIAL_TEB InitialTeb)
27+
RtlInitializeContext(
28+
_In_ HANDLE ProcessHandle,
29+
_Out_ PCONTEXT ThreadContext,
30+
_In_opt_ PVOID ThreadStartParam,
31+
_In_ PTHREAD_START_ROUTINE ThreadStartAddress,
32+
_In_ PVOID StackBase)
3233
{
33-
DPRINT("RtlInitializeContext: (hProcess: %p, ThreadContext: %p, Teb: %p\n",
34-
ProcessHandle, ThreadContext, InitialTeb);
34+
DPRINT("RtlInitializeContext: (hProcess: %p, ThreadContext: %p, StackBase: %p\n",
35+
ProcessHandle, ThreadContext, StackBase);
3536

3637
/*
3738
* Set the Initial Registers
@@ -58,7 +59,7 @@ RtlInitializeContext(IN HANDLE ProcessHandle,
5859

5960
/* Settings passed */
6061
ThreadContext->Eip = (ULONG)ThreadStartAddress;
61-
ThreadContext->Esp = (ULONG)InitialTeb;
62+
ThreadContext->Esp = (ULONG)StackBase;
6263

6364
/* Only the basic Context is initialized */
6465
ThreadContext->ContextFlags = CONTEXT_CONTROL |

0 commit comments

Comments
 (0)