Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
73f0bbc7
Commit
73f0bbc7
authored
Feb 14, 2024
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Introduce exports struct.
parent
b8c75f3d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
9 deletions
+49
-9
build.h
tools/winebuild/build.h
+13
-1
parser.c
tools/winebuild/parser.c
+26
-6
utils.c
tools/winebuild/utils.c
+10
-2
No files found.
tools/winebuild/build.h
View file @
73f0bbc7
...
...
@@ -129,6 +129,17 @@ struct apiset
static
const
unsigned
int
apiset_hash_factor
=
31
;
struct
exports
{
int
nb_entry_points
;
/* number of used entry points */
ORDDEF
**
entry_points
;
/* dll entry points */
int
nb_names
;
/* number of entry points with names */
ORDDEF
**
names
;
/* array of entry point names (points into entry_points) */
int
base
;
/* ordinal base */
int
limit
;
/* ordinal limit */
ORDDEF
**
ordinals
;
/* array of dll ordinals (points into entry_points) */
};
typedef
struct
{
char
*
src_name
;
/* file name of the source spec file */
...
...
@@ -152,9 +163,10 @@ typedef struct
int
subsystem_major
;
/* subsystem version major number */
int
subsystem_minor
;
/* subsystem version minor number */
int
unicode_app
;
/* default to unicode entry point */
ORDDEF
*
entry_points
;
/*
dll
entry points */
ORDDEF
*
entry_points
;
/*
spec
entry points */
ORDDEF
**
names
;
/* array of entry point names (points into entry_points) */
ORDDEF
**
ordinals
;
/* array of dll ordinals (points into entry_points) */
struct
exports
exports
;
/* dll exports */
struct
resource
*
resources
;
/* array of dll resources (format differs between Win16/Win32) */
struct
apiset
apiset
;
/* list of defined api sets */
}
DLLSPEC
;
...
...
tools/winebuild/parser.c
View file @
73f0bbc7
...
...
@@ -952,6 +952,29 @@ static void assign_ordinals( DLLSPEC *spec )
}
static
void
assign_exports
(
DLLSPEC
*
spec
)
{
struct
exports
*
exports
=
&
spec
->
exports
;
unsigned
int
i
;
exports
->
entry_points
=
xmalloc
(
spec
->
nb_entry_points
*
sizeof
(
*
exports
->
entry_points
)
);
for
(
i
=
0
;
i
<
spec
->
nb_entry_points
;
i
++
)
{
ORDDEF
*
entry
=
&
spec
->
entry_points
[
i
];
exports
->
entry_points
[
exports
->
nb_entry_points
++
]
=
entry
;
}
assign_names
(
spec
);
assign_ordinals
(
spec
);
exports
->
nb_names
=
spec
->
nb_names
;
exports
->
names
=
spec
->
names
;
exports
->
base
=
spec
->
base
;
exports
->
limit
=
spec
->
limit
;
exports
->
ordinals
=
spec
->
ordinals
;
}
/*******************************************************************
* add_16bit_exports
*
...
...
@@ -1008,8 +1031,7 @@ void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 )
odp
->
u
.
func
.
nb_args
*
sizeof
(
odp
->
u
.
func
.
args
[
0
])
);
}
assign_names
(
spec32
);
assign_ordinals
(
spec32
);
assign_exports
(
spec32
);
}
...
...
@@ -1052,8 +1074,7 @@ int parse_spec_file( FILE *file, DLLSPEC *spec )
}
current_line
=
0
;
/* no longer parsing the input file */
assign_names
(
spec
);
assign_ordinals
(
spec
);
assign_exports
(
spec
);
return
!
nb_errors
;
}
...
...
@@ -1295,7 +1316,6 @@ int parse_def_file( FILE *file, DLLSPEC *spec )
}
current_line
=
0
;
/* no longer parsing the input file */
assign_names
(
spec
);
assign_ordinals
(
spec
);
assign_exports
(
spec
);
return
!
nb_errors
;
}
tools/winebuild/utils.c
View file @
73f0bbc7
...
...
@@ -615,10 +615,19 @@ DLLSPEC *alloc_dll_spec(void)
spec
->
subsystem_major
=
4
;
spec
->
subsystem_minor
=
0
;
spec
->
dll_characteristics
=
IMAGE_DLLCHARACTERISTICS_NX_COMPAT
|
IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE
;
spec
->
exports
.
base
=
MAX_ORDINALS
;
return
spec
;
}
static
void
free_exports
(
struct
exports
*
entries
)
{
free
(
entries
->
entry_points
);
free
(
entries
->
names
);
free
(
entries
->
ordinals
);
}
/*******************************************************************
* free_dll_spec
*
...
...
@@ -635,13 +644,12 @@ void free_dll_spec( DLLSPEC *spec )
free
(
odp
->
export_name
);
free
(
odp
->
link_name
);
}
free_exports
(
&
spec
->
exports
);
free
(
spec
->
file_name
);
free
(
spec
->
dll_name
);
free
(
spec
->
c_name
);
free
(
spec
->
init_func
);
free
(
spec
->
entry_points
);
free
(
spec
->
names
);
free
(
spec
->
ordinals
);
free
(
spec
->
resources
);
free
(
spec
);
}
...
...
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