Commit 32e929c0 authored by Jukka Heinonen's avatar Jukka Heinonen Committed by Alexandre Julliard

When forcing call to DOS relay from protected mode, make sure that

relay sees original stack and code pointers. Make it possible for DOS relay to modify code and stack pointers.
parent e3869d56
......@@ -103,12 +103,37 @@ static void RELAY_MakeShortContext( CONTEXT86 *context )
* This stub is called by __wine_call_from_16_regs in order to marshall
* relay parameters.
*/
static void __stdcall RELAY_RelayStub( DOSRELAY proc,
static void __stdcall RELAY_RelayStub( DOSRELAY proc,
unsigned char *args,
void *context )
void *ctx86 )
{
if (proc)
proc( (CONTEXT86*)context, *(LPVOID *)args );
{
CONTEXT86 *context = (CONTEXT86*)ctx86;
RELAY_Stack16 *stack = RELAY_GetPointer( context->Esp );
DWORD old_seg_cs = context->SegCs;
DWORD old_eip = context->Eip;
DWORD old_seg_ss = context->SegSs;
DWORD old_esp = context->Esp;
context->SegCs = stack->seg_cs;
context->Eip = stack->eip;
context->SegSs = stack->seg_ss;
context->Esp = stack->esp;
proc( context, *(LPVOID *)args );
stack->seg_cs = context->SegCs;
stack->eip = context->Eip;
stack->seg_ss = context->SegSs;
stack->esp = context->Esp;
context->SegCs = old_seg_cs;
context->Eip = old_eip;
context->SegSs = old_seg_ss;
context->Esp = old_esp;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment