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
2e8de49e
Commit
2e8de49e
authored
Sep 29, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Retrieve the number of processors through GetSystemInfo.
parent
a6414c26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
info.c
dlls/ntdll/tests/info.c
+9
-7
No files found.
dlls/ntdll/tests/info.c
View file @
2e8de49e
...
...
@@ -896,12 +896,14 @@ static void test_affinity(void)
PROCESS_BASIC_INFORMATION
pbi
;
DWORD_PTR
proc_affinity
,
thread_affinity
;
THREAD_BASIC_INFORMATION
tbi
;
SYSTEM_INFO
si
;
GetSystemInfo
(
&
si
);
status
=
pNtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
proc_affinity
=
(
DWORD_PTR
)
pbi
.
Reserved2
[
0
];
ok
(
proc_affinity
==
(
1
<<
NtCurrentTeb
()
->
Peb
->
NumberOfProcessors
)
-
1
,
"Unexpected process affinity
\n
"
);
proc_affinity
=
1
<<
NtCurrentTeb
()
->
Peb
->
NumberOfProcessors
;
ok
(
proc_affinity
==
(
1
<<
si
.
dw
NumberOfProcessors
)
-
1
,
"Unexpected process affinity
\n
"
);
proc_affinity
=
1
<<
si
.
dw
NumberOfProcessors
;
status
=
pNtSetInformationProcess
(
GetCurrentProcess
(),
ProcessAffinityMask
,
&
proc_affinity
,
sizeof
(
proc_affinity
)
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Expected STATUS_INVALID_PARAMETER, got %08x
\n
"
,
status
);
...
...
@@ -913,8 +915,8 @@ static void test_affinity(void)
status
=
pNtQueryInformationThread
(
GetCurrentThread
(),
ThreadBasicInformation
,
&
tbi
,
sizeof
(
tbi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
tbi
.
AffinityMask
==
(
1
<<
NtCurrentTeb
()
->
Peb
->
NumberOfProcessors
)
-
1
,
"Unexpected thread affinity
\n
"
);
thread_affinity
=
1
<<
NtCurrentTeb
()
->
Peb
->
NumberOfProcessors
;
ok
(
tbi
.
AffinityMask
==
(
1
<<
si
.
dw
NumberOfProcessors
)
-
1
,
"Unexpected thread affinity
\n
"
);
thread_affinity
=
1
<<
si
.
dw
NumberOfProcessors
;
status
=
pNtSetInformationThread
(
GetCurrentThread
(),
ThreadAffinityMask
,
&
thread_affinity
,
sizeof
(
thread_affinity
)
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Expected STATUS_INVALID_PARAMETER, got %08x
\n
"
,
status
);
...
...
@@ -929,7 +931,7 @@ static void test_affinity(void)
status
=
pNtQueryInformationThread
(
GetCurrentThread
(),
ThreadBasicInformation
,
&
tbi
,
sizeof
(
tbi
),
NULL
);
ok
(
tbi
.
AffinityMask
==
1
,
"Unexpected thread affinity
\n
"
);
if
(
NtCurrentTeb
()
->
Peb
->
NumberOfProcessors
<=
1
)
if
(
si
.
dw
NumberOfProcessors
<=
1
)
{
skip
(
"only one processor, skipping affinity testing
\n
"
);
return
;
...
...
@@ -947,14 +949,14 @@ static void test_affinity(void)
todo_wine
ok
(
tbi
.
AffinityMask
==
2
,
"Unexpected thread affinity
\n
"
);
proc_affinity
=
(
1
<<
NtCurrentTeb
()
->
Peb
->
NumberOfProcessors
)
-
1
;
proc_affinity
=
(
1
<<
si
.
dw
NumberOfProcessors
)
-
1
;
status
=
pNtSetInformationProcess
(
GetCurrentProcess
(),
ProcessAffinityMask
,
&
proc_affinity
,
sizeof
(
proc_affinity
)
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
/* Resetting the process affinity also resets the thread affinity */
status
=
pNtQueryInformationThread
(
GetCurrentThread
(),
ThreadBasicInformation
,
&
tbi
,
sizeof
(
tbi
),
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
todo_wine
ok
(
tbi
.
AffinityMask
==
(
1
<<
NtCurrentTeb
()
->
Peb
->
NumberOfProcessors
)
-
1
,
ok
(
tbi
.
AffinityMask
==
(
1
<<
si
.
dw
NumberOfProcessors
)
-
1
,
"Unexpected thread affinity"
);
}
...
...
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