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
9e2c76c6
Commit
9e2c76c6
authored
Jan 11, 2008
by
Andrey Turkin
Committed by
Alexandre Julliard
Jan 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Implement ImageDirectoryEntryToDataEx.
parent
5e10ef04
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
2 deletions
+52
-2
dbghelp.spec
dlls/dbghelp/dbghelp.spec
+2
-2
pe_module.c
dlls/dbghelp/pe_module.c
+50
-0
No files found.
dlls/dbghelp/dbghelp.spec
View file @
9e2c76c6
...
...
@@ -15,8 +15,8 @@
@ stub FindFileInPath
@ stub FindFileInSearchPath
@ stdcall GetTimestampForLoadedLibrary(long)
@ stdcall ImageDirectoryEntryToData(ptr long long ptr)
ntdll.RtlImageDirectoryEntryToData
@ st
ub ImageDirectoryEntryToDataEx
@ stdcall ImageDirectoryEntryToData(ptr long long ptr)
@ st
dcall ImageDirectoryEntryToDataEx(ptr long long ptr ptr)
@ stdcall ImageNtHeader(ptr) ntdll.RtlImageNtHeader
@ stdcall ImageRvaToSection(ptr ptr long) ntdll.RtlImageRvaToSection
@ stdcall ImageRvaToVa(ptr ptr long ptr) ntdll.RtlImageRvaToVa
...
...
dlls/dbghelp/pe_module.c
View file @
9e2c76c6
...
...
@@ -417,3 +417,53 @@ struct module* pe_load_builtin_module(struct process* pcs, const WCHAR* name,
}
return
module
;
}
/***********************************************************************
* ImageDirectoryEntryToDataEx (DBGHELP.@)
*
* Search for specified directory in PE image
*
* PARAMS
*
* base [in] Image base address
* image [in] TRUE - image has been loaded by loader, FALSE - raw file image
* dir [in] Target directory index
* size [out] Receives directory size
* section [out] Receives pointer to section header of section containing directory data
*
* RETURNS
* Success: pointer to directory data
* Failure: NULL
*
*/
PVOID
WINAPI
ImageDirectoryEntryToDataEx
(
PVOID
base
,
BOOLEAN
image
,
USHORT
dir
,
PULONG
size
,
PIMAGE_SECTION_HEADER
*
section
)
{
const
IMAGE_NT_HEADERS
*
nt
;
DWORD
addr
;
*
size
=
0
;
if
(
!
(
nt
=
RtlImageNtHeader
(
base
)))
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
)
{
if
(
*
section
)
*
section
=
NULL
;
return
(
char
*
)
base
+
addr
;
}
return
RtlImageRvaToVa
(
nt
,
(
HMODULE
)
base
,
addr
,
section
);
}
/***********************************************************************
* ImageDirectoryEntryToData (DBGHELP.@)
*
* NOTES
* See ImageDirectoryEntryToDataEx
*/
PVOID
WINAPI
ImageDirectoryEntryToData
(
PVOID
base
,
BOOLEAN
image
,
USHORT
dir
,
PULONG
size
)
{
return
ImageDirectoryEntryToDataEx
(
base
,
image
,
dir
,
size
,
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