Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
a761e3da
Commit
a761e3da
authored
Sep 13, 2000
by
Ulrich Weigand
Committed by
Alexandre Julliard
Sep 13, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified CallTo16Register routines to update register context after
call returns. Callers adapted.
parent
52b2d2cf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
72 additions
and
24 deletions
+72
-24
relay.c
if1632/relay.c
+21
-6
builtin16.h
include/builtin16.h
+2
-2
module.c
loader/ne/module.c
+2
-1
relay.c
tools/winebuild/relay.c
+45
-14
winproc.c
windows/winproc.c
+2
-1
No files found.
if1632/relay.c
View file @
a761e3da
...
@@ -67,10 +67,10 @@ WORD CALLBACK CallTo16Word( FARPROC16 target, INT nArgs )
...
@@ -67,10 +67,10 @@ WORD CALLBACK CallTo16Word( FARPROC16 target, INT nArgs )
LONG
CALLBACK
CallTo16Long
(
FARPROC16
target
,
INT
nArgs
)
LONG
CALLBACK
CallTo16Long
(
FARPROC16
target
,
INT
nArgs
)
{
assert
(
FALSE
);
}
{
assert
(
FALSE
);
}
LONG
CALLBACK
CallTo16RegisterShort
(
const
CONTEXT86
*
context
,
INT
nArgs
)
void
CALLBACK
CallTo16RegisterShort
(
CONTEXT86
*
context
,
INT
nArgs
)
{
assert
(
FALSE
);
}
{
assert
(
FALSE
);
}
LONG
CALLBACK
CallTo16RegisterLong
(
const
CONTEXT86
*
context
,
INT
nArgs
)
void
CALLBACK
CallTo16RegisterLong
(
CONTEXT86
*
context
,
INT
nArgs
)
{
assert
(
FALSE
);
}
{
assert
(
FALSE
);
}
WORD
CallFrom16Word
(
void
)
WORD
CallFrom16Word
(
void
)
...
@@ -327,12 +327,27 @@ void RELAY_DebugCallTo16( LPVOID target, int nb_args, BOOL reg_func )
...
@@ -327,12 +327,27 @@ void RELAY_DebugCallTo16( LPVOID target, int nb_args, BOOL reg_func )
/***********************************************************************
/***********************************************************************
* RELAY_DebugCallTo16Ret
* RELAY_DebugCallTo16Ret
*/
*/
void
RELAY_DebugCallTo16Ret
(
int
ret_val
)
void
RELAY_DebugCallTo16Ret
(
BOOL
reg_func
,
int
ret_val
)
{
{
if
(
!
TRACE_ON
(
relay
))
return
;
if
(
!
TRACE_ON
(
relay
))
return
;
DPRINTF
(
"CallTo16() ss:sp=%04x:%04x retval=0x%08x
\n
"
,
if
(
!
reg_func
)
SELECTOROF
(
NtCurrentTeb
()
->
cur_stack
),
{
OFFSETOF
(
NtCurrentTeb
()
->
cur_stack
),
ret_val
);
DPRINTF
(
"CallTo16() ss:sp=%04x:%04x retval=0x%08x
\n
"
,
SELECTOROF
(
NtCurrentTeb
()
->
cur_stack
),
OFFSETOF
(
NtCurrentTeb
()
->
cur_stack
),
ret_val
);
}
else
{
CONTEXT86
*
context
=
(
CONTEXT86
*
)
ret_val
;
DPRINTF
(
"CallTo16() ss:sp=%04x:%04x
\n
"
,
SELECTOROF
(
NtCurrentTeb
()
->
cur_stack
),
OFFSETOF
(
NtCurrentTeb
()
->
cur_stack
));
DPRINTF
(
" AX=%04x BX=%04x CX=%04x DX=%04x BP=%04x SP=%04x
\n
"
,
AX_reg
(
context
),
BX_reg
(
context
),
CX_reg
(
context
),
DX_reg
(
context
),
BP_reg
(
context
),
LOWORD
(
ESP_reg
(
context
)));
}
SYSLEVEL_CheckNotLevel
(
2
);
SYSLEVEL_CheckNotLevel
(
2
);
}
}
include/builtin16.h
View file @
a761e3da
...
@@ -20,8 +20,8 @@ extern void CallFrom16Thunk();
...
@@ -20,8 +20,8 @@ extern void CallFrom16Thunk();
extern
WORD
CALLBACK
CallTo16Word
(
FARPROC16
target
,
INT
nArgs
);
extern
WORD
CALLBACK
CallTo16Word
(
FARPROC16
target
,
INT
nArgs
);
extern
LONG
CALLBACK
CallTo16Long
(
FARPROC16
target
,
INT
nArgs
);
extern
LONG
CALLBACK
CallTo16Long
(
FARPROC16
target
,
INT
nArgs
);
extern
LONG
CALLBACK
CallTo16RegisterShort
(
const
struct
_CONTEXT86
*
context
,
INT
nArgs
);
extern
void
CALLBACK
CallTo16RegisterShort
(
struct
_CONTEXT86
*
context
,
INT
nArgs
);
extern
LONG
CALLBACK
CallTo16RegisterLong
(
const
struct
_CONTEXT86
*
context
,
INT
nArgs
);
extern
void
CALLBACK
CallTo16RegisterLong
(
struct
_CONTEXT86
*
context
,
INT
nArgs
);
#include "pshpack1.h"
#include "pshpack1.h"
...
...
loader/ne/module.c
View file @
a761e3da
...
@@ -1193,7 +1193,8 @@ static void NE_InitProcess(void)
...
@@ -1193,7 +1193,8 @@ static void NE_InitProcess(void)
SELECTOROF
(
pTask
->
teb
->
cur_stack
),
SELECTOROF
(
pTask
->
teb
->
cur_stack
),
OFFSETOF
(
pTask
->
teb
->
cur_stack
)
);
OFFSETOF
(
pTask
->
teb
->
cur_stack
)
);
ExitThread
(
CallTo16RegisterShort
(
&
context
,
0
)
);
CallTo16RegisterShort
(
&
context
,
0
);
ExitThread
(
AX_reg
(
&
context
)
);
}
}
SYSLEVEL_LeaveWin16Lock
();
SYSLEVEL_LeaveWin16Lock
();
...
...
tools/winebuild/relay.c
View file @
a761e3da
...
@@ -504,20 +504,44 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
...
@@ -504,20 +504,44 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
fprintf
(
outfile
,
"
\t
pushl %%cs
\n
"
);
fprintf
(
outfile
,
"
\t
pushl %%cs
\n
"
);
fprintf
(
outfile
,
"
\t
call .LCallTo16%s
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
call .LCallTo16%s
\n
"
,
name
);
/* Convert and push return value */
if
(
!
reg_func
)
if
(
short_ret
)
{
{
fprintf
(
outfile
,
"
\t
movzwl %%ax, %%eax
\n
"
);
/* Convert and push return value */
fprintf
(
outfile
,
"
\t
pushl %%eax
\n
"
);
if
(
short_ret
)
{
fprintf
(
outfile
,
"
\t
movzwl %%ax, %%eax
\n
"
);
fprintf
(
outfile
,
"
\t
pushl %%eax
\n
"
);
}
else
{
fprintf
(
outfile
,
"
\t
shll $16,%%edx
\n
"
);
fprintf
(
outfile
,
"
\t
movw %%ax,%%dx
\n
"
);
fprintf
(
outfile
,
"
\t
pushl %%edx
\n
"
);
}
}
}
else
if
(
reg_func
!=
2
)
else
{
{
fprintf
(
outfile
,
"
\t
shll $16,%%edx
\n
"
);
/*
fprintf
(
outfile
,
"
\t
movw %%ax,%%dx
\n
"
);
* Modify CONTEXT86 structure to contain new values
fprintf
(
outfile
,
"
\t
pushl %%edx
\n
"
);
*
* NOTE: We restore only EAX, EBX, EDX, EDX, EBP, and ESP.
* The segment registers as well as ESI and EDI should
* not be modified by a well-behaved 16-bit routine in
* any case. [If necessary, we could restore them as well,
* at the cost of a somewhat less efficient return path.]
*/
fprintf
(
outfile
,
"
\t
movl %d(%%esp), %%edi
\n
"
,
STACK32OFFSET
(
target
)
-
12
);
fprintf
(
outfile
,
"
\t
movl %%eax, %d(%%edi)
\n
"
,
CONTEXTOFFSET
(
Eax
)
);
fprintf
(
outfile
,
"
\t
movl %%ebx, %d(%%edi)
\n
"
,
CONTEXTOFFSET
(
Ebx
)
);
fprintf
(
outfile
,
"
\t
movl %%ecx, %d(%%edi)
\n
"
,
CONTEXTOFFSET
(
Ecx
)
);
fprintf
(
outfile
,
"
\t
movl %%edx, %d(%%edi)
\n
"
,
CONTEXTOFFSET
(
Edx
)
);
fprintf
(
outfile
,
"
\t
movl %%ebp, %d(%%edi)
\n
"
,
CONTEXTOFFSET
(
Ebp
)
);
fprintf
(
outfile
,
"
\t
movl %%esi, %d(%%edi)
\n
"
,
CONTEXTOFFSET
(
Esp
)
);
/* The return glue code saved %esp into %esi */
fprintf
(
outfile
,
"
\t
pushl %%edi
\n
"
);
}
}
else
fprintf
(
outfile
,
"
\t
pushl %%eax
\n
"
);
if
(
UsePIC
)
if
(
UsePIC
)
{
{
...
@@ -531,10 +555,14 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
...
@@ -531,10 +555,14 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
/* Print debugging info */
/* Print debugging info */
if
(
debugging
)
if
(
debugging
)
{
{
fprintf
(
outfile
,
"
\t
pushl $%d
\n
"
,
reg_func
);
if
(
UsePIC
)
if
(
UsePIC
)
fprintf
(
outfile
,
"
\t
call "
PREFIX
"RELAY_DebugCallTo16Ret@PLT
\n
"
);
fprintf
(
outfile
,
"
\t
call "
PREFIX
"RELAY_DebugCallTo16Ret@PLT
\n
"
);
else
else
fprintf
(
outfile
,
"
\t
call "
PREFIX
"RELAY_DebugCallTo16Ret
\n
"
);
fprintf
(
outfile
,
"
\t
call "
PREFIX
"RELAY_DebugCallTo16Ret
\n
"
);
fprintf
(
outfile
,
"
\t
addl $4, %%esp
\n
"
);
}
}
/* Leave Win16 Mutex */
/* Leave Win16 Mutex */
...
@@ -657,17 +685,20 @@ static void BuildRet16Func( FILE *outfile )
...
@@ -657,17 +685,20 @@ static void BuildRet16Func( FILE *outfile )
fprintf
(
outfile
,
"
\t
.globl "
PREFIX
"CallTo16_Ret
\n
"
);
fprintf
(
outfile
,
"
\t
.globl "
PREFIX
"CallTo16_Ret
\n
"
);
fprintf
(
outfile
,
PREFIX
"CallTo16_Ret:
\n
"
);
fprintf
(
outfile
,
PREFIX
"CallTo16_Ret:
\n
"
);
/* Save %esp into %esi */
fprintf
(
outfile
,
"
\t
movl %%esp,%%esi
\n
"
);
/* Restore 32-bit segment registers */
/* Restore 32-bit segment registers */
fprintf
(
outfile
,
"
\t
movw $0x%04x,%%
bx
\n
"
,
data_selector
);
fprintf
(
outfile
,
"
\t
movw $0x%04x,%%
di
\n
"
,
data_selector
);
#ifdef __svr4__
#ifdef __svr4__
fprintf
(
outfile
,
"
\t
data16
\n
"
);
fprintf
(
outfile
,
"
\t
data16
\n
"
);
#endif
#endif
fprintf
(
outfile
,
"
\t
movw %%
bx
,%%ds
\n
"
);
fprintf
(
outfile
,
"
\t
movw %%
di
,%%ds
\n
"
);
#ifdef __svr4__
#ifdef __svr4__
fprintf
(
outfile
,
"
\t
data16
\n
"
);
fprintf
(
outfile
,
"
\t
data16
\n
"
);
#endif
#endif
fprintf
(
outfile
,
"
\t
movw %%
bx
,%%es
\n
"
);
fprintf
(
outfile
,
"
\t
movw %%
di
,%%es
\n
"
);
fprintf
(
outfile
,
"
\t
movw "
PREFIX
"SYSLEVEL_Win16CurrentTeb,%%fs
\n
"
);
fprintf
(
outfile
,
"
\t
movw "
PREFIX
"SYSLEVEL_Win16CurrentTeb,%%fs
\n
"
);
...
@@ -676,7 +707,7 @@ static void BuildRet16Func( FILE *outfile )
...
@@ -676,7 +707,7 @@ static void BuildRet16Func( FILE *outfile )
#ifdef __svr4__
#ifdef __svr4__
fprintf
(
outfile
,
"
\t
data16
\n
"
);
fprintf
(
outfile
,
"
\t
data16
\n
"
);
#endif
#endif
fprintf
(
outfile
,
"
\t
movw %%
bx
,%%ss
\n
"
);
fprintf
(
outfile
,
"
\t
movw %%
di
,%%ss
\n
"
);
fprintf
(
outfile
,
"
\t
.byte 0x64
\n\t
movl (%d),%%esp
\n
"
,
STACKOFFSET
);
fprintf
(
outfile
,
"
\t
.byte 0x64
\n\t
movl (%d),%%esp
\n
"
,
STACKOFFSET
);
fprintf
(
outfile
,
"
\t
.byte 0x64
\n\t
popl (%d)
\n
"
,
STACKOFFSET
);
fprintf
(
outfile
,
"
\t
.byte 0x64
\n\t
popl (%d)
\n
"
,
STACKOFFSET
);
...
...
windows/winproc.c
View file @
a761e3da
...
@@ -238,7 +238,8 @@ static LRESULT WINAPI WINPROC_CallWndProc16( WNDPROC16 proc, HWND16 hwnd,
...
@@ -238,7 +238,8 @@ static LRESULT WINAPI WINPROC_CallWndProc16( WNDPROC16 proc, HWND16 hwnd,
args
[
3
]
=
msg
;
args
[
3
]
=
msg
;
args
[
4
]
=
hwnd
;
args
[
4
]
=
hwnd
;
ret
=
CallTo16RegisterShort
(
&
context
,
5
*
sizeof
(
WORD
)
);
CallTo16RegisterShort
(
&
context
,
5
*
sizeof
(
WORD
)
);
ret
=
MAKELONG
(
AX_reg
(
&
context
),
DX_reg
(
&
context
)
);
if
(
offset
)
stack16_pop
(
offset
);
if
(
offset
)
stack16_pop
(
offset
);
WIN_RestoreWndsLock
(
iWndsLocks
);
WIN_RestoreWndsLock
(
iWndsLocks
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment