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
02506933
Commit
02506933
authored
May 29, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
May 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Allow GetModuleInformation() to succeed on a WoW64 process.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
54f287d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
4 deletions
+29
-4
module.c
dlls/kernel32/module.c
+22
-4
psapi_main.c
dlls/psapi/tests/psapi_main.c
+7
-0
No files found.
dlls/kernel32/module.c
View file @
02506933
...
...
@@ -1907,6 +1907,7 @@ BOOL WINAPI K32GetModuleInformation(HANDLE process, HMODULE module,
MODULEINFO
*
modinfo
,
DWORD
cb
)
{
LDR_MODULE
ldr_module
;
BOOL
wow64
;
if
(
cb
<
sizeof
(
MODULEINFO
))
{
...
...
@@ -1914,12 +1915,29 @@ BOOL WINAPI K32GetModuleInformation(HANDLE process, HMODULE module,
return
FALSE
;
}
if
(
!
get_ldr_module
(
process
,
module
,
&
ldr_module
))
if
(
!
IsWow64Process
(
process
,
&
wow64
))
return
FALSE
;
modinfo
->
lpBaseOfDll
=
ldr_module
.
BaseAddress
;
modinfo
->
SizeOfImage
=
ldr_module
.
SizeOfImage
;
modinfo
->
EntryPoint
=
ldr_module
.
EntryPoint
;
if
(
sizeof
(
void
*
)
==
8
&&
wow64
)
{
LDR_MODULE32
ldr_module32
;
if
(
!
get_ldr_module32
(
process
,
module
,
&
ldr_module32
))
return
FALSE
;
modinfo
->
lpBaseOfDll
=
(
void
*
)(
DWORD_PTR
)
ldr_module32
.
BaseAddress
;
modinfo
->
SizeOfImage
=
ldr_module32
.
SizeOfImage
;
modinfo
->
EntryPoint
=
(
void
*
)(
DWORD_PTR
)
ldr_module32
.
EntryPoint
;
}
else
{
if
(
!
get_ldr_module
(
process
,
module
,
&
ldr_module
))
return
FALSE
;
modinfo
->
lpBaseOfDll
=
ldr_module
.
BaseAddress
;
modinfo
->
SizeOfImage
=
ldr_module
.
SizeOfImage
;
modinfo
->
EntryPoint
=
ldr_module
.
EntryPoint
;
}
return
TRUE
;
}
...
...
dlls/psapi/tests/psapi_main.c
View file @
02506933
...
...
@@ -182,6 +182,7 @@ static void test_EnumProcessModules(void)
if
(
sizeof
(
void
*
)
==
8
)
{
MODULEINFO
info
;
char
name
[
40
];
strcpy
(
buffer
,
"C:
\\
windows
\\
syswow64
\\
notepad.exe"
);
...
...
@@ -207,6 +208,12 @@ static void test_EnumProcessModules(void)
todo_wine
ok
(
!
strcmp
(
name
,
buffer
),
"got %s
\n
"
,
name
);
ret
=
GetModuleInformation
(
pi
.
hProcess
,
hMod
,
&
info
,
sizeof
(
info
));
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
info
.
lpBaseOfDll
==
hMod
,
"expected %p, got %p
\n
"
,
hMod
,
info
.
lpBaseOfDll
);
ok
(
info
.
SizeOfImage
,
"image size was 0
\n
"
);
ok
(
info
.
EntryPoint
>=
info
.
lpBaseOfDll
,
"got entry point %p
\n
"
,
info
.
EntryPoint
);
TerminateProcess
(
pi
.
hProcess
,
0
);
}
else
if
(
wow64
)
...
...
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