Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sam Joan Roque-Worcel
wine
Commits
53dbe16c
Commit
53dbe16c
authored
24 years ago
by
Ulrich Weigand
Committed by
Alexandre Julliard
24 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update ESP correctly on return from flat thunk routines.
parent
a761e3da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/kernel/thunk.c
+26
-16
26 additions, 16 deletions
dlls/kernel/thunk.c
with
26 additions
and
16 deletions
dlls/kernel/thunk.c
+
26
−
16
View file @
53dbe16c
...
...
@@ -304,9 +304,13 @@ void WINAPI QT_Thunk( CONTEXT86 *context )
memcpy
(
(
LPBYTE
)
CURRENT_STACK16
-
argsize
,
(
LPBYTE
)
ESP_reg
(
context
),
argsize
);
EAX_reg
(
context
)
=
CallTo16RegisterShort
(
&
context16
,
argsize
);
EDX_reg
(
context
)
=
HIWORD
(
EAX_reg
(
context
));
EAX_reg
(
context
)
=
LOWORD
(
EAX_reg
(
context
));
CallTo16RegisterShort
(
&
context16
,
argsize
);
EAX_reg
(
context
)
=
EAX_reg
(
&
context16
);
EDX_reg
(
context
)
=
EDX_reg
(
&
context16
);
ECX_reg
(
context
)
=
ECX_reg
(
&
context16
);
ESP_reg
(
context
)
+=
LOWORD
(
ESP_reg
(
&
context16
))
-
(
OFFSETOF
(
NtCurrentTeb
()
->
cur_stack
)
-
argsize
);
}
...
...
@@ -427,9 +431,13 @@ void WINAPI FT_Thunk( CONTEXT86 *context )
+
(
*
(
LPBYTE
*
)
arg
-
oldstack
));
}
EAX_reg
(
context
)
=
CallTo16RegisterShort
(
&
context16
,
argsize
);
EDX_reg
(
context
)
=
HIWORD
(
EAX_reg
(
context
));
EAX_reg
(
context
)
=
LOWORD
(
EAX_reg
(
context
));
CallTo16RegisterShort
(
&
context16
,
argsize
);
EAX_reg
(
context
)
=
EAX_reg
(
&
context16
);
EDX_reg
(
context
)
=
EDX_reg
(
&
context16
);
ECX_reg
(
context
)
=
ECX_reg
(
&
context16
);
ESP_reg
(
context
)
+=
LOWORD
(
ESP_reg
(
&
context16
))
-
(
OFFSETOF
(
NtCurrentTeb
()
->
cur_stack
)
-
argsize
);
/* Copy modified buffers back to 32-bit stack */
memcpy
(
oldstack
,
newstack
,
argsize
);
...
...
@@ -604,14 +612,9 @@ DWORD WINAPI ThunkInitLS(
* (CallRegisterLongProc instead of CallRegisterShortProc).
*
* Finally, we return to the caller, popping the arguments off
* the stack.
* the stack. The number of arguments to be popped is returned
* in the BL register by the called 16-bit routine.
*
* FIXME: The called function uses EBX to return the number of
* arguments that are to be popped off the caller's stack.
* This is clobbered by the assembly glue, so we simply use
* the original EDX.HI to get the number of arguments.
* (Those two values should be equal anyway ...?)
*
*/
void
WINAPI
Common32ThkLS
(
CONTEXT86
*
context
)
{
...
...
@@ -635,10 +638,11 @@ void WINAPI Common32ThkLS( CONTEXT86 *context )
memcpy
(
(
LPBYTE
)
CURRENT_STACK16
-
argsize
,
(
LPBYTE
)
ESP_reg
(
context
),
argsize
);
EAX_reg
(
context
)
=
CallTo16RegisterLong
(
&
context16
,
argsize
+
32
);
CallTo16RegisterLong
(
&
context16
,
argsize
+
32
);
EAX_reg
(
context
)
=
EAX_reg
(
&
context16
);
/* Clean up caller's stack frame */
ESP_reg
(
context
)
+=
argsize
;
ESP_reg
(
context
)
+=
BL_reg
(
&
context16
)
;
}
/***********************************************************************
...
...
@@ -685,10 +689,16 @@ void WINAPI OT_32ThkLSF( CONTEXT86 *context )
memcpy
(
(
LPBYTE
)
CURRENT_STACK16
-
argsize
,
(
LPBYTE
)
ESP_reg
(
context
),
argsize
);
EAX_reg
(
context
)
=
CallTo16RegisterShort
(
&
context16
,
argsize
);
CallTo16RegisterShort
(
&
context16
,
argsize
);
EAX_reg
(
context
)
=
EAX_reg
(
&
context16
);
EDX_reg
(
context
)
=
EDX_reg
(
&
context16
);
/* Copy modified buffers back to 32-bit stack */
memcpy
(
(
LPBYTE
)
ESP_reg
(
context
),
(
LPBYTE
)
CURRENT_STACK16
-
argsize
,
argsize
);
ESP_reg
(
context
)
+=
LOWORD
(
ESP_reg
(
&
context16
))
-
(
OFFSETOF
(
NtCurrentTeb
()
->
cur_stack
)
-
argsize
);
}
/***********************************************************************
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment