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
2359b575
Commit
2359b575
authored
Jan 09, 2003
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 09, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- no longer depend on toolhelp definitions for generating snapshots
- added get_dll_info request
parent
4b708a3f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
97 additions
and
8 deletions
+97
-8
toolhelp.c
dlls/kernel/toolhelp.c
+5
-1
server_protocol.h
include/wine/server_protocol.h
+24
-1
process.c
server/process.c
+29
-0
protocol.def
server/protocol.def
+16
-1
request.h
server/request.h
+2
-0
snapshot.c
server/snapshot.c
+4
-5
trace.c
server/trace.c
+17
-0
No files found.
dlls/kernel/toolhelp.c
View file @
2359b575
...
...
@@ -221,7 +221,11 @@ HANDLE WINAPI CreateToolhelp32Snapshot( DWORD flags, DWORD process )
/* Now do the snapshot */
SERVER_START_REQ
(
create_snapshot
)
{
req
->
flags
=
flags
&
~
TH32CS_INHERIT
;
req
->
flags
=
0
;
if
(
flags
&
TH32CS_SNAPMODULE
)
req
->
flags
|=
SNAP_MODULE
;
if
(
flags
&
TH32CS_SNAPPROCESS
)
req
->
flags
|=
SNAP_PROCESS
;
if
(
flags
&
TH32CS_SNAPTHREAD
)
req
->
flags
|=
SNAP_THREAD
;
req
->
inherit
=
(
flags
&
TH32CS_INHERIT
)
!=
0
;
req
->
pid
=
process
;
wine_server_call_err
(
req
);
...
...
include/wine/server_protocol.h
View file @
2359b575
...
...
@@ -417,6 +417,22 @@ struct set_thread_info_reply
struct
get_dll_info_request
{
struct
request_header
__header
;
obj_handle_t
handle
;
void
*
base_address
;
};
struct
get_dll_info_reply
{
struct
reply_header
__header
;
size_t
size
;
void
*
entry_point
;
/* VARARG(filename,string); */
};
struct
suspend_thread_request
{
struct
request_header
__header
;
...
...
@@ -1493,6 +1509,10 @@ struct create_device_reply
};
#define SNAP_HEAPLIST 0x00000001
#define SNAP_PROCESS 0x00000002
#define SNAP_THREAD 0x00000004
#define SNAP_MODULE 0x00000008
struct
create_snapshot_request
{
...
...
@@ -2993,6 +3013,7 @@ enum request
REQ_set_process_info
,
REQ_get_thread_info
,
REQ_set_thread_info
,
REQ_get_dll_info
,
REQ_suspend_thread
,
REQ_resume_thread
,
REQ_load_dll
,
...
...
@@ -3172,6 +3193,7 @@ union generic_request
struct
set_process_info_request
set_process_info_request
;
struct
get_thread_info_request
get_thread_info_request
;
struct
set_thread_info_request
set_thread_info_request
;
struct
get_dll_info_request
get_dll_info_request
;
struct
suspend_thread_request
suspend_thread_request
;
struct
resume_thread_request
resume_thread_request
;
struct
load_dll_request
load_dll_request
;
...
...
@@ -3349,6 +3371,7 @@ union generic_reply
struct
set_process_info_reply
set_process_info_reply
;
struct
get_thread_info_reply
get_thread_info_reply
;
struct
set_thread_info_reply
set_thread_info_reply
;
struct
get_dll_info_reply
get_dll_info_reply
;
struct
suspend_thread_reply
suspend_thread_reply
;
struct
resume_thread_reply
resume_thread_reply
;
struct
load_dll_reply
load_dll_reply
;
...
...
@@ -3509,6 +3532,6 @@ union generic_reply
struct
get_next_hook_reply
get_next_hook_reply
;
};
#define SERVER_PROTOCOL_VERSION 9
4
#define SERVER_PROTOCOL_VERSION 9
5
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/process.c
View file @
2359b575
...
...
@@ -1058,6 +1058,35 @@ DECL_HANDLER(unload_dll)
process_unload_dll
(
current
->
process
,
req
->
base
);
}
/* retrieve information about a module in a process */
DECL_HANDLER
(
get_dll_info
)
{
struct
process
*
process
;
if
((
process
=
get_process_from_handle
(
req
->
handle
,
PROCESS_QUERY_INFORMATION
)))
{
struct
process_dll
*
dll
;
for
(
dll
=
&
process
->
exe
;
dll
;
dll
=
dll
->
next
)
{
if
(
dll
->
base
==
req
->
base_address
)
{
reply
->
size
=
dll
->
size
;
reply
->
entry_point
=
0
;
/* FIXME */
if
(
dll
->
filename
)
{
size_t
len
=
min
(
dll
->
namelen
,
get_reply_max_size
()
);
set_reply_data
(
dll
->
filename
,
len
);
}
break
;
}
}
if
(
!
dll
)
set_error
(
STATUS_DLL_NOT_FOUND
);
release_object
(
process
);
}
}
/* wait for a process to start waiting on input */
/* FIXME: only returns event for now, wait is done in the client */
DECL_HANDLER
(
wait_input_idle
)
...
...
server/protocol.def
View file @
2359b575
...
...
@@ -359,6 +359,17 @@ typedef struct
#define SET_THREAD_INFO_AFFINITY 0x02
/* Retrieve information about a module */
@REQ(get_dll_info)
obj_handle_t handle; /* process handle */
void* base_address; /* base address of module */
@REPLY
size_t size; /* module size */
void* entry_point;
VARARG(filename,string); /* file name of module */
@END
/* Suspend a thread */
@REQ(suspend_thread)
obj_handle_t handle; /* thread handle */
...
...
@@ -1100,10 +1111,14 @@ enum char_info_mode
@END
#define SNAP_HEAPLIST 0x00000001
#define SNAP_PROCESS 0x00000002
#define SNAP_THREAD 0x00000004
#define SNAP_MODULE 0x00000008
/* Create a snapshot */
@REQ(create_snapshot)
int inherit; /* inherit flag */
int flags; /* snapshot flags (
TH32CS
_*) */
int flags; /* snapshot flags (
SNAP
_*) */
process_id_t pid; /* process id */
@REPLY
obj_handle_t handle; /* handle to the snapshot */
...
...
server/request.h
View file @
2359b575
...
...
@@ -117,6 +117,7 @@ DECL_HANDLER(get_process_info);
DECL_HANDLER
(
set_process_info
);
DECL_HANDLER
(
get_thread_info
);
DECL_HANDLER
(
set_thread_info
);
DECL_HANDLER
(
get_dll_info
);
DECL_HANDLER
(
suspend_thread
);
DECL_HANDLER
(
resume_thread
);
DECL_HANDLER
(
load_dll
);
...
...
@@ -295,6 +296,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(
req_handler
)
req_set_process_info
,
(
req_handler
)
req_get_thread_info
,
(
req_handler
)
req_set_thread_info
,
(
req_handler
)
req_get_dll_info
,
(
req_handler
)
req_suspend_thread
,
(
req_handler
)
req_resume_thread
,
(
req_handler
)
req_load_dll
,
...
...
server/snapshot.c
View file @
2359b575
...
...
@@ -28,7 +28,6 @@
#include <stdlib.h>
#include "windef.h"
#include "tlhelp32.h"
#include "handle.h"
#include "process.h"
...
...
@@ -79,7 +78,7 @@ static struct snapshot *create_snapshot( process_id_t pid, int flags )
struct
snapshot
*
snapshot
;
/* need a process for modules and heaps */
if
(
flags
&
(
TH32CS_SNAPMODULE
|
TH32CS_SNAP
HEAPLIST
))
if
(
flags
&
(
SNAP_MODULE
|
SNAP_
HEAPLIST
))
{
if
(
!
pid
)
process
=
(
struct
process
*
)
grab_object
(
current
->
process
);
else
if
(
!
(
process
=
get_process_from_id
(
pid
)))
return
NULL
;
...
...
@@ -95,17 +94,17 @@ static struct snapshot *create_snapshot( process_id_t pid, int flags )
snapshot
->
process_pos
=
0
;
snapshot
->
process_count
=
0
;
if
(
flags
&
TH32CS_SNAP
PROCESS
)
if
(
flags
&
SNAP_
PROCESS
)
snapshot
->
processes
=
process_snap
(
&
snapshot
->
process_count
);
snapshot
->
thread_pos
=
0
;
snapshot
->
thread_count
=
0
;
if
(
flags
&
TH32CS_SNAP
THREAD
)
if
(
flags
&
SNAP_
THREAD
)
snapshot
->
threads
=
thread_snap
(
&
snapshot
->
thread_count
);
snapshot
->
module_pos
=
0
;
snapshot
->
module_count
=
0
;
if
(
flags
&
TH32CS_SNAP
MODULE
)
if
(
flags
&
SNAP_
MODULE
)
snapshot
->
modules
=
module_snap
(
process
,
&
snapshot
->
module_count
);
return
snapshot
;
...
...
server/trace.c
View file @
2359b575
...
...
@@ -528,6 +528,20 @@ static void dump_set_thread_info_request( const struct set_thread_info_request *
fprintf
(
stderr
,
" affinity=%d"
,
req
->
affinity
);
}
static
void
dump_get_dll_info_request
(
const
struct
get_dll_info_request
*
req
)
{
fprintf
(
stderr
,
" handle=%p,"
,
req
->
handle
);
fprintf
(
stderr
,
" base_address=%p"
,
req
->
base_address
);
}
static
void
dump_get_dll_info_reply
(
const
struct
get_dll_info_reply
*
req
)
{
fprintf
(
stderr
,
" size=%d,"
,
req
->
size
);
fprintf
(
stderr
,
" entry_point=%p,"
,
req
->
entry_point
);
fprintf
(
stderr
,
" filename="
);
dump_varargs_string
(
cur_size
);
}
static
void
dump_suspend_thread_request
(
const
struct
suspend_thread_request
*
req
)
{
fprintf
(
stderr
,
" handle=%p"
,
req
->
handle
);
...
...
@@ -2384,6 +2398,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(
dump_func
)
dump_set_process_info_request
,
(
dump_func
)
dump_get_thread_info_request
,
(
dump_func
)
dump_set_thread_info_request
,
(
dump_func
)
dump_get_dll_info_request
,
(
dump_func
)
dump_suspend_thread_request
,
(
dump_func
)
dump_resume_thread_request
,
(
dump_func
)
dump_load_dll_request
,
...
...
@@ -2559,6 +2574,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
(
dump_func
)
0
,
(
dump_func
)
dump_get_thread_info_reply
,
(
dump_func
)
0
,
(
dump_func
)
dump_get_dll_info_reply
,
(
dump_func
)
dump_suspend_thread_reply
,
(
dump_func
)
dump_resume_thread_reply
,
(
dump_func
)
0
,
...
...
@@ -2734,6 +2750,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"set_process_info"
,
"get_thread_info"
,
"set_thread_info"
,
"get_dll_info"
,
"suspend_thread"
,
"resume_thread"
,
"load_dll"
,
...
...
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