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
9c09288b
Commit
9c09288b
authored
Nov 21, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Remove workarounds for SetThreadIdealProcessor().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
421b3867
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
37 deletions
+25
-37
thread.c
dlls/kernel32/tests/thread.c
+25
-37
No files found.
dlls/kernel32/tests/thread.c
View file @
9c09288b
...
...
@@ -79,7 +79,6 @@ static void (WINAPI *pGetCurrentThreadStackLimits)(PULONG_PTR,PULONG_PTR);
static
BOOL
(
WINAPI
*
pGetThreadPriorityBoost
)(
HANDLE
,
PBOOL
);
static
HANDLE
(
WINAPI
*
pOpenThread
)(
DWORD
,
BOOL
,
DWORD
);
static
BOOL
(
WINAPI
*
pQueueUserWorkItem
)(
LPTHREAD_START_ROUTINE
,
PVOID
,
ULONG
);
static
DWORD
(
WINAPI
*
pSetThreadIdealProcessor
)(
HANDLE
,
DWORD
);
static
BOOL
(
WINAPI
*
pSetThreadPriorityBoost
)(
HANDLE
,
BOOL
);
static
BOOL
(
WINAPI
*
pSetThreadStackGuarantee
)(
ULONG
*
);
static
BOOL
(
WINAPI
*
pRegisterWaitForSingleObject
)(
PHANDLE
,
HANDLE
,
WAITORTIMERCALLBACK
,
PVOID
,
ULONG
,
ULONG
);
...
...
@@ -854,8 +853,8 @@ static VOID test_thread_processor(void)
HANDLE
curthread
,
curproc
;
DWORD_PTR
processMask
,
systemMask
,
retMask
;
SYSTEM_INFO
sysInfo
;
int
error
=
0
;
BOOL
is_wow64
;
DWORD
ret
;
if
(
!
pIsWow64Process
||
!
pIsWow64Process
(
GetCurrentProcess
(),
&
is_wow64
))
is_wow64
=
FALSE
;
...
...
@@ -896,44 +895,34 @@ static VOID test_thread_processor(void)
retMask
=
SetThreadAffinityMask
(
curthread
,
~
(
ULONG_PTR
)
0
>>
3
);
ok
(
retMask
==
processMask
,
"SetThreadAffinityMask failed
\n
"
);
}
/* NOTE: This only works on WinNT/2000/XP) */
if
(
pSetThreadIdealProcessor
)
SetLastError
(
0xdeadbeef
);
ret
=
SetThreadIdealProcessor
(
GetCurrentThread
(),
0
);
ok
(
ret
!=
~
0u
,
"Unexpected return value %lu.
\n
"
,
ret
);
if
(
is_wow64
)
{
SetLastError
(
0xdeadbeef
);
error
=
pSetThreadIdealProcessor
(
curthread
,
0
);
if
(
GetLastError
()
!=
ERROR_CALL_NOT_IMPLEMENTED
)
{
ok
(
error
!=-
1
,
"SetThreadIdealProcessor failed
\n
"
);
if
(
is_wow64
)
{
SetLastError
(
0xdeadbeef
);
error
=
pSetThreadIdealProcessor
(
curthread
,
MAXIMUM_PROCESSORS
+
1
);
todo_wine
ok
(
error
!=-
1
,
"SetThreadIdealProcessor failed for %u on Wow64
\n
"
,
MAXIMUM_PROCESSORS
+
1
);
SetLastError
(
0xdeadbeef
);
error
=
pSetThreadIdealProcessor
(
curthread
,
65
);
ok
(
error
==-
1
,
"SetThreadIdealProcessor succeeded with an illegal processor #
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
GetLastError
());
}
else
{
SetLastError
(
0xdeadbeef
);
error
=
pSetThreadIdealProcessor
(
curthread
,
MAXIMUM_PROCESSORS
+
1
);
ok
(
error
==-
1
,
"SetThreadIdealProcessor succeeded with an illegal processor #
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
GetLastError
());
}
error
=
pSetThreadIdealProcessor
(
curthread
,
MAXIMUM_PROCESSORS
);
ok
(
error
!=-
1
,
"SetThreadIdealProcessor failed
\n
"
);
}
else
win_skip
(
"SetThreadIdealProcessor is not implemented
\n
"
);
ret
=
SetThreadIdealProcessor
(
GetCurrentThread
(),
MAXIMUM_PROCESSORS
+
1
);
todo_wine
ok
(
ret
!=
~
0u
,
"Unexpected return value %lu.
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
SetThreadIdealProcessor
(
GetCurrentThread
(),
65
);
ok
(
ret
==
~
0u
,
"Unexpected return value %lu.
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Unexpected error %ld.
\n
"
,
GetLastError
());
}
else
{
SetLastError
(
0xdeadbeef
);
ret
=
SetThreadIdealProcessor
(
GetCurrentThread
(),
MAXIMUM_PROCESSORS
+
1
);
ok
(
ret
==
~
0u
,
"Unexpected return value %lu.
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Unexpected error %ld.
\n
"
,
GetLastError
());
}
ret
=
SetThreadIdealProcessor
(
GetCurrentThread
(),
MAXIMUM_PROCESSORS
);
ok
(
ret
!=
~
0u
,
"Unexpected return value %lu.
\n
"
,
ret
);
if
(
pGetThreadGroupAffinity
&&
pSetThreadGroupAffinity
)
{
GROUP_AFFINITY
affinity
,
affinity_new
;
...
...
@@ -2583,7 +2572,6 @@ static void init_funcs(void)
X
(
GetThreadPriorityBoost
);
X
(
OpenThread
);
X
(
QueueUserWorkItem
);
X
(
SetThreadIdealProcessor
);
X
(
SetThreadPriorityBoost
);
X
(
SetThreadStackGuarantee
);
X
(
RegisterWaitForSingleObject
);
...
...
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