Module: wine Branch: master Commit: 075e561f5cff26a80d2c21a7bb6d74d4a4585cf8 URL: https://source.winehq.org/git/wine.git/?a=commit;h=075e561f5cff26a80d2c21a7b... Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri May 17 16:43:06 2019 +0200 winebuild: Don't change %fs and %gs when calling 16-bit register functions. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/commdlg.dll16/filedlg.c | 2 -- dlls/krnl386.exe16/ne_module.c | 2 -- dlls/krnl386.exe16/ne_segment.c | 4 ---- dlls/krnl386.exe16/thunk.c | 8 -------- dlls/system.drv16/system.c | 2 -- tools/winebuild/relay.c | 4 ---- 6 files changed, 22 deletions(-) diff --git a/dlls/commdlg.dll16/filedlg.c b/dlls/commdlg.dll16/filedlg.c index 99da47a..5b72bfa 100644 --- a/dlls/commdlg.dll16/filedlg.c +++ b/dlls/commdlg.dll16/filedlg.c @@ -222,8 +222,6 @@ static LRESULT call_hook16( WNDPROC16 hook, HWND hwnd, UINT msg, WPARAM wp, LPAR memset( &context, 0, sizeof(context) ); context.SegDs = context.SegEs = SELECTOROF( NtCurrentTeb()->WOW32Reserved ); - context.SegFs = wine_get_fs(); - context.SegGs = wine_get_gs(); context.SegCs = SELECTOROF( hook ); context.Eip = OFFSETOF( hook ); context.Ebp = OFFSETOF( NtCurrentTeb()->WOW32Reserved ) + FIELD_OFFSET( STACK16FRAME, bp ); diff --git a/dlls/krnl386.exe16/ne_module.c b/dlls/krnl386.exe16/ne_module.c index 1979358..76ef355 100644 --- a/dlls/krnl386.exe16/ne_module.c +++ b/dlls/krnl386.exe16/ne_module.c @@ -1234,8 +1234,6 @@ DWORD NE_StartTask(void) context.SegCs = GlobalHandleToSel16(pSegTable[SELECTOROF(pModule->ne_csip) - 1].hSeg); context.SegDs = GlobalHandleToSel16(pTask->hInstance); context.SegEs = pTask->hPDB; - context.SegFs = wine_get_fs(); - context.SegGs = wine_get_gs(); context.Eip = OFFSETOF(pModule->ne_csip); context.Ebx = pModule->ne_stack; context.Ecx = pModule->ne_heap; diff --git a/dlls/krnl386.exe16/ne_segment.c b/dlls/krnl386.exe16/ne_segment.c index 1ceb714..000c576 100644 --- a/dlls/krnl386.exe16/ne_segment.c +++ b/dlls/krnl386.exe16/ne_segment.c @@ -689,8 +689,6 @@ static BOOL NE_InitDLL( NE_MODULE *pModule ) context.Edi = hInst; context.SegDs = ds; context.SegEs = ds; /* who knows ... */ - context.SegFs = wine_get_fs(); - context.SegGs = wine_get_gs(); context.SegCs = SEL(pSegTable[SELECTOROF(pModule->ne_csip)-1].hSeg); context.Eip = OFFSETOF(pModule->ne_csip); context.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + FIELD_OFFSET(STACK16FRAME,bp); @@ -794,8 +792,6 @@ static void NE_CallDllEntryPoint( NE_MODULE *pModule, DWORD dwReason ) memset( &context, 0, sizeof(context) ); context.SegDs = ds; context.SegEs = ds; /* who knows ... */ - context.SegFs = wine_get_fs(); - context.SegGs = wine_get_gs(); context.SegCs = HIWORD(entryPoint); context.Eip = LOWORD(entryPoint); context.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + FIELD_OFFSET(STACK16FRAME,bp); diff --git a/dlls/krnl386.exe16/thunk.c b/dlls/krnl386.exe16/thunk.c index b4ba7d2..c8ad382 100644 --- a/dlls/krnl386.exe16/thunk.c +++ b/dlls/krnl386.exe16/thunk.c @@ -431,8 +431,6 @@ void WINAPI __regs_QT_Thunk( CONTEXT *context ) context16 = *context; - context16.SegFs = wine_get_fs(); - context16.SegGs = wine_get_gs(); context16.SegCs = HIWORD(context->Edx); context16.Eip = LOWORD(context->Edx); /* point EBP to the STACK16FRAME on the stack @@ -561,8 +559,6 @@ void WINAPI __regs_FT_Thunk( CONTEXT *context ) context16 = *context; - context16.SegFs = wine_get_fs(); - context16.SegGs = wine_get_gs(); context16.SegCs = HIWORD(callTarget); context16.Eip = LOWORD(callTarget); context16.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + FIELD_OFFSET(STACK16FRAME,bp); @@ -720,8 +716,6 @@ void WINAPI __regs_Common32ThkLS( CONTEXT *context ) context16 = *context; - context16.SegFs = wine_get_fs(); - context16.SegGs = wine_get_gs(); context16.Edi = LOWORD(context->Ecx); context16.SegCs = HIWORD(context->Eax); context16.Eip = LOWORD(context->Eax); @@ -779,8 +773,6 @@ void WINAPI __regs_OT_32ThkLSF( CONTEXT *context ) context16 = *context; - context16.SegFs = wine_get_fs(); - context16.SegGs = wine_get_gs(); context16.SegCs = HIWORD(context->Edx); context16.Eip = LOWORD(context->Edx); context16.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + FIELD_OFFSET(STACK16FRAME,bp); diff --git a/dlls/system.drv16/system.c b/dlls/system.drv16/system.c index 8bb5cf9..b6fd51c 100644 --- a/dlls/system.drv16/system.c +++ b/dlls/system.drv16/system.c @@ -68,8 +68,6 @@ static void CALLBACK SYSTEM_TimerTick( LPVOID arg, DWORD low, DWORD high ) SYS_Timers[i].ticks += SYS_Timers[i].rate; memset( &context, 0, sizeof(context) ); - context.SegFs = wine_get_fs(); - context.SegGs = wine_get_gs(); context.SegCs = SELECTOROF( proc ); context.Eip = OFFSETOF( proc ); context.Ebp = OFFSETOF(NtCurrentTeb()->WOW32Reserved) + FIELD_OFFSET(STACK16FRAME, bp); diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c index 1adbda0..8718346 100644 --- a/tools/winebuild/relay.c +++ b/tools/winebuild/relay.c @@ -492,10 +492,6 @@ static void BuildCallTo16Core( int reg_func ) output( "\tpushw 0x98(%%edx)\n"); /* SegDs */ output( "\tpushl 0x94(%%edx)\n"); /* SegEs */ output( "\tpopl %%es\n" ); - output( "\tpushl 0x90(%%edx)\n"); /* SegFs */ - output( "\tpopl %%fs\n" ); - output( "\tpushl 0x8c(%%edx)\n"); /* SegGs */ - output( "\tpopl %%gs\n" ); output( "\tmovl 0xb4(%%edx),%%ebp\n"); /* Ebp */ output( "\tmovl 0xa0(%%edx),%%esi\n"); /* Esi */ output( "\tmovl 0x9c(%%edx),%%edi\n"); /* Edi */