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
c39e28ed
Commit
c39e28ed
authored
Sep 25, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Support both 32-bit and 64-bit modules in RtlImageDirectoryEntryToData.
parent
bb223b78
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
loader.c
dlls/ntdll/loader.c
+19
-4
No files found.
dlls/ntdll/loader.c
View file @
c39e28ed
...
...
@@ -2522,10 +2522,25 @@ PVOID WINAPI RtlImageDirectoryEntryToData( HMODULE module, BOOL image, WORD dir,
image
=
FALSE
;
}
if
(
!
(
nt
=
RtlImageNtHeader
(
module
)))
return
NULL
;
if
(
dir
>=
nt
->
OptionalHeader
.
NumberOfRvaAndSizes
)
return
NULL
;
if
(
!
(
addr
=
nt
->
OptionalHeader
.
DataDirectory
[
dir
].
VirtualAddress
))
return
NULL
;
*
size
=
nt
->
OptionalHeader
.
DataDirectory
[
dir
].
Size
;
if
(
image
||
addr
<
nt
->
OptionalHeader
.
SizeOfHeaders
)
return
(
char
*
)
module
+
addr
;
if
(
nt
->
OptionalHeader
.
Magic
==
IMAGE_NT_OPTIONAL_HDR64_MAGIC
)
{
const
IMAGE_NT_HEADERS64
*
nt64
=
(
IMAGE_NT_HEADERS64
*
)
nt
;
if
(
dir
>=
nt64
->
OptionalHeader
.
NumberOfRvaAndSizes
)
return
NULL
;
if
(
!
(
addr
=
nt64
->
OptionalHeader
.
DataDirectory
[
dir
].
VirtualAddress
))
return
NULL
;
*
size
=
nt64
->
OptionalHeader
.
DataDirectory
[
dir
].
Size
;
if
(
image
||
addr
<
nt64
->
OptionalHeader
.
SizeOfHeaders
)
return
(
char
*
)
module
+
addr
;
}
else
if
(
nt
->
OptionalHeader
.
Magic
==
IMAGE_NT_OPTIONAL_HDR32_MAGIC
)
{
const
IMAGE_NT_HEADERS32
*
nt32
=
(
IMAGE_NT_HEADERS32
*
)
nt
;
if
(
dir
>=
nt32
->
OptionalHeader
.
NumberOfRvaAndSizes
)
return
NULL
;
if
(
!
(
addr
=
nt32
->
OptionalHeader
.
DataDirectory
[
dir
].
VirtualAddress
))
return
NULL
;
*
size
=
nt32
->
OptionalHeader
.
DataDirectory
[
dir
].
Size
;
if
(
image
||
addr
<
nt32
->
OptionalHeader
.
SizeOfHeaders
)
return
(
char
*
)
module
+
addr
;
}
else
return
NULL
;
/* not mapped as image, need to find the section containing the virtual address */
return
RtlImageRvaToVa
(
nt
,
module
,
addr
,
NULL
);
...
...
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