ntdll: Set the initial process context on x86_64.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-09-19 12:14:58 +02:00
parent 8b929bd759
commit e6f68708c5
1 changed files with 19 additions and 1 deletions

View File

@ -3057,6 +3057,16 @@ static void *mac_thread_gsbase(void)
}
#endif
/***********************************************************************
* start_process
*/
static void CDECL start_process( LPTHREAD_START_ROUTINE entry, PEB *peb )
{
call_thread_entry_point( kernel32_start_process, entry );
}
/**********************************************************************
* signal_init_thread
*/
@ -3132,7 +3142,15 @@ void signal_init_process( CONTEXT *context, LPTHREAD_START_ROUTINE entry )
if (sigaction( SIGTRAP, &sig_act, NULL ) == -1) goto error;
#endif
/* FIXME: set the initial context */
/* build the initial context */
context->ContextFlags = CONTEXT_FULL;
__asm__( "movw %%cs,%0" : "=m" (context->SegCs) );
__asm__( "movw %%ss,%0" : "=m" (context->SegSs) );
__asm__( "fxsave %0" : "=m" (context->u.FltSave) );
context->Rcx = (ULONG_PTR)entry;
context->Rdx = (ULONG_PTR)NtCurrentTeb()->Peb;
context->Rsp = (ULONG_PTR)NtCurrentTeb()->Tib.StackBase - 0x28;
context->Rip = (ULONG_PTR)start_process;
return;
error: