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
54f287d8
Commit
54f287d8
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 GetModuleFileNameEx() to succeed on a WoW64 process.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
72e3fdf0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
5 deletions
+29
-5
module.c
dlls/kernel32/module.c
+24
-5
psapi_main.c
dlls/psapi/tests/psapi_main.c
+5
-0
No files found.
dlls/kernel32/module.c
View file @
54f287d8
...
...
@@ -1812,17 +1812,36 @@ DWORD WINAPI K32GetModuleFileNameExW(HANDLE process, HMODULE module,
LPWSTR
file_name
,
DWORD
size
)
{
LDR_MODULE
ldr_module
;
BOOL
wow64
;
DWORD
len
;
if
(
!
size
)
return
0
;
if
(
!
get_ldr_module
(
process
,
module
,
&
ldr_module
))
if
(
!
IsWow64Process
(
process
,
&
wow64
))
return
0
;
len
=
ldr_module
.
FullDllName
.
Length
/
sizeof
(
WCHAR
);
if
(
!
ReadProcessMemory
(
process
,
ldr_module
.
FullDllName
.
Buffer
,
file_name
,
min
(
len
,
size
)
*
sizeof
(
WCHAR
),
NULL
))
return
0
;
if
(
sizeof
(
void
*
)
==
8
&&
wow64
)
{
LDR_MODULE32
ldr_module32
;
if
(
!
get_ldr_module32
(
process
,
module
,
&
ldr_module32
))
return
0
;
len
=
ldr_module32
.
FullDllName
.
Length
/
sizeof
(
WCHAR
);
if
(
!
ReadProcessMemory
(
process
,
(
void
*
)(
DWORD_PTR
)
ldr_module32
.
FullDllName
.
Buffer
,
file_name
,
min
(
len
,
size
)
*
sizeof
(
WCHAR
),
NULL
))
return
0
;
}
else
{
if
(
!
get_ldr_module
(
process
,
module
,
&
ldr_module
))
return
0
;
len
=
ldr_module
.
FullDllName
.
Length
/
sizeof
(
WCHAR
);
if
(
!
ReadProcessMemory
(
process
,
ldr_module
.
FullDllName
.
Buffer
,
file_name
,
min
(
len
,
size
)
*
sizeof
(
WCHAR
),
NULL
))
return
0
;
}
if
(
len
<
size
)
{
...
...
dlls/psapi/tests/psapi_main.c
View file @
54f287d8
...
...
@@ -202,6 +202,11 @@ static void test_EnumProcessModules(void)
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
!
strcmp
(
name
,
"notepad.exe"
),
"got %s
\n
"
,
name
);
ret
=
GetModuleFileNameExA
(
pi
.
hProcess
,
hMod
,
name
,
sizeof
(
name
));
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
todo_wine
ok
(
!
strcmp
(
name
,
buffer
),
"got %s
\n
"
,
name
);
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