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
00bf7293
Commit
00bf7293
authored
Feb 14, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
psapi: Add more tests for EnumProcessModules().
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
parent
82e3e014
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
psapi_main.c
dlls/psapi/tests/psapi_main.c
+22
-8
No files found.
dlls/psapi/tests/psapi_main.c
View file @
00bf7293
...
...
@@ -141,6 +141,7 @@ static void test_EnumProcessModules(void)
{
MODULEINFO
info
;
char
name
[
40
];
HMODULE
hmods
[
3
];
strcpy
(
buffer
,
"C:
\\
windows
\\
syswow64
\\
notepad.exe"
);
ret
=
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
...
...
@@ -150,26 +151,39 @@ static void test_EnumProcessModules(void)
ok
(
!
ret
,
"wait timed out
\n
"
);
SetLastError
(
0xdeadbeef
);
h
Mod
=
NULL
;
ret
=
EnumProcessModules
(
pi
.
hProcess
,
&
hMod
,
sizeof
(
HMODULE
),
&
cbNeeded
);
h
mods
[
0
]
=
NULL
;
ret
=
EnumProcessModules
(
pi
.
hProcess
,
hmods
,
sizeof
(
hmods
),
&
cbNeeded
);
ok
(
ret
==
1
,
"got %ld, error %lu
\n
"
,
ret
,
GetLastError
());
ok
(
!!
hMod
,
"expected non-NULL module
\n
"
);
ok
(
cbNeeded
%
sizeof
(
hMod
)
==
0
,
"got %lu
\n
"
,
cbNeeded
);
ok
(
cbNeeded
>=
sizeof
(
HMODULE
),
"expected at least one module
\n
"
);
ok
(
!!
hmods
[
0
],
"expected non-NULL module
\n
"
);
ok
(
cbNeeded
%
sizeof
(
hmods
[
0
])
==
0
,
"got %lu
\n
"
,
cbNeeded
);
ret
=
GetModuleBaseNameA
(
pi
.
hProcess
,
h
Mod
,
name
,
sizeof
(
name
));
ret
=
GetModuleBaseNameA
(
pi
.
hProcess
,
h
mods
[
0
]
,
name
,
sizeof
(
name
));
ok
(
ret
,
"got error %lu
\n
"
,
GetLastError
());
ok
(
!
strcmp
(
name
,
"notepad.exe"
),
"got %s
\n
"
,
name
);
ret
=
GetModuleFileNameExA
(
pi
.
hProcess
,
h
Mod
,
name
,
sizeof
(
name
));
ret
=
GetModuleFileNameExA
(
pi
.
hProcess
,
h
mods
[
0
]
,
name
,
sizeof
(
name
));
ok
(
ret
,
"got error %lu
\n
"
,
GetLastError
());
ok
(
!
strcmp
(
name
,
buffer
),
"got %s
\n
"
,
name
);
ret
=
GetModuleInformation
(
pi
.
hProcess
,
h
Mod
,
&
info
,
sizeof
(
info
));
ret
=
GetModuleInformation
(
pi
.
hProcess
,
h
mods
[
0
]
,
&
info
,
sizeof
(
info
));
ok
(
ret
,
"got error %lu
\n
"
,
GetLastError
());
ok
(
info
.
lpBaseOfDll
==
h
Mod
,
"expected %p, got %p
\n
"
,
hMod
,
info
.
lpBaseOfDll
);
ok
(
info
.
lpBaseOfDll
==
h
mods
[
0
],
"expected %p, got %p
\n
"
,
hmods
[
0
]
,
info
.
lpBaseOfDll
);
ok
(
info
.
SizeOfImage
,
"image size was 0
\n
"
);
ok
(
info
.
EntryPoint
>=
info
.
lpBaseOfDll
,
"got entry point %p
\n
"
,
info
.
EntryPoint
);
/* "old" Wine wow64 will only return main DLL; while windows & multi-arch Wine Wow64 setup
* will return main module, ntdll.dll and one of the wow64*.dll.
*/
todo_wine_if
(
cbNeeded
==
sizeof
(
HMODULE
))
ok
(
cbNeeded
>=
3
*
sizeof
(
HMODULE
),
"Wrong count of DLLs
\n
"
);
if
(
cbNeeded
>=
3
*
sizeof
(
HMODULE
))
{
ret
=
GetModuleBaseNameA
(
pi
.
hProcess
,
hmods
[
2
],
name
,
sizeof
(
name
));
ok
(
ret
,
"got error %lu
\n
"
,
GetLastError
());
todo_wine
ok
(
strstr
(
CharLowerA
(
name
),
"wow64"
)
!=
NULL
,
"third DLL in wow64 should be one of wow*.dll (%s)
\n
"
,
name
);
}
TerminateProcess
(
pi
.
hProcess
,
0
);
}
else
...
...
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