ReactOS 0.4.16-dev-329-g9223134
stubs.c File Reference
#include <rtl.h>
#include <debug.h>
#include "amd64/ketypes.h"
Include dependency graph for stubs.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI RtlInitializeContext (_Reserved_ HANDLE ProcessHandle, _Out_ PCONTEXT ThreadContext, _In_opt_ PVOID ThreadStartParam, _In_ PTHREAD_START_ROUTINE ThreadStartAddress, _In_ PINITIAL_TEB StackBase)
 
NTSTATUS NTAPI RtlQueueApcWow64Thread (_In_ HANDLE ThreadHandle, _In_ PKNORMAL_ROUTINE ApcRoutine, _In_opt_ PVOID NormalContext, _In_opt_ PVOID SystemArgument1, _In_opt_ PVOID SystemArgument2)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file stubs.c.

Function Documentation

◆ RtlInitializeContext()

VOID NTAPI RtlInitializeContext ( _Reserved_ HANDLE  ProcessHandle,
_Out_ PCONTEXT  ThreadContext,
_In_opt_ PVOID  ThreadStartParam,
_In_ PTHREAD_START_ROUTINE  ThreadStartAddress,
_In_ PINITIAL_TEB  StackBase 
)

Definition at line 23 of file stubs.c.

29{
30 /* Initialize everything to 0 */
31 RtlZeroMemory(ThreadContext, sizeof(*ThreadContext));
32
33 /* Initialize StartAddress and Stack */
34 ThreadContext->Rip = (ULONG64)ThreadStartAddress;
35 ThreadContext->Rsp = (ULONG64)StackBase - 6 * sizeof(PVOID);
36
37 /* Align stack by 16 and substract 8 (unaligned on function entry) */
38 ThreadContext->Rsp &= ~15;
39 ThreadContext->Rsp -= 8;
40
41 /* Enable Interrupts */
42 ThreadContext->EFlags = EFLAGS_INTERRUPT_MASK;
43
44 /* Set start parameter */
45 ThreadContext->Rcx = (ULONG64)ThreadStartParam;
46
47 /* Set the Selectors */
48 if ((LONG64)ThreadStartAddress < 0)
49 {
50 /* Initialize kernel mode segments */
51 ThreadContext->SegCs = KGDT64_R0_CODE;
52 ThreadContext->SegDs = KGDT64_R3_DATA;
53 ThreadContext->SegEs = KGDT64_R3_DATA;
54 ThreadContext->SegFs = KGDT64_R3_CMTEB;
55 ThreadContext->SegGs = KGDT64_R3_DATA;
56 ThreadContext->SegSs = KGDT64_R0_DATA;
57 }
58 else
59 {
60 /* Initialize user mode segments */
61 ThreadContext->SegCs = KGDT64_R3_CODE | RPL_MASK;
62 ThreadContext->SegDs = KGDT64_R3_DATA | RPL_MASK;
63 ThreadContext->SegEs = KGDT64_R3_DATA | RPL_MASK;
64 ThreadContext->SegFs = KGDT64_R3_CMTEB | RPL_MASK;
65 ThreadContext->SegGs = KGDT64_R3_DATA | RPL_MASK;
66 ThreadContext->SegSs = KGDT64_R3_DATA | RPL_MASK;
67 }
68
69 ThreadContext->MxCsr = INITIAL_MXCSR;
70
71 /* Only the basic Context is initialized */
72 ThreadContext->ContextFlags = CONTEXT_CONTROL |
76
77 return;
78}
#define EFLAGS_INTERRUPT_MASK
Definition: SystemCall.c:11
unsigned __int64 ULONG64
Definition: imports.h:198
#define KGDT64_R3_CODE
Definition: ketypes.h:126
#define KGDT64_R0_CODE
Definition: ketypes.h:122
#define KGDT64_R3_DATA
Definition: ketypes.h:125
#define KGDT64_R3_CMTEB
Definition: ketypes.h:128
#define KGDT64_R0_DATA
Definition: ketypes.h:123
#define RPL_MASK
Definition: ketypes.h:119
#define CONTEXT_CONTROL
Definition: nt_native.h:1369
#define CONTEXT_INTEGER
Definition: nt_native.h:1370
#define CONTEXT_FLOATING_POINT
Definition: nt_native.h:1372
#define CONTEXT_SEGMENTS
Definition: nt_native.h:1371
#define INITIAL_MXCSR
int64_t LONG64
Definition: typedefs.h:68
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

◆ RtlQueueApcWow64Thread()

NTSTATUS NTAPI RtlQueueApcWow64Thread ( _In_ HANDLE  ThreadHandle,
_In_ PKNORMAL_ROUTINE  ApcRoutine,
_In_opt_ PVOID  NormalContext,
_In_opt_ PVOID  SystemArgument1,
_In_opt_ PVOID  SystemArgument2 
)

Definition at line 82 of file stubs.c.

88{
91}
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42
#define UNIMPLEMENTED
Definition: stubs.c:6