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
b0fd2ade
Commit
b0fd2ade
authored
Jun 14, 2004
by
Eric Pouech
Committed by
Alexandre Julliard
Jun 14, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added ProcessBasicInformation class to ntdll.NtQueryInformationProcess.
- Make use of it in kernel32.
parent
552b06a0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
28 deletions
+60
-28
process.c
dlls/kernel/process.c
+28
-25
process.c
dlls/ntdll/process.c
+22
-1
server_protocol.h
include/wine/server_protocol.h
+3
-1
process.c
server/process.c
+2
-0
protocol.def
server/protocol.def
+2
-0
trace.c
server/trace.c
+3
-1
No files found.
dlls/kernel/process.c
View file @
b0fd2ade
...
...
@@ -2079,15 +2079,18 @@ BOOL WINAPI GetExitCodeProcess(
HANDLE
hProcess
,
/* [in] handle to the process */
LPDWORD
lpExitCode
)
/* [out] address to receive termination status */
{
BOOL
ret
;
SERVER_START_REQ
(
get_process_info
)
NTSTATUS
status
;
PROCESS_BASIC_INFORMATION
pbi
;
status
=
NtQueryInformationProcess
(
hProcess
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
if
(
status
==
STATUS_SUCCESS
)
{
req
->
handle
=
hProcess
;
ret
=
!
wine_server_call_err
(
req
);
if
(
ret
&&
lpExitCode
)
*
lpExitCode
=
reply
->
exit_code
;
if
(
lpExitCode
)
*
lpExitCode
=
pbi
.
ExitStatus
;
return
TRUE
;
}
S
ERVER_END_REQ
;
return
ret
;
S
etLastError
(
RtlNtStatusToDosError
(
status
)
)
;
return
FALSE
;
}
...
...
@@ -2357,16 +2360,16 @@ HANDLE WINAPI OpenProcess( DWORD access, BOOL inherit, DWORD id )
/*********************************************************************
* MapProcessHandle (KERNEL.483)
*/
DWORD
WINAPI
MapProcessHandle
(
HANDLE
h
andle
)
DWORD
WINAPI
MapProcessHandle
(
HANDLE
h
Process
)
{
DWORD
ret
=
0
;
SERVER_START_REQ
(
get_process_info
)
{
req
->
handle
=
handle
;
if
(
!
wine_server_call_err
(
req
))
ret
=
reply
->
pid
;
}
S
ERVER_END_REQ
;
return
ret
;
NTSTATUS
status
;
PROCESS_BASIC_INFORMATION
pbi
;
status
=
NtQueryInformationProcess
(
hProcess
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
)
;
if
(
status
==
STATUS_SUCCESS
)
return
pbi
.
UniqueProcessId
;
S
etLastError
(
RtlNtStatusToDosError
(
status
)
)
;
return
0
;
}
...
...
@@ -2530,16 +2533,16 @@ BOOL WINAPI SetPriorityClass( HANDLE hprocess, DWORD priorityclass )
/***********************************************************************
* GetPriorityClass (KERNEL32.@)
*/
DWORD
WINAPI
GetPriorityClass
(
HANDLE
h
p
rocess
)
DWORD
WINAPI
GetPriorityClass
(
HANDLE
h
P
rocess
)
{
DWORD
ret
=
0
;
SERVER_START_REQ
(
get_process_info
)
{
req
->
handle
=
hprocess
;
if
(
!
wine_server_call_err
(
req
))
ret
=
reply
->
priority
;
}
S
ERVER_END_REQ
;
return
ret
;
NTSTATUS
status
;
PROCESS_BASIC_INFORMATION
pbi
;
status
=
NtQueryInformationProcess
(
hProcess
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
)
;
if
(
status
==
STATUS_SUCCESS
)
return
pbi
.
BasePriority
;
S
etLastError
(
RtlNtStatusToDosError
(
status
)
)
;
return
0
;
}
...
...
dlls/ntdll/process.c
View file @
b0fd2ade
...
...
@@ -79,6 +79,27 @@ NTSTATUS WINAPI NtQueryInformationProcess(
switch
(
ProcessInformationClass
)
{
case
ProcessBasicInformation
:
if
(
ProcessInformationLength
==
sizeof
(
PROCESS_BASIC_INFORMATION
))
{
SERVER_START_REQ
(
get_process_info
)
{
req
->
handle
=
ProcessHandle
;
if
((
ret
=
wine_server_call
(
req
))
==
STATUS_SUCCESS
)
{
PROCESS_BASIC_INFORMATION
*
pbi
=
(
PROCESS_BASIC_INFORMATION
*
)
ProcessInformation
;
pbi
->
ExitStatus
=
reply
->
exit_code
;
pbi
->
PebBaseAddress
=
(
DWORD
)
reply
->
peb
;
pbi
->
AffinityMask
=
reply
->
process_affinity
;
pbi
->
BasePriority
=
reply
->
priority
;
pbi
->
UniqueProcessId
=
reply
->
pid
;
pbi
->
InheritedFromUniqueProcessId
=
reply
->
ppid
;
}
}
SERVER_END_REQ
;
}
else
ret
=
STATUS_INFO_LENGTH_MISMATCH
;
break
;
case
ProcessIoCounters
:
if
(
ProcessInformationLength
==
sizeof
(
IO_COUNTERS
))
{
...
...
@@ -92,7 +113,7 @@ NTSTATUS WINAPI NtQueryInformationProcess(
* set it to 0 aka "no debugger" to satisfy copy protections */
if
(
ProcessInformationLength
==
4
)
{
memset
(
ProcessInformation
,
0
,
ProcessInformationLength
);
memset
(
ProcessInformation
,
0
,
ProcessInformationLength
);
len
=
4
;
}
else
ret
=
STATUS_INFO_LENGTH_MISMATCH
;
...
...
include/wine/server_protocol.h
View file @
b0fd2ade
...
...
@@ -342,10 +342,12 @@ struct get_process_info_reply
{
struct
reply_header
__header
;
process_id_t
pid
;
process_id_t
ppid
;
int
exit_code
;
int
priority
;
int
process_affinity
;
int
system_affinity
;
void
*
peb
;
};
...
...
@@ -3572,6 +3574,6 @@ union generic_reply
struct
set_global_windows_reply
set_global_windows_reply
;
};
#define SERVER_PROTOCOL_VERSION 14
2
#define SERVER_PROTOCOL_VERSION 14
3
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/process.c
View file @
b0fd2ade
...
...
@@ -1043,10 +1043,12 @@ DECL_HANDLER(get_process_info)
if
((
process
=
get_process_from_handle
(
req
->
handle
,
PROCESS_QUERY_INFORMATION
)))
{
reply
->
pid
=
get_process_id
(
process
);
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
->
peb
=
process
->
peb
;
release_object
(
process
);
}
}
...
...
server/protocol.def
View file @
b0fd2ade
...
...
@@ -301,10 +301,12 @@ typedef struct
obj_handle_t handle; /* process handle */
@REPLY
process_id_t pid; /* server process id */
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 */
void* peb; /* PEB address in process address space */
@END
...
...
server/trace.c
View file @
b0fd2ade
...
...
@@ -537,10 +537,12 @@ static void dump_get_process_info_request( const struct get_process_info_request
static
void
dump_get_process_info_reply
(
const
struct
get_process_info_reply
*
req
)
{
fprintf
(
stderr
,
" pid=%04x,"
,
req
->
pid
);
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
,
" system_affinity=%d,"
,
req
->
system_affinity
);
fprintf
(
stderr
,
" peb=%p"
,
req
->
peb
);
}
static
void
dump_set_process_info_request
(
const
struct
set_process_info_request
*
req
)
...
...
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