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
20d13d0b
Commit
20d13d0b
authored
Sep 18, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwine: Also apply the load delta to the FirstThunk table.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
75a830e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
loader.c
libs/wine/loader.c
+13
-8
No files found.
libs/wine/loader.c
View file @
20d13d0b
...
...
@@ -320,22 +320,27 @@ static inline void fixup_rva_dwords( DWORD *ptr, int delta, unsigned int count )
}
/* fixup an array of name/ordinal RVAs by adding the specified delta */
static
inline
void
fixup_rva_names
(
UINT_PTR
*
ptr
,
int
delta
)
{
while
(
*
ptr
)
{
if
(
!
(
*
ptr
&
IMAGE_ORDINAL_FLAG
))
*
ptr
+=
delta
;
ptr
++
;
}
}
/* fixup RVAs in the import directory */
static
void
fixup_imports
(
IMAGE_IMPORT_DESCRIPTOR
*
dir
,
BYTE
*
base
,
int
delta
)
{
UINT_PTR
*
ptr
;
while
(
dir
->
Name
)
{
fixup_rva_dwords
(
&
dir
->
u
.
OriginalFirstThunk
,
delta
,
1
);
fixup_rva_dwords
(
&
dir
->
Name
,
delta
,
1
);
fixup_rva_dwords
(
&
dir
->
FirstThunk
,
delta
,
1
);
ptr
=
(
UINT_PTR
*
)(
base
+
(
dir
->
u
.
OriginalFirstThunk
?
dir
->
u
.
OriginalFirstThunk
:
dir
->
FirstThunk
));
while
(
*
ptr
)
{
if
(
!
(
*
ptr
&
IMAGE_ORDINAL_FLAG
))
*
ptr
+=
delta
;
ptr
++
;
}
if
(
dir
->
u
.
OriginalFirstThunk
)
fixup_rva_names
(
(
UINT_PTR
*
)(
base
+
dir
->
u
.
OriginalFirstThunk
),
delta
);
if
(
dir
->
FirstThunk
)
fixup_rva_names
(
(
UINT_PTR
*
)(
base
+
dir
->
FirstThunk
),
delta
);
dir
++
;
}
}
...
...
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