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
745ec84c
Commit
745ec84c
authored
Nov 13, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Export the CallFrom16xxx functions from kernel32. Renamed them
__wine_call_from_16 to follow the naming convention.
parent
3570bfd4
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
51 additions
and
46 deletions
+51
-46
kernel32.spec
dlls/kernel/kernel32.spec
+13
-0
thunk.c
dlls/kernel/thunk.c
+4
-4
builtin.c
if1632/builtin.c
+2
-2
relay.c
if1632/relay.c
+4
-11
snoop.c
if1632/snoop.c
+2
-2
builtin16.h
include/builtin16.h
+6
-6
relay.c
tools/winebuild/relay.c
+14
-15
spec16.c
tools/winebuild/spec16.c
+4
-4
winproc.c
windows/winproc.c
+2
-2
No files found.
dlls/kernel/kernel32.spec
View file @
745ec84c
...
...
@@ -937,3 +937,16 @@ debug_channels (comm debugstr dll int resource stress thunk toolhelp win32)
@ stdcall InitializeCriticalSectionAndSpinCount(ptr long) InitializeCriticalSectionAndSpinCount
@ stdcall SetCriticalSectionSpinCount(ptr long) SetCriticalSectionSpinCount
@ stdcall ProcessIdToSessionId(long ptr) ProcessIdToSessionId
##################
# Wine extensions
#
# All functions must be prefixed with '__wine_' (for internal functions)
# or 'wine_' (for user-visible functions) to avoid namespace conflicts.
# 16-bit relays
@ cdecl __wine_register_dll_16(ptr) __wine_register_dll_16
@ varargs __wine_call_from_16_word() __wine_call_from_16_word
@ varargs __wine_call_from_16_long() __wine_call_from_16_word
@ varargs __wine_call_from_16_regs() __wine_call_from_16_word
@ varargs __wine_call_from_16_thunk() __wine_call_from_16_word
dlls/kernel/thunk.c
View file @
745ec84c
...
...
@@ -1302,7 +1302,7 @@ void WINAPI C16ThkSL(CONTEXT86 *context)
* push edx
* push dx
* push edx
* call __FLATCS:
CallFrom16T
hunk
* call __FLATCS:
__wine_call_from_16_t
hunk
*/
*
x
++
=
0xB8
;
*
((
WORD
*
)
x
)
++
=
ds
;
...
...
@@ -1315,7 +1315,7 @@ void WINAPI C16ThkSL(CONTEXT86 *context)
*
x
++
=
0x66
;
*
x
++
=
0x52
;
*
x
++
=
0x52
;
*
x
++
=
0x66
;
*
x
++
=
0x52
;
*
x
++
=
0x66
;
*
x
++
=
0x9A
;
*
((
DWORD
*
)
x
)
++
=
(
DWORD
)
CallFrom16T
hunk
;
*
x
++
=
0x66
;
*
x
++
=
0x9A
;
*
((
DWORD
*
)
x
)
++
=
(
DWORD
)
__wine_call_from_16_t
hunk
;
*
((
WORD
*
)
x
)
++
=
cs
;
/* Jump to the stub code just created */
...
...
@@ -1361,7 +1361,7 @@ void WINAPI C16ThkSL01(CONTEXT86 *context)
* push edx
* push dx
* push edx
* call __FLATCS:
CallFrom16T
hunk
* call __FLATCS:
__wine_call_from_16_t
hunk
*/
*
x
++
=
0x66
;
*
x
++
=
0x33
;
*
x
++
=
0xC0
;
...
...
@@ -1372,7 +1372,7 @@ void WINAPI C16ThkSL01(CONTEXT86 *context)
*
x
++
=
0x66
;
*
x
++
=
0x52
;
*
x
++
=
0x52
;
*
x
++
=
0x66
;
*
x
++
=
0x52
;
*
x
++
=
0x66
;
*
x
++
=
0x9A
;
*
((
DWORD
*
)
x
)
++
=
(
DWORD
)
CallFrom16T
hunk
;
*
x
++
=
0x66
;
*
x
++
=
0x9A
;
*
((
DWORD
*
)
x
)
++
=
(
DWORD
)
__wine_call_from_16_t
hunk
;
*
((
WORD
*
)
x
)
++
=
cs
;
/* Jump to the stub code just created */
...
...
if1632/builtin.c
View file @
745ec84c
...
...
@@ -209,11 +209,11 @@ LPCSTR BUILTIN_GetEntryPoint16( STACK16FRAME *frame, LPSTR name, WORD *pOrd )
/***********************************************************************
*
BUILTIN_RegisterDLL
*
__wine_register_dll_16
*
* Register a built-in DLL descriptor.
*/
void
BUILTIN_RegisterDLL
(
const
BUILTIN16_DESCRIPTOR
*
descr
)
void
__wine_register_dll_16
(
const
BUILTIN16_DESCRIPTOR
*
descr
)
{
assert
(
nb_dlls
<
MAX_DLLS
);
builtin_dlls
[
nb_dlls
++
]
=
descr
;
...
...
if1632/relay.c
View file @
745ec84c
...
...
@@ -75,17 +75,10 @@ void CALLBACK CallTo16RegisterShort( CONTEXT86 *context, INT nArgs )
void
CALLBACK
CallTo16RegisterLong
(
CONTEXT86
*
context
,
INT
nArgs
)
{
assert
(
FALSE
);
}
WORD
CallFrom16Word
(
void
)
{
assert
(
FALSE
);
}
LONG
CallFrom16Long
(
void
)
{
assert
(
FALSE
);
}
void
CallFrom16Register
(
void
)
{
assert
(
FALSE
);
}
void
CallFrom16Thunk
(
void
)
{
assert
(
FALSE
);
}
WORD
__wine_call_from_16_word
()
{
assert
(
FALSE
);
}
LONG
__wine_call_from_16_long
()
{
assert
(
FALSE
);
}
void
__wine_call_from_16_regs
()
{
assert
(
FALSE
);
}
void
__wine_call_from_16_thunk
()
{
assert
(
FALSE
);
}
DWORD
WINAPI
CALL32_CBClient
(
FARPROC
proc
,
LPWORD
args
,
DWORD
*
esi
)
{
assert
(
FALSE
);
}
...
...
if1632/snoop.c
View file @
745ec84c
...
...
@@ -99,7 +99,7 @@ SNOOP16_RegisterDLL(NE_MODULE *pModule,LPCSTR name) {
snr
[
0
].
pushl
=
0x68
;
snr
[
0
].
realfun
=
(
DWORD
)
SNOOP16_Entry
;
snr
[
0
].
lcall
=
0x9a
;
snr
[
0
].
callfromregs
=
(
DWORD
)
CallFrom16Register
;
snr
[
0
].
callfromregs
=
(
DWORD
)
__wine_call_from_16_regs
;
snr
[
0
].
seg
=
__get_cs
();
snr
[
0
].
lret
=
0xcb66
;
...
...
@@ -109,7 +109,7 @@ SNOOP16_RegisterDLL(NE_MODULE *pModule,LPCSTR name) {
snr
[
1
].
pushl
=
0x68
;
snr
[
1
].
realfun
=
(
DWORD
)
SNOOP16_Return
;
snr
[
1
].
lcall
=
0x9a
;
snr
[
1
].
callfromregs
=
(
DWORD
)
CallFrom16Register
;
snr
[
1
].
callfromregs
=
(
DWORD
)
__wine_call_from_16_regs
;
snr
[
1
].
seg
=
__get_cs
();
snr
[
1
].
lret
=
0xcb66
;
}
...
...
include/builtin16.h
View file @
745ec84c
...
...
@@ -14,11 +14,6 @@
struct
_CONTEXT86
;
struct
_STACK16FRAME
;
extern
WORD
CallFrom16Word
();
extern
LONG
CallFrom16Long
();
extern
void
CallFrom16Register
();
extern
void
CallFrom16Thunk
();
extern
WORD
CALLBACK
CallTo16Word
(
FARPROC16
target
,
INT
nArgs
);
extern
LONG
CALLBACK
CallTo16Long
(
FARPROC16
target
,
INT
nArgs
);
extern
void
CALLBACK
CallTo16RegisterShort
(
struct
_CONTEXT86
*
context
,
INT
nArgs
);
...
...
@@ -63,6 +58,11 @@ typedef struct
extern
HMODULE16
BUILTIN_LoadModule
(
LPCSTR
name
);
extern
LPCSTR
BUILTIN_GetEntryPoint16
(
struct
_STACK16FRAME
*
frame
,
LPSTR
name
,
WORD
*
pOrd
);
extern
void
BUILTIN_RegisterDLL
(
const
BUILTIN16_DESCRIPTOR
*
descr
);
extern
void
__wine_register_dll_16
(
const
BUILTIN16_DESCRIPTOR
*
descr
);
extern
WORD
__wine_call_from_16_word
();
extern
LONG
__wine_call_from_16_long
();
extern
void
__wine_call_from_16_regs
();
extern
void
__wine_call_from_16_thunk
();
#endif
/* __WINE_BUILTIN16_H */
tools/winebuild/relay.c
View file @
745ec84c
...
...
@@ -87,17 +87,16 @@
*/
static
void
BuildCallFrom16Core
(
FILE
*
outfile
,
int
reg_func
,
int
thunk
,
int
short_ret
)
{
char
*
name
=
thunk
?
"
Thunk"
:
reg_func
?
"Register"
:
short_ret
?
"Word"
:
"L
ong"
;
char
*
name
=
thunk
?
"
thunk"
:
reg_func
?
"regs"
:
short_ret
?
"word"
:
"l
ong"
;
/* Function header */
fprintf
(
outfile
,
"
\n\t
.align 4
\n
"
);
#ifdef USE_STABS
fprintf
(
outfile
,
".stabs
\"
CallFrom16%s:F1
\"
,36,0,0,"
PREFIX
"CallFrom16%s
\n
"
,
name
,
name
);
fprintf
(
outfile
,
".stabs
\"
__wine_call_from_16_%s:F1
\"
,36,0,0,"
PREFIX
"__wine_call_from_16_%s
\n
"
,
name
,
name
);
#endif
fprintf
(
outfile
,
"
\t
.type "
PREFIX
"
CallFrom16
%s,@function
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
.globl "
PREFIX
"
CallFrom16
%s
\n
"
,
name
);
fprintf
(
outfile
,
PREFIX
"
CallFrom16
%s:
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
.type "
PREFIX
"
__wine_call_from_16_
%s,@function
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
.globl "
PREFIX
"
__wine_call_from_16_
%s
\n
"
,
name
);
fprintf
(
outfile
,
PREFIX
"
__wine_call_from_16_
%s:
\n
"
,
name
);
/* Create STACK16FRAME (except STACK32FRAME link) */
fprintf
(
outfile
,
"
\t
pushw %%gs
\n
"
);
...
...
@@ -114,10 +113,10 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho
if
(
UsePIC
)
{
/* Get Global Offset Table into %ecx */
fprintf
(
outfile
,
"
\t
call .L
CallFrom16
%s.getgot1
\n
"
,
name
);
fprintf
(
outfile
,
".L
CallFrom16
%s.getgot1:
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
call .L
__wine_call_from_16_
%s.getgot1
\n
"
,
name
);
fprintf
(
outfile
,
".L
__wine_call_from_16_
%s.getgot1:
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
popl %%ecx
\n
"
);
fprintf
(
outfile
,
"
\t
addl $_GLOBAL_OFFSET_TABLE_+[.-.L
CallFrom16
%s.getgot1], %%ecx
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
addl $_GLOBAL_OFFSET_TABLE_+[.-.L
__wine_call_from_16_
%s.getgot1], %%ecx
\n
"
,
name
);
}
if
(
UsePIC
)
...
...
@@ -278,10 +277,10 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho
fprintf
(
outfile
,
"
\t
pushl %%ebx
\n
"
);
/* Get Global Offset Table into %ebx (for PLT call) */
fprintf
(
outfile
,
"
\t
call .L
CallFrom16
%s.getgot2
\n
"
,
name
);
fprintf
(
outfile
,
".L
CallFrom16
%s.getgot2:
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
call .L
__wine_call_from_16_
%s.getgot2
\n
"
,
name
);
fprintf
(
outfile
,
".L
__wine_call_from_16_
%s.getgot2:
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
popl %%ebx
\n
"
);
fprintf
(
outfile
,
"
\t
addl $_GLOBAL_OFFSET_TABLE_+[.-.L
CallFrom16
%s.getgot2], %%ebx
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
addl $_GLOBAL_OFFSET_TABLE_+[.-.L
__wine_call_from_16_
%s.getgot2], %%ebx
\n
"
,
name
);
}
fprintf
(
outfile
,
"
\t
pushl %%edx
\n
"
);
...
...
@@ -317,10 +316,10 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho
fprintf
(
outfile
,
"
\t
pushl %%ebx
\n
"
);
/* Get Global Offset Table into %ebx (for PLT call) */
fprintf
(
outfile
,
"
\t
call .L
CallFrom16
%s.getgot3
\n
"
,
name
);
fprintf
(
outfile
,
".L
CallFrom16
%s.getgot3:
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
call .L
__wine_call_from_16_
%s.getgot3
\n
"
,
name
);
fprintf
(
outfile
,
".L
__wine_call_from_16_
%s.getgot3:
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
popl %%ebx
\n
"
);
fprintf
(
outfile
,
"
\t
addl $_GLOBAL_OFFSET_TABLE_+[.-.L
CallFrom16
%s.getgot3], %%ebx
\n
"
,
name
);
fprintf
(
outfile
,
"
\t
addl $_GLOBAL_OFFSET_TABLE_+[.-.L
__wine_call_from_16_
%s.getgot3], %%ebx
\n
"
,
name
);
}
fprintf
(
outfile
,
"
\t
pushl %%eax
\n
"
);
...
...
tools/winebuild/spec16.c
View file @
745ec84c
...
...
@@ -682,11 +682,11 @@ void BuildSpec16File( FILE *outfile )
if
(
typelist
[
i
]
->
type
==
TYPE_INTERRUPT
)
argsize
+=
2
;
fprintf
(
outfile
,
" { 0x68, %s_CallFrom16_%s, 0x9a,
CallFrom16
%s,
\n
"
,
fprintf
(
outfile
,
" { 0x68, %s_CallFrom16_%s, 0x9a,
__wine_call_from_16_
%s,
\n
"
,
DLLName
,
profile
,
(
typelist
[
i
]
->
type
==
TYPE_REGISTER
||
typelist
[
i
]
->
type
==
TYPE_INTERRUPT
)
?
"
Register
"
:
typelist
[
i
]
->
type
==
TYPE_PASCAL_16
?
"
Word"
:
"L
ong"
);
||
typelist
[
i
]
->
type
==
TYPE_INTERRUPT
)
?
"
regs
"
:
typelist
[
i
]
->
type
==
TYPE_PASCAL_16
?
"
word"
:
"l
ong"
);
if
(
argsize
)
fprintf
(
outfile
,
" 0x%04x, 0x66, 0xca, %d,
\"
%s
\"
},
\n
"
,
code_selector
,
argsize
,
profile
);
...
...
@@ -787,7 +787,7 @@ void BuildSpec16File( FILE *outfile )
fprintf
(
outfile
,
"
\"\\
t.previous
\\
n
\"
);
\n
"
);
fprintf
(
outfile
,
"}
\n
"
);
fprintf
(
outfile
,
"#endif /* defined(__GNUC__) */
\n
"
);
fprintf
(
outfile
,
"static void %s_init(void) {
BUILTIN_RegisterDLL
( &descriptor ); }
\n
"
,
fprintf
(
outfile
,
"static void %s_init(void) {
__wine_register_dll_16
( &descriptor ); }
\n
"
,
DLLName
);
}
...
...
windows/winproc.c
View file @
745ec84c
...
...
@@ -42,7 +42,7 @@ typedef struct
BYTE
pushl_relay
;
/* pushl $relay */
void
(
*
relay
)();
/* WINPROC_Thunk16To32A/W() */
BYTE
lcall
;
/* lcall cs:glue */
void
(
*
glue
)();
/*
CallFrom16L
ong */
void
(
*
glue
)();
/*
__wine_call_from_16_l
ong */
WORD
cs
;
/* __FLATCS */
WORD
lret
;
/* lret $10 */
WORD
nArgs
;
...
...
@@ -335,7 +335,7 @@ static WINDOWPROC *WINPROC_AllocWinProc( WNDPROC16 func, WINDOWPROCTYPE type,
(
void
(
*
)())
WINPROC_Thunk16To32A
:
(
void
(
*
)())
WINPROC_Thunk16To32W
;
proc
->
thunk
.
t_from16
.
lcall
=
0x9a
;
/* lcall cs:glue */
proc
->
thunk
.
t_from16
.
glue
=
(
void
*
)
CallFrom16L
ong
;
proc
->
thunk
.
t_from16
.
glue
=
(
void
*
)
__wine_call_from_16_l
ong
;
proc
->
thunk
.
t_from16
.
cs
=
__get_cs
();
proc
->
thunk
.
t_from16
.
lret
=
0xca66
;
proc
->
thunk
.
t_from16
.
nArgs
=
10
;
...
...
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