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
3c9b5379
Commit
3c9b5379
authored
Mar 11, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Store a copy of the image file name in the process.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d316d548
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
process.c
dlls/kernel32/tests/process.c
+0
-2
mapping.c
server/mapping.c
+3
-0
process.c
server/process.c
+9
-12
process.h
server/process.h
+2
-0
No files found.
dlls/kernel32/tests/process.c
View file @
3c9b5379
...
...
@@ -4192,9 +4192,7 @@ static void test_dead_process(void)
memset
(
data
,
0
,
sizeof
(
data
)
);
status
=
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessImageFileName
,
data
,
sizeof
(
data
),
NULL
);
ok
(
!
status
,
"ProcessImageFileName failed %x
\n
"
,
status
);
todo_wine
ok
(
((
UNICODE_STRING
*
)
data
)
->
Length
,
"ProcessImageFileName not set
\n
"
);
todo_wine
ok
(
((
UNICODE_STRING
*
)
data
)
->
Buffer
[
0
]
==
'\\'
,
"ProcessImageFileName not set
\n
"
);
memset
(
prio
,
0xcc
,
sizeof
(
*
prio
)
);
...
...
server/mapping.c
View file @
3c9b5379
...
...
@@ -353,6 +353,7 @@ struct memory_view *get_exe_view( struct process *process )
static
void
add_process_view
(
struct
thread
*
thread
,
struct
memory_view
*
view
)
{
struct
process
*
process
=
thread
->
process
;
struct
unicode_str
name
;
if
(
view
->
flags
&
SEC_IMAGE
)
{
...
...
@@ -362,6 +363,8 @@ static void add_process_view( struct thread *thread, struct memory_view *view )
{
/* main exe */
list_add_head
(
&
process
->
views
,
&
view
->
entry
);
if
(
get_view_nt_name
(
view
,
&
name
)
&&
(
process
->
image
=
memdup
(
name
.
str
,
name
.
len
)))
process
->
imagelen
=
name
.
len
;
return
;
}
}
...
...
server/process.c
View file @
3c9b5379
...
...
@@ -536,6 +536,8 @@ struct process *create_process( int fd, struct process *parent, int inherit_all,
process
->
is_system
=
0
;
process
->
debug_children
=
1
;
process
->
is_terminating
=
0
;
process
->
imagelen
=
0
;
process
->
image
=
NULL
;
process
->
job
=
NULL
;
process
->
console
=
NULL
;
process
->
startup_state
=
STARTUP_IN_PROGRESS
;
...
...
@@ -649,6 +651,7 @@ static void process_destroy( struct object *obj )
if
(
process
->
id
)
free_ptid
(
process
->
id
);
if
(
process
->
token
)
release_object
(
process
->
token
);
free
(
process
->
dir_cache
);
free
(
process
->
image
);
}
/* dump a process on stdout for debugging purposes */
...
...
@@ -1381,13 +1384,12 @@ DECL_HANDLER(get_process_debug_info)
/* fetch the name of the process image */
DECL_HANDLER
(
get_process_image_name
)
{
struct
unicode_str
name
;
struct
memory_view
*
view
;
struct
process
*
process
=
get_process_from_handle
(
req
->
handle
,
PROCESS_QUERY_LIMITED_INFORMATION
);
if
(
!
process
)
return
;
if
(
(
view
=
get_exe_view
(
process
))
&&
get_view_nt_name
(
view
,
&
name
)
)
if
(
process
->
image
)
{
struct
unicode_str
name
=
{
process
->
image
,
process
->
imagelen
};
/* skip the \??\ prefix */
if
(
req
->
win32
&&
name
.
len
>
6
*
sizeof
(
WCHAR
)
&&
name
.
str
[
5
]
==
':'
)
{
...
...
@@ -1724,7 +1726,6 @@ DECL_HANDLER(list_processes)
{
struct
process
*
process
;
struct
thread
*
thread
;
struct
unicode_str
nt_name
;
unsigned
int
pos
=
0
;
char
*
buffer
;
...
...
@@ -1733,10 +1734,8 @@ DECL_HANDLER(list_processes)
LIST_FOR_EACH_ENTRY
(
process
,
&
process_list
,
struct
process
,
entry
)
{
struct
memory_view
*
view
=
get_exe_view
(
process
);
if
(
!
view
||
!
get_view_nt_name
(
view
,
&
nt_name
))
nt_name
.
len
=
0
;
reply
->
info_size
=
(
reply
->
info_size
+
7
)
&
~
7
;
reply
->
info_size
+=
sizeof
(
struct
process_info
)
+
nt_name
.
len
;
reply
->
info_size
+=
sizeof
(
struct
process_info
)
+
process
->
image
len
;
reply
->
info_size
=
(
reply
->
info_size
+
7
)
&
~
7
;
reply
->
info_size
+=
process
->
running_threads
*
sizeof
(
struct
thread_info
);
reply
->
process_count
++
;
...
...
@@ -1754,13 +1753,11 @@ DECL_HANDLER(list_processes)
LIST_FOR_EACH_ENTRY
(
process
,
&
process_list
,
struct
process
,
entry
)
{
struct
process_info
*
process_info
;
struct
memory_view
*
view
=
get_exe_view
(
process
);
pos
=
(
pos
+
7
)
&
~
7
;
if
(
!
view
||
!
get_view_nt_name
(
view
,
&
nt_name
))
nt_name
.
len
=
0
;
process_info
=
(
struct
process_info
*
)(
buffer
+
pos
);
process_info
->
start_time
=
process
->
start_time
;
process_info
->
name_len
=
nt_name
.
len
;
process_info
->
name_len
=
process
->
image
len
;
process_info
->
thread_count
=
process
->
running_threads
;
process_info
->
priority
=
process
->
priority
;
process_info
->
pid
=
process
->
id
;
...
...
@@ -1768,8 +1765,8 @@ DECL_HANDLER(list_processes)
process_info
->
handle_count
=
get_handle_table_count
(
process
);
process_info
->
unix_pid
=
process
->
unix_pid
;
pos
+=
sizeof
(
*
process_info
);
memcpy
(
buffer
+
pos
,
nt_name
.
str
,
nt_name
.
len
);
pos
+=
nt_name
.
len
;
memcpy
(
buffer
+
pos
,
process
->
image
,
process
->
image
len
);
pos
+=
process
->
image
len
;
pos
=
(
pos
+
7
)
&
~
7
;
LIST_FOR_EACH_ENTRY
(
thread
,
&
process
->
thread_list
,
struct
thread
,
proc_entry
)
{
...
...
server/process.h
View file @
3c9b5379
...
...
@@ -64,6 +64,8 @@ struct process
unsigned
int
is_system
:
1
;
/* is it a system process? */
unsigned
int
debug_children
:
1
;
/* also debug all child processes */
unsigned
int
is_terminating
:
1
;
/* is process terminating? */
data_size_t
imagelen
;
/* length of image path in bytes */
WCHAR
*
image
;
/* main exe image full path */
struct
job
*
job
;
/* job object ascoicated with this process */
struct
list
job_entry
;
/* list entry for job object */
struct
list
asyncs
;
/* list of async object owned by the process */
...
...
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