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
bf9235aa
Commit
bf9235aa
authored
Oct 26, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Oct 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add more tests for SystemModuleInformation[Ex].
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6257da8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
22 deletions
+58
-22
info.c
dlls/ntdll/tests/info.c
+49
-22
winternl.h
include/winternl.h
+9
-0
No files found.
dlls/ntdll/tests/info.c
View file @
bf9235aa
...
...
@@ -469,37 +469,64 @@ static void test_query_procperf(void)
static
void
test_query_module
(
void
)
{
const
RTL_PROCESS_MODULE_INFORMATION_EX
*
infoex
;
SYSTEM_MODULE_INFORMATION
*
info
;
NTSTATUS
status
;
ULONG
ReturnLength
;
ULONG
ModuleCount
,
i
;
ULONG
size
,
i
;
char
*
buffer
;
ULONG
SystemInformationLength
=
sizeof
(
SYSTEM_MODULE_INFORMATION
);
SYSTEM_MODULE_INFORMATION
*
smi
=
HeapAlloc
(
GetProcessHeap
(),
0
,
SystemInformationLength
);
SYSTEM_MODULE
*
sm
;
status
=
pNtQuerySystemInformation
(
SystemModuleInformation
,
NULL
,
0
,
&
size
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"got %#x
\n
"
,
status
);
ok
(
size
>
0
,
"expected nonzero size
\n
"
)
;
/* Request the needed length */
status
=
pNtQuerySystemInformation
(
SystemModuleInformation
,
smi
,
0
,
&
ReturnLength
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"Expected STATUS_INFO_LENGTH_MISMATCH, got %08x
\n
"
,
status
);
ok
(
ReturnLength
>
0
,
"Expected a ReturnLength to show the needed length
\n
"
);
info
=
malloc
(
size
);
status
=
pNtQuerySystemInformation
(
SystemModuleInformation
,
info
,
size
,
&
size
);
ok
(
!
status
,
"got %#x
\n
"
,
status
);
SystemInformationLength
=
ReturnLength
;
smi
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
smi
,
SystemInformationLength
);
status
=
pNtQuerySystemInformation
(
SystemModuleInformation
,
smi
,
SystemInformationLength
,
&
ReturnLength
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
info
->
ModulesCount
>
0
,
"Expected some modules to be loaded
\n
"
);
ModuleCount
=
smi
->
ModulesCount
;
sm
=
&
smi
->
Modules
[
0
];
/* our implementation is a stub for now */
ok
(
ModuleCount
>
0
,
"Expected some modules to be loaded
\n
"
);
for
(
i
=
0
;
i
<
info
->
ModulesCount
;
i
++
)
{
const
SYSTEM_MODULE
*
module
=
&
info
->
Modules
[
i
];
/* Loop through all the modules/drivers, Wine doesn't get here (yet) */
for
(
i
=
0
;
i
<
ModuleCount
;
i
++
)
ok
(
module
->
LoadOrderIndex
==
i
,
"%u: got index %u
\n
"
,
i
,
module
->
LoadOrderIndex
);
ok
(
!!
module
->
ImageBaseAddress
,
"%u: got NULL address
\n
"
,
i
);
ok
(
module
->
ImageSize
,
"%u: got 0 size
\n
"
,
i
);
ok
(
module
->
LoadCount
,
"%u: got 0 load count
\n
"
,
i
);
}
free
(
info
);
status
=
pNtQuerySystemInformation
(
SystemModuleInformationEx
,
NULL
,
0
,
&
size
);
if
(
status
==
STATUS_INVALID_INFO_CLASS
)
{
ok
(
i
==
sm
->
LoadOrderIndex
,
"LoadOrderIndex (%d) should have matched %u
\n
"
,
sm
->
LoadOrderIndex
,
i
);
sm
++
;
todo_wine
win_skip
(
"SystemModuleInformationEx is not supported.
\n
"
);
return
;
}
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"got %#x
\n
"
,
status
);
ok
(
size
>
0
,
"expected nonzero size
\n
"
);
buffer
=
malloc
(
size
);
status
=
pNtQuerySystemInformation
(
SystemModuleInformationEx
,
buffer
,
size
,
&
size
);
ok
(
!
status
,
"got %#x
\n
"
,
status
);
infoex
=
(
const
void
*
)
buffer
;
for
(
i
=
0
;
infoex
->
NextOffset
;
i
++
)
{
const
SYSTEM_MODULE
*
module
=
&
infoex
->
BaseInfo
;
ok
(
module
->
LoadOrderIndex
==
i
,
"%u: got index %u
\n
"
,
i
,
module
->
LoadOrderIndex
);
ok
(
!!
module
->
ImageBaseAddress
,
"%u: got NULL address
\n
"
,
i
);
ok
(
module
->
ImageSize
,
"%u: got 0 size
\n
"
,
i
);
ok
(
module
->
LoadCount
,
"%u: got 0 load count
\n
"
,
i
);
infoex
=
(
const
void
*
)((
const
char
*
)
infoex
+
infoex
->
NextOffset
);
}
ok
(((
char
*
)
infoex
-
buffer
)
+
sizeof
(
infoex
->
NextOffset
)
==
size
,
"got size %u, null terminator %u
\n
"
,
size
,
(
char
*
)
infoex
-
buffer
);
free
(
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
smi
);
}
static
void
test_query_handle
(
void
)
...
...
include/winternl.h
View file @
bf9235aa
...
...
@@ -2805,6 +2805,15 @@ typedef struct _SYSTEM_MODULE_INFORMATION
#define PROCESS_CREATE_FLAGS_SUSPENDED 0x00000200
#define PROCESS_CREATE_FLAGS_EXTENDED_UNKNOWN 0x00000400
typedef
struct
_RTL_PROCESS_MODULE_INFORMATION_EX
{
USHORT
NextOffset
;
SYSTEM_MODULE
BaseInfo
;
ULONG
ImageCheckSum
;
ULONG
TimeDateStamp
;
void
*
DefaultBase
;
}
RTL_PROCESS_MODULE_INFORMATION_EX
;
#define THREAD_CREATE_FLAGS_CREATE_SUSPENDED 0x00000001
#define THREAD_CREATE_FLAGS_SKIP_THREAD_ATTACH 0x00000002
#define THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER 0x00000004
...
...
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