ReactOS  0.4.15-dev-1171-gab82533
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 (IN HANDLE ProcessHandle, OUT PCONTEXT ThreadContext, IN PVOID ThreadStartParam OPTIONAL, IN PTHREAD_START_ROUTINE ThreadStartAddress, IN PINITIAL_TEB StackBase)
 
PVOID NTAPI RtlpGetExceptionAddress (VOID)
 
BOOLEAN NTAPI RtlDispatchException (IN PEXCEPTION_RECORD ExceptionRecord, IN PCONTEXT Context)
 
NTSYSAPI VOID RtlRestoreContext (PCONTEXT ContextRecord, PEXCEPTION_RECORD ExceptionRecord)
 
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

◆ RtlDispatchException()

BOOLEAN NTAPI RtlDispatchException ( IN PEXCEPTION_RECORD  ExceptionRecord,
IN PCONTEXT  Context 
)

Definition at line 100 of file stubs.c.

102 {
104  return FALSE;
105 }
#define UNIMPLEMENTED
Definition: stubs.c:20
#define FALSE
Definition: types.h:117

◆ RtlInitializeContext()

VOID NTAPI RtlInitializeContext ( IN HANDLE  ProcessHandle,
OUT PCONTEXT  ThreadContext,
IN PVOID ThreadStartParam  OPTIONAL,
IN PTHREAD_START_ROUTINE  ThreadStartAddress,
IN PINITIAL_TEB  StackBase 
)

Definition at line 23 of file stubs.c.

28 {
29 
30  ThreadContext->Rax = 0;
31  ThreadContext->Rbx = 0;
32  ThreadContext->Rcx = (ULONG64)ThreadStartParam;
33  ThreadContext->Rdx = 0;
34  ThreadContext->Rsi = 0;
35  ThreadContext->Rdi = 0;
36  ThreadContext->Rbp = 0;
37  ThreadContext->R8 = 0;
38  ThreadContext->R9 = 0;
39  ThreadContext->R10 = 0;
40  ThreadContext->R11 = 0;
41  ThreadContext->R12 = 0;
42 
43  /* Set the Selectors */
44  if ((LONG64)ThreadStartAddress < 0)
45  {
46  /* Initialize kernel mode segments */
47  ThreadContext->SegCs = KGDT64_R0_CODE;
48  ThreadContext->SegDs = KGDT64_R3_DATA;
49  ThreadContext->SegEs = KGDT64_R3_DATA;
50  ThreadContext->SegFs = KGDT64_R3_CMTEB;
51  ThreadContext->SegGs = KGDT64_R3_DATA;
52  ThreadContext->SegSs = KGDT64_R0_DATA;
53  }
54  else
55  {
56  /* Initialize user mode segments */
57  ThreadContext->SegCs = KGDT64_R3_CODE | RPL_MASK;
58  ThreadContext->SegDs = KGDT64_R3_DATA | RPL_MASK;
59  ThreadContext->SegEs = KGDT64_R3_DATA | RPL_MASK;
60  ThreadContext->SegFs = KGDT64_R3_CMTEB | RPL_MASK;
61  ThreadContext->SegGs = KGDT64_R3_DATA | RPL_MASK;
62  ThreadContext->SegSs = KGDT64_R3_DATA | RPL_MASK;
63  }
64 
65  /* Enable Interrupts */
66  ThreadContext->EFlags = EFLAGS_INTERRUPT_MASK;
67 
68  /* Settings passed */
69  ThreadContext->Rip = (ULONG64)ThreadStartAddress;
70  ThreadContext->Rsp = (ULONG64)StackBase - 6 * sizeof(PVOID);
71 
72  /* Align stack by 16 and substract 8 (unaligned on function entry) */
73  ThreadContext->Rsp &= ~15;
74  ThreadContext->Rsp -= 8;
75 
76  /* Only the basic Context is initialized */
77  ThreadContext->ContextFlags = CONTEXT_CONTROL |
80 
81  return;
82 }
#define KGDT64_R3_CODE
Definition: ketypes.h:76
#define CONTEXT_CONTROL
Definition: nt_native.h:1369
#define KGDT64_R3_CMTEB
Definition: ketypes.h:78
#define CONTEXT_SEGMENTS
Definition: nt_native.h:1371
#define KGDT64_R3_DATA
Definition: ketypes.h:75
#define RPL_MASK
Definition: ketypes.h:69
int64_t LONG64
Definition: typedefs.h:68
#define KGDT64_R0_CODE
Definition: ketypes.h:72
unsigned __int64 ULONG64
Definition: imports.h:198
#define KGDT64_R0_DATA
Definition: ketypes.h:73
#define CONTEXT_INTEGER
Definition: nt_native.h:1370
#define EFLAGS_INTERRUPT_MASK
Definition: ketypes.h:126

◆ RtlpGetExceptionAddress()

PVOID NTAPI RtlpGetExceptionAddress ( VOID  )

Definition at line 89 of file stubs.c.

90 {
92  return NULL;
93 }
#define UNIMPLEMENTED
Definition: stubs.c:20
smooth NULL
Definition: ftsmooth.c:416

◆ 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 118 of file stubs.c.

124 {
126  return STATUS_NOT_IMPLEMENTED;
127 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
#define UNIMPLEMENTED
Definition: stubs.c:20

◆ RtlRestoreContext()

NTSYSAPI VOID RtlRestoreContext ( PCONTEXT  ContextRecord,
PEXCEPTION_RECORD  ExceptionRecord 
)

Definition at line 109 of file stubs.c.

112 {
114 }
#define UNIMPLEMENTED
Definition: stubs.c:20