Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
67637420
Commit
67637420
authored
17 years ago
by
Matt Jones
Committed by
Alexandre Julliard
17 years ago
Browse files
Options
Downloads
Patches
Plain Diff
server: Only commit SetThreadPriority if new priority is correct.
parent
f204ed1d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/kernel32/tests/thread.c
+10
-14
10 additions, 14 deletions
dlls/kernel32/tests/thread.c
server/thread.c
+18
-1
18 additions, 1 deletion
server/thread.c
with
28 additions
and
15 deletions
dlls/kernel32/tests/thread.c
+
10
−
14
View file @
67637420
...
...
@@ -594,25 +594,21 @@ static VOID test_thread_priority(void)
SetLastError
(
0xdeadbeef
);
rc
=
SetThreadPriority
(
curthread
,
min_priority
-
1
);
todo_wine
{
ok
(
rc
==
FALSE
,
"SetThreadPriority passed with a bad argument
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"SetThreadPriority error %d, expected ERROR_INVALID_PARAMETER (87)
\n
"
,
GetLastError
());
ok
(
GetThreadPriority
(
curthread
)
==
min_priority
,
"GetThreadPriority didn't return min_priority
\n
"
);
}
ok
(
rc
==
FALSE
,
"SetThreadPriority passed with a bad argument
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"SetThreadPriority error %d, expected ERROR_INVALID_PARAMETER (87)
\n
"
,
GetLastError
());
ok
(
GetThreadPriority
(
curthread
)
==
min_priority
,
"GetThreadPriority didn't return min_priority
\n
"
);
SetThreadPriority
(
curthread
,
max_priority
);
SetLastError
(
0xdeadbeef
);
rc
=
SetThreadPriority
(
curthread
,
max_priority
+
1
);
todo_wine
{
ok
(
rc
==
FALSE
,
"SetThreadPriority passed with a bad argument
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"SetThreadPriority error %d, expected ERROR_INVALID_PARAMETER (87)
\n
"
,
GetLastError
());
ok
(
GetThreadPriority
(
curthread
)
==
max_priority
,
"GetThreadPriority didn't return max_priority
\n
"
);
}
ok
(
rc
==
FALSE
,
"SetThreadPriority passed with a bad argument
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"SetThreadPriority error %d, expected ERROR_INVALID_PARAMETER (87)
\n
"
,
GetLastError
());
ok
(
GetThreadPriority
(
curthread
)
==
max_priority
,
"GetThreadPriority didn't return max_priority
\n
"
);
/* Check thread priority boost */
if
(
!
pGetThreadPriorityBoost
||
!
pSetThreadPriorityBoost
)
...
...
This diff is collapsed.
Click to expand it.
server/thread.c
+
18
−
1
View file @
67637420
...
...
@@ -383,12 +383,29 @@ struct thread *get_thread_from_pid( int pid )
return
NULL
;
}
#define THREAD_PRIORITY_REALTIME_HIGHEST 6
#define THREAD_PRIORITY_REALTIME_LOWEST -7
/* set all information about a thread */
static
void
set_thread_info
(
struct
thread
*
thread
,
const
struct
set_thread_info_request
*
req
)
{
if
(
req
->
mask
&
SET_THREAD_INFO_PRIORITY
)
thread
->
priority
=
req
->
priority
;
{
int
max
=
THREAD_PRIORITY_HIGHEST
;
int
min
=
THREAD_PRIORITY_LOWEST
;
if
(
thread
->
process
->
priority
==
PROCESS_PRIOCLASS_REALTIME
)
{
max
=
THREAD_PRIORITY_REALTIME_HIGHEST
;
min
=
THREAD_PRIORITY_REALTIME_LOWEST
;
}
if
((
req
->
priority
>=
min
&&
req
->
priority
<=
max
)
||
req
->
priority
==
THREAD_PRIORITY_IDLE
||
req
->
priority
==
THREAD_PRIORITY_TIME_CRITICAL
)
thread
->
priority
=
req
->
priority
;
else
set_error
(
STATUS_INVALID_PARAMETER
);
}
if
(
req
->
mask
&
SET_THREAD_INFO_AFFINITY
)
{
if
(
req
->
affinity
!=
1
)
set_error
(
STATUS_INVALID_PARAMETER
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment