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
5e47acbc
Commit
5e47acbc
authored
May 25, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only add extra symbols if they are not already exported by this dll.
parent
425ac1ec
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
18 deletions
+42
-18
import.c
tools/winebuild/import.c
+42
-18
No files found.
tools/winebuild/import.c
View file @
5e47acbc
...
...
@@ -237,15 +237,37 @@ static int remove_symbol_holes(void)
return
off
;
}
/* add a symbol to the extra list, but only if needed */
static
int
add_extra_symbol
(
const
char
**
extras
,
int
*
count
,
const
char
*
name
)
{
int
i
;
if
(
!
find_symbol
(
name
,
undef_symbols
,
nb_undef_symbols
))
{
/* check if the symbol is being exported by this dll */
for
(
i
=
0
;
i
<
nb_entry_points
;
i
++
)
{
ORDDEF
*
odp
=
EntryPoints
[
i
];
if
(
odp
->
type
==
TYPE_STDCALL
||
odp
->
type
==
TYPE_CDECL
||
odp
->
type
==
TYPE_VARARGS
||
odp
->
type
==
TYPE_EXTERN
)
{
if
(
!
strcmp
(
odp
->
name
,
name
))
return
0
;
}
}
extras
[
*
count
]
=
name
;
(
*
count
)
++
;
}
return
1
;
}
/* add the extra undefined symbols that will be contained in the generated spec file itself */
static
void
add_extra_undef_symbols
(
void
)
{
const
char
*
extras
[
10
];
int
i
,
count
=
0
,
nb_stubs
=
0
,
nb_regs
=
0
;
#define ADD_SYM(name) \
do { if (!find_symbol( extras[count] = (name), undef_symbols, \
nb_undef_symbols )) count++; } while(0)
int
kernel_imports
=
0
,
ntdll_imports
=
0
;
sort_symbols
(
undef_symbols
,
nb_undef_symbols
);
...
...
@@ -262,33 +284,35 @@ static void add_extra_undef_symbols(void)
case
SPEC_MODE_DLL
:
break
;
case
SPEC_MODE_GUIEXE
:
ADD_SYM
(
"GetCommandLineA"
);
ADD_SYM
(
"GetStartupInfoA"
);
ADD_SYM
(
"GetModuleHandleA"
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"GetCommandLineA"
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"GetStartupInfoA"
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"GetModuleHandleA"
);
/* fall through */
case
SPEC_MODE_CUIEXE
:
ADD_SYM
(
"ExitProcess"
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"ExitProcess"
);
break
;
case
SPEC_MODE_GUIEXE_UNICODE
:
ADD_SYM
(
"GetCommandLineA"
);
ADD_SYM
(
"GetStartupInfoA"
);
ADD_SYM
(
"GetModuleHandleA"
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"GetCommandLineA"
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"GetStartupInfoA"
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"GetModuleHandleA"
);
/* fall through */
case
SPEC_MODE_CUIEXE_UNICODE
:
ADD_SYM
(
"ExitProcess"
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"ExitProcess"
);
break
;
}
if
(
nb_delayed
)
{
ADD_SYM
(
"LoadLibraryA"
);
ADD_SYM
(
"GetProcAddress"
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"LoadLibraryA"
);
kernel_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"GetProcAddress"
);
}
if
(
nb_regs
)
ADD_SYM
(
"__wine_call_from_32_regs"
);
if
(
nb_delayed
||
nb_stubs
)
ADD_SYM
(
"RtlRaiseException"
);
if
(
nb_regs
)
ntdll_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"__wine_call_from_32_regs"
);
if
(
nb_delayed
||
nb_stubs
)
ntdll_imports
+=
add_extra_symbol
(
extras
,
&
count
,
"RtlRaiseException"
);
/* make sure we import the dlls that contain these functions */
if
(
SpecMode
!=
SPEC_MODE_DLL
||
nb_delayed
)
add_import_dll
(
"kernel32"
,
0
);
if
(
n
b_delayed
||
nb_stubs
||
nb_reg
s
)
add_import_dll
(
"ntdll"
,
0
);
if
(
kernel_imports
)
add_import_dll
(
"kernel32"
,
0
);
if
(
n
tdll_import
s
)
add_import_dll
(
"ntdll"
,
0
);
if
(
count
)
{
...
...
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