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
b3badc7d
Commit
b3badc7d
authored
Sep 06, 2005
by
Eric Pouech
Committed by
Alexandre Julliard
Sep 06, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- rewrite kernel32:{Set|Get}PriorityClass on top of ntdll equivalent
- priority for process in wineserver is now the NTDLL form (no longer the kernel32 one)
parent
1228ce26
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
17 deletions
+108
-17
process.c
dlls/kernel/process.c
+45
-10
toolhelp.c
dlls/kernel/toolhelp.c
+19
-1
process.c
dlls/ntdll/process.c
+30
-3
winternl.h
include/winternl.h
+12
-0
process.c
server/process.c
+2
-3
No files found.
dlls/kernel/process.c
View file @
b3badc7d
...
...
@@ -2607,16 +2607,38 @@ HANDLE WINAPI CreateSocketHandle(void)
*/
BOOL
WINAPI
SetPriorityClass
(
HANDLE
hprocess
,
DWORD
priorityclass
)
{
BOOL
ret
;
SERVER_START_REQ
(
set_process_info
)
NTSTATUS
status
;
PROCESS_PRIORITY_CLASS
ppc
;
ppc
.
Foreground
=
FALSE
;
switch
(
priorityclass
)
{
case
IDLE_PRIORITY_CLASS
:
ppc
.
PriorityClass
=
PROCESS_PRIOCLASS_IDLE
;
break
;
case
BELOW_NORMAL_PRIORITY_CLASS
:
ppc
.
PriorityClass
=
PROCESS_PRIOCLASS_BELOW_NORMAL
;
break
;
case
NORMAL_PRIORITY_CLASS
:
ppc
.
PriorityClass
=
PROCESS_PRIOCLASS_NORMAL
;
break
;
case
ABOVE_NORMAL_PRIORITY_CLASS
:
ppc
.
PriorityClass
=
PROCESS_PRIOCLASS_ABOVE_NORMAL
;
break
;
case
HIGH_PRIORITY_CLASS
:
ppc
.
PriorityClass
=
PROCESS_PRIOCLASS_HIGH
;
break
;
case
REALTIME_PRIORITY_CLASS
:
ppc
.
PriorityClass
=
PROCESS_PRIOCLASS_REALTIME
;
break
;
default:
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
status
=
NtSetInformationProcess
(
hprocess
,
ProcessPriorityClass
,
&
ppc
,
sizeof
(
ppc
));
if
(
status
!=
STATUS_SUCCESS
)
{
req
->
handle
=
hprocess
;
req
->
priority
=
priorityclass
;
req
->
mask
=
SET_PROCESS_INFO_PRIORITY
;
ret
=
!
wine_server_call_err
(
req
);
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
FALSE
;
}
SERVER_END_REQ
;
return
ret
;
return
TRUE
;
}
...
...
@@ -2630,8 +2652,21 @@ DWORD WINAPI GetPriorityClass(HANDLE hProcess)
status
=
NtQueryInformationProcess
(
hProcess
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
if
(
status
==
STATUS_SUCCESS
)
return
pbi
.
BasePriority
;
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
if
(
status
!=
STATUS_SUCCESS
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
0
;
}
switch
(
pbi
.
BasePriority
)
{
case
PROCESS_PRIOCLASS_IDLE
:
return
IDLE_PRIORITY_CLASS
;
case
PROCESS_PRIOCLASS_BELOW_NORMAL
:
return
BELOW_NORMAL_PRIORITY_CLASS
;
case
PROCESS_PRIOCLASS_NORMAL
:
return
NORMAL_PRIORITY_CLASS
;
case
PROCESS_PRIOCLASS_ABOVE_NORMAL
:
return
ABOVE_NORMAL_PRIORITY_CLASS
;
case
PROCESS_PRIOCLASS_HIGH
:
return
HIGH_PRIORITY_CLASS
;
case
PROCESS_PRIOCLASS_REALTIME
:
return
REALTIME_PRIORITY_CLASS
;
}
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
...
...
dlls/kernel/toolhelp.c
View file @
b3badc7d
...
...
@@ -160,7 +160,25 @@ static BOOL TOOLHELP_Process32Next( HANDLE handle, LPPROCESSENTRY32W lppe, BOOL
lppe
->
th32ModuleID
=
(
DWORD
)
reply
->
module
;
lppe
->
cntThreads
=
reply
->
threads
;
lppe
->
th32ParentProcessID
=
reply
->
ppid
;
lppe
->
pcPriClassBase
=
reply
->
priority
;
switch
(
reply
->
priority
)
{
case
PROCESS_PRIOCLASS_IDLE
:
lppe
->
pcPriClassBase
=
IDLE_PRIORITY_CLASS
;
break
;
case
PROCESS_PRIOCLASS_BELOW_NORMAL
:
lppe
->
pcPriClassBase
=
BELOW_NORMAL_PRIORITY_CLASS
;
break
;
case
PROCESS_PRIOCLASS_NORMAL
:
lppe
->
pcPriClassBase
=
NORMAL_PRIORITY_CLASS
;
break
;
case
PROCESS_PRIOCLASS_ABOVE_NORMAL
:
lppe
->
pcPriClassBase
=
ABOVE_NORMAL_PRIORITY_CLASS
;
break
;
case
PROCESS_PRIOCLASS_HIGH
:
lppe
->
pcPriClassBase
=
HIGH_PRIORITY_CLASS
;
break
;
case
PROCESS_PRIOCLASS_REALTIME
:
lppe
->
pcPriClassBase
=
REALTIME_PRIORITY_CLASS
;
break
;
default:
FIXME
(
"Unknown NT priority class %d, setting to normal
\n
"
,
reply
->
priority
);
lppe
->
pcPriClassBase
=
NORMAL_PRIORITY_CLASS
;
break
;
}
lppe
->
dwFlags
=
-
1
;
/* FIXME */
if
(
unicode
)
{
...
...
dlls/ntdll/process.c
View file @
b3badc7d
...
...
@@ -302,9 +302,36 @@ NTSTATUS WINAPI NtSetInformationProcess(
IN
PVOID
ProcessInformation
,
IN
ULONG
ProcessInformationLength
)
{
FIXME
(
"(%p,0x%08x,%p,0x%08lx) stub
\n
"
,
ProcessHandle
,
ProcessInformationClass
,
ProcessInformation
,
ProcessInformationLength
);
return
0
;
NTSTATUS
ret
=
STATUS_SUCCESS
;
switch
(
ProcessInformationClass
)
{
case
ProcessPriorityClass
:
if
(
ProcessInformationLength
!=
sizeof
(
PROCESS_PRIORITY_CLASS
))
return
STATUS_INVALID_PARAMETER
;
else
{
PROCESS_PRIORITY_CLASS
*
ppc
=
ProcessInformation
;
SERVER_START_REQ
(
set_process_info
)
{
req
->
handle
=
ProcessHandle
;
/* FIXME Foreground isn't used */
req
->
priority
=
ppc
->
PriorityClass
;
req
->
mask
=
SET_PROCESS_INFO_PRIORITY
;
ret
=
wine_server_call
(
req
);
}
SERVER_END_REQ
;
}
break
;
default:
FIXME
(
"(%p,0x%08x,%p,0x%08lx) stub
\n
"
,
ProcessHandle
,
ProcessInformationClass
,
ProcessInformation
,
ProcessInformationLength
);
ret
=
STATUS_NOT_IMPLEMENTED
;
break
;
}
return
ret
;
}
/******************************************************************************
...
...
include/winternl.h
View file @
b3badc7d
...
...
@@ -932,6 +932,18 @@ typedef struct _PROCESS_BASIC_INFORMATION {
#endif
}
PROCESS_BASIC_INFORMATION
,
*
PPROCESS_BASIC_INFORMATION
;
#define PROCESS_PRIOCLASS_IDLE 1
#define PROCESS_PRIOCLASS_NORMAL 2
#define PROCESS_PRIOCLASS_HIGH 3
#define PROCESS_PRIOCLASS_REALTIME 4
#define PROCESS_PRIOCLASS_BELOW_NORMAL 5
#define PROCESS_PRIOCLASS_ABOVE_NORMAL 6
typedef
struct
_PROCESS_PRIORITY_CLASS
{
BOOLEAN
Foreground
;
UCHAR
PriorityClass
;
}
PROCESS_PRIORITY_CLASS
,
*
PPROCESS_PRIORITY_CLASS
;
typedef
struct
_RTL_HEAP_DEFINITION
{
ULONG
Length
;
/* = sizeof(RTL_HEAP_DEFINITION) */
...
...
server/process.c
View file @
b3badc7d
...
...
@@ -37,8 +37,7 @@
#include <poll.h>
#endif
#include "windef.h"
#include "winnt.h"
#include "winternl.h"
#include "file.h"
#include "handle.h"
...
...
@@ -233,7 +232,7 @@ struct thread *create_process( int fd )
process
->
msg_fd
=
NULL
;
process
->
exit_code
=
STILL_ACTIVE
;
process
->
running_threads
=
0
;
process
->
priority
=
NORMAL_PRIORITY_CLASS
;
process
->
priority
=
PROCESS_PRIOCLASS_NORMAL
;
process
->
affinity
=
1
;
process
->
suspend
=
0
;
process
->
create_flags
=
0
;
...
...
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