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
ea66623c
Commit
ea66623c
authored
Oct 03, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Oct 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Move the CALL32_CBClient[Ex]_RetAddr implementation to krnl386.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0a01ad0c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
43 deletions
+35
-43
kernel16_private.h
dlls/krnl386.exe16/kernel16_private.h
+3
-2
thunk.c
dlls/krnl386.exe16/thunk.c
+6
-6
wowthunk.c
dlls/krnl386.exe16/wowthunk.c
+26
-7
relay.c
tools/winebuild/relay.c
+0
-28
No files found.
dlls/krnl386.exe16/kernel16_private.h
View file @
ea66623c
...
...
@@ -291,8 +291,9 @@ extern WORD DOSMEM_BiosDataSeg DECLSPEC_HIDDEN;
extern
WORD
DOSMEM_BiosSysSeg
DECLSPEC_HIDDEN
;
extern
DWORD
CallTo16_DataSelector
DECLSPEC_HIDDEN
;
extern
DWORD
CallTo16_TebSelector
DECLSPEC_HIDDEN
;
extern
SEGPTR
CALL32_CBClient_RetAddr
DECLSPEC_HIDDEN
;
extern
SEGPTR
CALL32_CBClientEx_RetAddr
DECLSPEC_HIDDEN
;
extern
WORD
cbclient_selector
DECLSPEC_HIDDEN
;
extern
WORD
cbclientex_selector
DECLSPEC_HIDDEN
;
struct
tagSYSLEVEL
;
...
...
dlls/krnl386.exe16/thunk.c
View file @
ea66623c
...
...
@@ -137,8 +137,8 @@ struct SLApiDB
DWORD
errorReturnValue
;
};
SEGPTR
CALL32_CBClient_RetAdd
r
=
0
;
SEGPTR
CALL32_CBClientEx_RetAdd
r
=
0
;
WORD
cbclient_selecto
r
=
0
;
WORD
cbclientex_selecto
r
=
0
;
extern
int
call_entry_point
(
void
*
func
,
int
nb_args
,
const
DWORD
*
args
);
extern
void
__wine_call_from_16_thunk
(
void
);
...
...
@@ -2094,8 +2094,8 @@ void WINAPI CBClientThunkSL( CONTEXT *context )
stackLin
[
3
]
=
0
;
stackLin
[
4
]
=
OFFSETOF
(
stack
)
+
12
;
stackLin
[
5
]
=
SELECTOROF
(
stack
);
stackLin
[
6
]
=
OFFSETOF
(
CALL32_CBClient_RetAddr
);
/* overwrite return address */
stackLin
[
7
]
=
SELECTOROF
(
CALL32_CBClient_RetAddr
)
;
stackLin
[
6
]
=
0
;
/* overwrite return address */
stackLin
[
7
]
=
cbclient_selector
;
context
->
Eax
=
CALL32_CBClient
(
proc
,
args
,
stackLin
+
4
,
&
context
->
Esi
);
stack16_pop
(
12
);
}
...
...
@@ -2159,8 +2159,8 @@ void WINAPI CBClientThunkSLEx( CONTEXT *context )
/* stackLin[6] and stackLin[7] reserved for the 32-bit stack ptr */
stackLin
[
8
]
=
get_ds
();
stackLin
[
9
]
=
0
;
stackLin
[
10
]
=
OFFSETOF
(
CALL32_CBClientEx_RetAddr
)
;
stackLin
[
11
]
=
SELECTOROF
(
CALL32_CBClientEx_RetAddr
)
;
stackLin
[
10
]
=
0
;
stackLin
[
11
]
=
cbclientex_selector
;
context
->
Eax
=
CALL32_CBClientEx
(
proc
,
args
,
stackLin
,
&
context
->
Esi
,
&
nArgs
);
stack16_pop
(
24
);
...
...
dlls/krnl386.exe16/wowthunk.c
View file @
ea66623c
...
...
@@ -30,6 +30,7 @@
#include "winternl.h"
#include "ntgdi.h"
#include "kernel16_private.h"
#include "wine/asm.h"
#include "wine/exception.h"
#include "wine/debug.h"
...
...
@@ -41,13 +42,29 @@ WINE_DECLARE_DEBUG_CHANNEL(snoop);
extern
DWORD
WINAPI
wine_call_to_16
(
FARPROC16
target
,
DWORD
cbArgs
,
PEXCEPTION_HANDLER
handler
);
extern
void
WINAPI
wine_call_to_16_regs
(
CONTEXT
*
context
,
DWORD
cbArgs
,
PEXCEPTION_HANDLER
handler
);
extern
void
__wine_call_to_16_ret
(
void
);
extern
void
CALL32_CBClient_Ret
(
void
);
extern
void
CALL32_CBClientEx_Ret
(
void
);
extern
BYTE
__wine_call16_start
[];
extern
BYTE
__wine_call16_end
[];
static
SEGPTR
call16_ret_addr
;
/* segptr to __wine_call_to_16_ret routine */
extern
const
BYTE
cbclient_ret
[],
cbclient_ret_end
[];
__ASM_GLOBAL_FUNC
(
cbclient_ret
,
"movzwl %sp,%ebx
\n\t
"
"lssl %ss:-16(%ebx),%esp
\n\t
"
"lretl
\n\t
"
".globl "
__ASM_NAME
(
"cbclient_ret_end"
)
"
\n
"
__ASM_NAME
(
"cbclient_ret_end"
)
":"
)
extern
const
BYTE
cbclientex_ret
[],
cbclientex_ret_end
[];
__ASM_GLOBAL_FUNC
(
cbclientex_ret
,
"movzwl %bp,%ebx
\n\t
"
"subw %bp,%sp
\n\t
"
"movzwl %sp,%ebp
\n\t
"
"lssl %ss:-12(%ebx),%esp
\n\t
"
"lretl
\n\t
"
".globl "
__ASM_NAME
(
"cbclientex_ret_end"
)
"
\n
"
__ASM_NAME
(
"cbclientex_ret_end"
)
":"
)
/***********************************************************************
* WOWTHUNK_Init
*/
...
...
@@ -57,16 +74,18 @@ BOOL WOWTHUNK_Init(void)
WORD
codesel
=
SELECTOR_AllocBlock
(
__wine_call16_start
,
(
BYTE
*
)(
&
CallTo16_TebSelector
+
1
)
-
__wine_call16_start
,
LDT_FLAGS_CODE
|
LDT_FLAGS_32BIT
);
if
(
!
codesel
)
return
FALSE
;
cbclient_selector
=
SELECTOR_AllocBlock
(
cbclient_ret
,
cbclient_ret_end
-
cbclient_ret
,
LDT_FLAGS_CODE
|
LDT_FLAGS_32BIT
);
cbclientex_selector
=
SELECTOR_AllocBlock
(
cbclientex_ret
,
cbclientex_ret_end
-
cbclientex_ret
,
LDT_FLAGS_CODE
|
LDT_FLAGS_32BIT
);
if
(
!
codesel
||
cbclient_selector
||
!
cbclientex_selector
)
return
FALSE
;
/* Patch the return addresses for CallTo16 routines */
CallTo16_DataSelector
=
get_ds
();
call16_ret_addr
=
MAKESEGPTR
(
codesel
,
(
BYTE
*
)
__wine_call_to_16_ret
-
__wine_call16_start
);
CALL32_CBClient_RetAddr
=
MAKESEGPTR
(
codesel
,
(
BYTE
*
)
CALL32_CBClient_Ret
-
__wine_call16_start
);
CALL32_CBClientEx_RetAddr
=
MAKESEGPTR
(
codesel
,
(
BYTE
*
)
CALL32_CBClientEx_Ret
-
__wine_call16_start
);
if
(
TRACE_ON
(
relay
)
||
TRACE_ON
(
snoop
))
RELAY16_InitDebugLists
();
...
...
tools/winebuild/relay.c
View file @
ea66623c
...
...
@@ -564,28 +564,6 @@ static void BuildRet16Func(void)
}
static
void
BuildCallTo32CBClient
(
int
isEx
)
{
/* '16-bit' return stub */
function_header
(
isEx
?
"CALL32_CBClientEx_Ret"
:
"CALL32_CBClient_Ret"
);
if
(
!
isEx
)
{
output
(
"
\t
movzwl %%sp, %%ebx
\n
"
);
output
(
"
\t
lssl %%ss:-16(%%ebx), %%esp
\n
"
);
}
else
{
output
(
"
\t
movzwl %%bp, %%ebx
\n
"
);
output
(
"
\t
subw %%bp, %%sp
\n
"
);
output
(
"
\t
movzwl %%sp, %%ebp
\n
"
);
output
(
"
\t
lssl %%ss:-12(%%ebx), %%esp
\n
"
);
}
output
(
"
\t
lret
\n
"
);
output_function_size
(
isEx
?
"CALL32_CBClientEx_Ret"
:
"CALL32_CBClient_Ret"
);
}
/*******************************************************************
* output_asm_relays16
*
...
...
@@ -618,12 +596,6 @@ void output_asm_relays16(void)
/* Standard CallTo16 return stub */
BuildRet16Func
();
/* CBClientThunkSL routine */
BuildCallTo32CBClient
(
0
);
/* CBClientThunkSLEx routine */
BuildCallTo32CBClient
(
1
);
output
(
"%s
\n
"
,
asm_globl
(
"__wine_call16_end"
)
);
output_function_size
(
"__wine_spec_thunk_text_16"
);
...
...
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