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
0b6c3a44
Commit
0b6c3a44
authored
Nov 25, 2019
by
Anastasios Simeonidis
Committed by
Alexandre Julliard
Dec 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add relationship tests for NtQuerySystemInformationEx.
Signed-off-by:
Anastasios Simeonidis
<
symeonidis@csd.auth.gr
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
440a06f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
146 additions
and
20 deletions
+146
-20
info.c
dlls/ntdll/tests/info.c
+146
-20
No files found.
dlls/ntdll/tests/info.c
View file @
0b6c3a44
...
...
@@ -738,8 +738,9 @@ static void test_query_logicalproc(void)
static
void
test_query_logicalprocex
(
void
)
{
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
infoex
,
*
infoex2
;
DWORD
relationship
,
len2
,
len
;
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
infoex
,
*
infoex_public
,
*
infoex_core
,
*
infoex_numa
,
*
infoex_cache
,
*
infoex_package
,
*
infoex_group
,
*
ex
;
DWORD
relationship
,
len
,
len_public
,
len_core
,
len_numa
,
len_cache
,
len_package
,
len_group
,
len_union
;
NTSTATUS
status
;
BOOL
ret
;
...
...
@@ -747,40 +748,69 @@ static void test_query_logicalprocex(void)
return
;
len
=
0
;
relationship
=
Relation
ProcessorCore
;
relationship
=
Relation
All
;
status
=
pNtQuerySystemInformationEx
(
SystemLogicalProcessorInformationEx
,
&
relationship
,
sizeof
(
relationship
),
NULL
,
0
,
&
len
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"got 0x%08x
\n
"
,
status
);
ok
(
len
>
0
,
"got %u
\n
"
,
len
);
len
=
0
;
relationship
=
Relation
All
;
status
=
pNtQuerySystemInformationEx
(
SystemLogicalProcessorInformationEx
,
&
relationship
,
sizeof
(
relationship
),
NULL
,
0
,
&
len
);
len
_core
=
0
;
relationship
=
Relation
ProcessorCore
;
status
=
pNtQuerySystemInformationEx
(
SystemLogicalProcessorInformationEx
,
&
relationship
,
sizeof
(
relationship
),
NULL
,
0
,
&
len
_core
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"got 0x%08x
\n
"
,
status
);
ok
(
len
>
0
,
"got %u
\n
"
,
len
);
ok
(
len_core
>
0
,
"got %u
\n
"
,
len_core
);
len_numa
=
0
;
relationship
=
RelationNumaNode
;
status
=
pNtQuerySystemInformationEx
(
SystemLogicalProcessorInformationEx
,
&
relationship
,
sizeof
(
relationship
),
NULL
,
0
,
&
len_numa
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"got 0x%08x
\n
"
,
status
);
ok
(
len_numa
>
0
,
"got %u
\n
"
,
len_numa
);
len_cache
=
0
;
relationship
=
RelationCache
;
status
=
pNtQuerySystemInformationEx
(
SystemLogicalProcessorInformationEx
,
&
relationship
,
sizeof
(
relationship
),
NULL
,
0
,
&
len_cache
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"got 0x%08x
\n
"
,
status
);
ok
(
len_cache
>
0
,
"got %u
\n
"
,
len_cache
);
len_package
=
0
;
relationship
=
RelationProcessorPackage
;
status
=
pNtQuerySystemInformationEx
(
SystemLogicalProcessorInformationEx
,
&
relationship
,
sizeof
(
relationship
),
NULL
,
0
,
&
len_package
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"got 0x%08x
\n
"
,
status
);
ok
(
len_package
>
0
,
"got %u
\n
"
,
len_package
);
len_group
=
0
;
relationship
=
RelationGroup
;
status
=
pNtQuerySystemInformationEx
(
SystemLogicalProcessorInformationEx
,
&
relationship
,
sizeof
(
relationship
),
NULL
,
0
,
&
len_group
);
ok
(
status
==
STATUS_INFO_LENGTH_MISMATCH
,
"got 0x%08x
\n
"
,
status
);
ok
(
len_group
>
0
,
"got %u
\n
"
,
len_group
);
len
2
=
0
;
ret
=
pGetLogicalProcessorInformationEx
(
RelationAll
,
NULL
,
&
len
2
);
len
_public
=
0
;
ret
=
pGetLogicalProcessorInformationEx
(
RelationAll
,
NULL
,
&
len
_public
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
ok
(
len
==
len
2
,
"got %u, expected %u
\n
"
,
len2
,
len
);
ok
(
len
==
len
_public
,
"got %u, expected %u
\n
"
,
len_public
,
len
);
if
(
len
&&
len
==
len
2
)
{
if
(
len
&&
len
==
len
_public
)
{
int
j
,
i
;
infoex
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
);
infoex2
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
);
infoex_public
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len_public
);
infoex_core
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len_core
);
infoex_numa
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len_numa
);
infoex_cache
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len_cache
);
infoex_package
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len_package
);
infoex_group
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len_group
);
relationship
=
RelationAll
;
status
=
pNtQuerySystemInformationEx
(
SystemLogicalProcessorInformationEx
,
&
relationship
,
sizeof
(
relationship
),
infoex
,
len
,
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"got 0x%08x
\n
"
,
status
);
ret
=
pGetLogicalProcessorInformationEx
(
RelationAll
,
infoex
2
,
&
len2
);
ret
=
pGetLogicalProcessorInformationEx
(
RelationAll
,
infoex
_public
,
&
len_public
);
ok
(
ret
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
ok
(
!
memcmp
(
infoex
,
infoex
2
,
len
),
"returned info data mismatch
\n
"
);
ok
(
!
memcmp
(
infoex
,
infoex
_public
,
len
),
"returned info data mismatch
\n
"
);
/* Test for RelationAll. */
for
(
i
=
0
;
status
==
STATUS_SUCCESS
&&
i
<
len
;
){
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
*
ex
=
(
void
*
)(((
char
*
)
infoex
)
+
i
);
ex
=
(
void
*
)(((
char
*
)
infoex
)
+
i
);
ok
(
ex
->
Relationship
>=
RelationProcessorCore
&&
ex
->
Relationship
<=
RelationGroup
,
"Got invalid relationship value: 0x%x
\n
"
,
ex
->
Relationship
);
if
(
!
ex
->
Size
)
{
ok
(
0
,
"got infoex[%u].Size=0
\n
"
,
i
);
...
...
@@ -791,7 +821,7 @@ static void test_query_logicalprocex(void)
switch
(
ex
->
Relationship
){
case
RelationProcessorCore
:
case
RelationProcessorPackage
:
trace
(
"infoex[%u].Relationship: 0x%x (
Core == 0x0 or Package == 0x3)
\n
"
,
i
,
ex
->
Relationship
);
trace
(
"infoex[%u].Relationship: 0x%x (
%s)
\n
"
,
i
,
ex
->
Relationship
,
ex
->
Relationship
==
RelationProcessorCore
?
"Core"
:
"Package"
);
trace
(
"infoex[%u].Processor.Flags: 0x%x
\n
"
,
i
,
ex
->
Processor
.
Flags
);
trace
(
"infoex[%u].Processor.EfficiencyClass: 0x%x
\n
"
,
i
,
ex
->
Processor
.
EfficiencyClass
);
trace
(
"infoex[%u].Processor.GroupCount: 0x%x
\n
"
,
i
,
ex
->
Processor
.
GroupCount
);
...
...
@@ -827,14 +857,110 @@ static void test_query_logicalprocex(void)
}
break
;
default:
ok
(
0
,
"Got invalid relationship value: 0x%x
\n
"
,
ex
->
Relationship
);
break
;
}
i
+=
ex
->
Size
;
}
/* Test Relationship filtering. */
relationship
=
RelationProcessorCore
;
status
=
pNtQuerySystemInformationEx
(
SystemLogicalProcessorInformationEx
,
&
relationship
,
sizeof
(
relationship
),
infoex_core
,
len_core
,
&
len_core
);
ok
(
status
==
STATUS_SUCCESS
,
"got 0x%08x
\n
"
,
status
);
for
(
i
=
0
;
status
==
STATUS_SUCCESS
&&
i
<
len_core
;)
{
ex
=
(
void
*
)(((
char
*
)
infoex_core
)
+
i
);
if
(
ex
->
Size
==
0
)
{
ok
(
0
,
"Got infoex_core[%u].Size=0
\n
"
,
i
);
break
;
}
if
(
ex
->
Relationship
!=
RelationProcessorCore
)
{
ok
(
0
,
"Expected 0x%x, got 0x%x
\n
"
,
RelationProcessorCore
,
ex
->
Relationship
);
break
;
}
i
+=
ex
->
Size
;
}
relationship
=
RelationNumaNode
;
status
=
pNtQuerySystemInformationEx
(
SystemLogicalProcessorInformationEx
,
&
relationship
,
sizeof
(
relationship
),
infoex_numa
,
len_numa
,
&
len_numa
);
ok
(
status
==
STATUS_SUCCESS
,
"got 0x%08x
\n
"
,
status
);
for
(
i
=
0
;
status
==
STATUS_SUCCESS
&&
i
<
len_numa
;)
{
ex
=
(
void
*
)(((
char
*
)
infoex_numa
)
+
i
);
if
(
ex
->
Size
==
0
)
{
ok
(
0
,
"Got infoex_numa[%u].Size=0
\n
"
,
i
);
break
;
}
if
(
ex
->
Relationship
!=
RelationNumaNode
)
{
ok
(
0
,
"Expected 0x%x, got 0x%x
\n
"
,
RelationNumaNode
,
ex
->
Relationship
);
break
;
}
i
+=
ex
->
Size
;
}
relationship
=
RelationCache
;
status
=
pNtQuerySystemInformationEx
(
SystemLogicalProcessorInformationEx
,
&
relationship
,
sizeof
(
relationship
),
infoex_cache
,
len_cache
,
&
len_cache
);
ok
(
status
==
STATUS_SUCCESS
,
"got 0x%08x
\n
"
,
status
);
for
(
i
=
0
;
status
==
STATUS_SUCCESS
&&
i
<
len_cache
;)
{
ex
=
(
void
*
)(((
char
*
)
infoex_cache
)
+
i
);
if
(
ex
->
Size
==
0
)
{
ok
(
0
,
"Got infoex_cache[%u].Size=0
\n
"
,
i
);
break
;
}
if
(
ex
->
Relationship
!=
RelationCache
)
{
ok
(
0
,
"Expected 0x%x, got 0x%x
\n
"
,
RelationCache
,
ex
->
Relationship
);
break
;
}
i
+=
ex
->
Size
;
}
relationship
=
RelationProcessorPackage
;
status
=
pNtQuerySystemInformationEx
(
SystemLogicalProcessorInformationEx
,
&
relationship
,
sizeof
(
relationship
),
infoex_package
,
len_package
,
&
len_package
);
ok
(
status
==
STATUS_SUCCESS
,
"got 0x%08x
\n
"
,
status
);
for
(
i
=
0
;
status
==
STATUS_SUCCESS
&&
i
<
len_package
;)
{
ex
=
(
void
*
)(((
char
*
)
infoex_package
)
+
i
);
if
(
ex
->
Size
==
0
)
{
ok
(
0
,
"Got infoex_package[%u].Size=0
\n
"
,
i
);
break
;
}
if
(
ex
->
Relationship
!=
RelationProcessorPackage
)
{
ok
(
0
,
"Expected 0x%x, got 0x%x
\n
"
,
RelationProcessorPackage
,
ex
->
Relationship
);
break
;
}
i
+=
ex
->
Size
;
}
relationship
=
RelationGroup
;
status
=
pNtQuerySystemInformationEx
(
SystemLogicalProcessorInformationEx
,
&
relationship
,
sizeof
(
relationship
),
infoex_group
,
len_group
,
&
len_group
);
ok
(
status
==
STATUS_SUCCESS
,
"got 0x%08x
\n
"
,
status
);
for
(
i
=
0
;
status
==
STATUS_SUCCESS
&&
i
<
len_group
;)
{
ex
=
(
void
*
)(((
char
*
)
infoex_group
)
+
i
);
if
(
ex
->
Size
==
0
)
{
ok
(
0
,
"Got infoex_group[%u].Size=0
\n
"
,
i
);
break
;
}
if
(
ex
->
Relationship
!=
RelationGroup
)
{
ok
(
0
,
"Expected 0x%x, got 0x%x
\n
"
,
RelationGroup
,
ex
->
Relationship
);
break
;
}
i
+=
ex
->
Size
;
}
len_union
=
len_core
+
len_numa
+
len_cache
+
len_package
+
len_group
;
ok
(
len
==
len_union
,
"Expected 0x%x, got 0x%0x
\n
"
,
len
,
len_union
);
HeapFree
(
GetProcessHeap
(),
0
,
infoex
);
HeapFree
(
GetProcessHeap
(),
0
,
infoex2
);
HeapFree
(
GetProcessHeap
(),
0
,
infoex_public
);
HeapFree
(
GetProcessHeap
(),
0
,
infoex_core
);
HeapFree
(
GetProcessHeap
(),
0
,
infoex_numa
);
HeapFree
(
GetProcessHeap
(),
0
,
infoex_cache
);
HeapFree
(
GetProcessHeap
(),
0
,
infoex_package
);
HeapFree
(
GetProcessHeap
(),
0
,
infoex_group
);
}
}
...
...
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