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
b09582a8
Commit
b09582a8
authored
Sep 27, 2005
by
Eric Pouech
Committed by
Alexandre Julliard
Sep 27, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented kernel32 process affinity handling on top on ntdll.
parent
c99a3faf
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
32 deletions
+41
-32
process.c
dlls/kernel/process.c
+23
-21
process.c
dlls/ntdll/process.c
+12
-1
winbase.h
include/winbase.h
+1
-1
server_protocol.h
include/wine/server_protocol.h
+2
-3
process.c
server/process.c
+1
-2
protocol.def
server/protocol.def
+1
-2
trace.c
server/trace.c
+1
-2
No files found.
dlls/kernel/process.c
View file @
b09582a8
...
...
@@ -2676,16 +2676,16 @@ DWORD WINAPI GetPriorityClass(HANDLE hProcess)
*/
BOOL
WINAPI
SetProcessAffinityMask
(
HANDLE
hProcess
,
DWORD_PTR
affmask
)
{
BOOL
ret
;
SERVER_START_REQ
(
set_process_info
)
NTSTATUS
status
;
status
=
NtSetInformationProcess
(
hProcess
,
ProcessAffinityMask
,
&
affmask
,
sizeof
(
DWORD_PTR
));
if
(
!
status
)
{
req
->
handle
=
hProcess
;
req
->
affinity
=
affmask
;
req
->
mask
=
SET_PROCESS_INFO_AFFINITY
;
ret
=
!
wine_server_call_err
(
req
);
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
FALSE
;
}
SERVER_END_REQ
;
return
ret
;
return
TRUE
;
}
...
...
@@ -2693,22 +2693,24 @@ BOOL WINAPI SetProcessAffinityMask( HANDLE hProcess, DWORD_PTR affmask )
* GetProcessAffinityMask (KERNEL32.@)
*/
BOOL
WINAPI
GetProcessAffinityMask
(
HANDLE
hProcess
,
LPDWORD
lpProcessAffinityMask
,
LPDWORD
lpSystemAffinityMask
)
PDWORD_PTR
lpProcessAffinityMask
,
PDWORD_PTR
lpSystemAffinityMask
)
{
BOOL
ret
=
FALSE
;
SERVER_START_REQ
(
get_process_info
)
{
req
->
handle
=
hProcess
;
if
(
!
wine_server_call_err
(
req
))
PROCESS_BASIC_INFORMATION
pbi
;
NTSTATUS
status
;
status
=
NtQueryInformationProcess
(
hProcess
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
if
(
status
)
{
if
(
lpProcessAffinityMask
)
*
lpProcessAffinityMask
=
reply
->
process_affinity
;
if
(
lpSystemAffinityMask
)
*
lpSystemAffinityMask
=
reply
->
system_affinity
;
ret
=
TRUE
;
}
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
FALSE
;
}
SERVER_END_REQ
;
return
ret
;
if
(
lpProcessAffinityMask
)
*
lpProcessAffinityMask
=
pbi
.
AffinityMask
;
/* FIXME */
if
(
lpSystemAffinityMask
)
*
lpSystemAffinityMask
=
1
;
return
TRUE
;
}
...
...
dlls/ntdll/process.c
View file @
b09582a8
...
...
@@ -143,7 +143,7 @@ NTSTATUS WINAPI NtQueryInformationProcess(
{
pbi
.
ExitStatus
=
reply
->
exit_code
;
pbi
.
PebBaseAddress
=
(
DWORD
)
reply
->
peb
;
pbi
.
AffinityMask
=
reply
->
process_
affinity
;
pbi
.
AffinityMask
=
reply
->
affinity
;
pbi
.
BasePriority
=
reply
->
priority
;
pbi
.
UniqueProcessId
=
reply
->
pid
;
pbi
.
InheritedFromUniqueProcessId
=
reply
->
ppid
;
...
...
@@ -306,6 +306,17 @@ NTSTATUS WINAPI NtSetInformationProcess(
switch
(
ProcessInformationClass
)
{
case
ProcessAffinityMask
:
if
(
ProcessInformationLength
!=
sizeof
(
DWORD_PTR
))
return
STATUS_INVALID_PARAMETER
;
SERVER_START_REQ
(
set_process_info
)
{
req
->
handle
=
ProcessHandle
;
req
->
affinity
=
*
(
PDWORD_PTR
)
ProcessInformation
;
req
->
mask
=
SET_PROCESS_INFO_AFFINITY
;
ret
=
wine_server_call
(
req
);
}
SERVER_END_REQ
;
break
;
case
ProcessPriorityClass
:
if
(
ProcessInformationLength
!=
sizeof
(
PROCESS_PRIORITY_CLASS
))
return
STATUS_INVALID_PARAMETER
;
...
...
include/winbase.h
View file @
b09582a8
...
...
@@ -1559,7 +1559,7 @@ BOOL WINAPI GetPrivateProfileStructA(LPCSTR,LPCSTR,LPVOID,UINT,LPCSTR);
BOOL
WINAPI
GetPrivateProfileStructW
(
LPCWSTR
,
LPCWSTR
,
LPVOID
,
UINT
,
LPCWSTR
);
#define GetPrivateProfileStruct WINELIB_NAME_AW(GetPrivateProfileStruct)
FARPROC
WINAPI
GetProcAddress
(
HMODULE
,
LPCSTR
);
BOOL
WINAPI
GetProcessAffinityMask
(
HANDLE
,
PDWORD
,
PDWORD
);
BOOL
WINAPI
GetProcessAffinityMask
(
HANDLE
,
PDWORD
_PTR
,
PDWORD_PTR
);
DWORD
WINAPI
GetProcessHeaps
(
DWORD
,
PHANDLE
);
DWORD
WINAPI
GetProcessId
(
HANDLE
);
BOOL
WINAPI
GetProcessIoCounters
(
HANDLE
,
PIO_COUNTERS
);
...
...
include/wine/server_protocol.h
View file @
b09582a8
...
...
@@ -339,8 +339,7 @@ struct get_process_info_reply
process_id_t
ppid
;
int
exit_code
;
int
priority
;
int
process_affinity
;
int
system_affinity
;
int
affinity
;
void
*
peb
;
};
...
...
@@ -4207,6 +4206,6 @@ union generic_reply
struct
set_mailslot_info_reply
set_mailslot_info_reply
;
};
#define SERVER_PROTOCOL_VERSION 19
3
#define SERVER_PROTOCOL_VERSION 19
4
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/process.c
View file @
b09582a8
...
...
@@ -1034,8 +1034,7 @@ DECL_HANDLER(get_process_info)
reply
->
ppid
=
process
->
parent
?
get_process_id
(
process
->
parent
)
:
0
;
reply
->
exit_code
=
process
->
exit_code
;
reply
->
priority
=
process
->
priority
;
reply
->
process_affinity
=
process
->
affinity
;
reply
->
system_affinity
=
1
;
reply
->
affinity
=
process
->
affinity
;
reply
->
peb
=
process
->
peb
;
release_object
(
process
);
}
...
...
server/protocol.def
View file @
b09582a8
...
...
@@ -309,8 +309,7 @@ struct security_descriptor
process_id_t ppid; /* server process id of parent */
int exit_code; /* process exit code */
int priority; /* priority class */
int process_affinity; /* process affinity mask */
int system_affinity; /* system affinity mask */
int affinity; /* process affinity mask */
void* peb; /* PEB address in process address space */
@END
...
...
server/trace.c
View file @
b09582a8
...
...
@@ -699,8 +699,7 @@ static void dump_get_process_info_reply( const struct get_process_info_reply *re
fprintf
(
stderr
,
" ppid=%04x,"
,
req
->
ppid
);
fprintf
(
stderr
,
" exit_code=%d,"
,
req
->
exit_code
);
fprintf
(
stderr
,
" priority=%d,"
,
req
->
priority
);
fprintf
(
stderr
,
" process_affinity=%d,"
,
req
->
process_affinity
);
fprintf
(
stderr
,
" system_affinity=%d,"
,
req
->
system_affinity
);
fprintf
(
stderr
,
" affinity=%d,"
,
req
->
affinity
);
fprintf
(
stderr
,
" peb=%p"
,
req
->
peb
);
}
...
...
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