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
c273498e
Commit
c273498e
authored
Dec 29, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Implement process control using Mach primitives for Mac OS.
With help from Ken Thomases.
parent
150b5dca
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
0 deletions
+59
-0
server.c
dlls/ntdll/server.c
+47
-0
Makefile.in
server/Makefile.in
+1
-0
mach.c
server/mach.c
+0
-0
process.h
server/process.h
+7
-0
ptrace.c
server/ptrace.c
+4
-0
No files found.
dlls/ntdll/server.c
View file @
c273498e
...
...
@@ -919,6 +919,49 @@ static void create_config_dir(void)
}
#ifdef __APPLE__
#include <mach/mach.h>
#include <mach/mach_error.h>
#include <servers/bootstrap.h>
/* send our task port to the server */
static
void
send_server_task_port
(
void
)
{
mach_port_t
bootstrap_port
,
wineserver_port
;
kern_return_t
kret
;
struct
{
mach_msg_header_t
header
;
mach_msg_body_t
body
;
mach_msg_port_descriptor_t
task_port
;
}
msg
;
if
(
task_get_bootstrap_port
(
mach_task_self
(),
&
bootstrap_port
)
!=
KERN_SUCCESS
)
return
;
kret
=
bootstrap_look_up
(
bootstrap_port
,
(
char
*
)
wine_get_server_dir
(),
&
wineserver_port
);
if
(
kret
!=
KERN_SUCCESS
)
fatal_error
(
"cannot find the server port: 0x%08x
\n
"
,
kret
);
mach_port_deallocate
(
mach_task_self
(),
bootstrap_port
);
msg
.
header
.
msgh_bits
=
MACH_MSGH_BITS
(
MACH_MSG_TYPE_COPY_SEND
,
0
)
|
MACH_MSGH_BITS_COMPLEX
;
msg
.
header
.
msgh_size
=
sizeof
(
msg
);
msg
.
header
.
msgh_remote_port
=
wineserver_port
;
msg
.
header
.
msgh_local_port
=
MACH_PORT_NULL
;
msg
.
body
.
msgh_descriptor_count
=
1
;
msg
.
task_port
.
name
=
mach_task_self
();
msg
.
task_port
.
disposition
=
MACH_MSG_TYPE_COPY_SEND
;
msg
.
task_port
.
type
=
MACH_MSG_PORT_DESCRIPTOR
;
kret
=
mach_msg_send
(
&
msg
.
header
);
if
(
kret
!=
KERN_SUCCESS
)
server_protocol_error
(
"mach_msg_send failed: 0x%08x
\n
"
,
kret
);
mach_port_deallocate
(
mach_task_self
(),
wineserver_port
);
}
#endif
/* __APPLE__ */
/***********************************************************************
* server_init_process
*
...
...
@@ -962,6 +1005,10 @@ void server_init_process(void)
/* receive the first thread request fd on the main socket */
ntdll_get_thread_data
()
->
request_fd
=
receive_fd
(
&
dummy_handle
);
#ifdef __APPLE__
send_server_task_port
();
#endif
}
...
...
server/Makefile.in
View file @
c273498e
...
...
@@ -24,6 +24,7 @@ C_SRCS = \
file.c
\
handle.c
\
hook.c
\
mach.c
\
mailslot.c
\
main.c
\
mapping.c
\
...
...
server/mach.c
0 → 100644
View file @
c273498e
This diff is collapsed.
Click to expand it.
server/process.h
View file @
c273498e
...
...
@@ -130,6 +130,13 @@ extern struct process_snapshot *process_snap( int *count );
extern
struct
module_snapshot
*
module_snap
(
struct
process
*
process
,
int
*
count
);
extern
void
enum_processes
(
int
(
*
cb
)(
struct
process
*
,
void
*
),
void
*
user
);
/* process tracing mechanism to use */
#ifdef __APPLE__
#define USE_MACH
#else
#define USE_PTRACE
#endif
extern
void
init_tracing_mechanism
(
void
);
extern
void
init_process_tracing
(
struct
process
*
process
);
extern
void
finish_process_tracing
(
struct
process
*
process
);
...
...
server/ptrace.c
View file @
c273498e
...
...
@@ -45,6 +45,8 @@
#include "process.h"
#include "thread.h"
#ifdef USE_PTRACE
#ifndef PTRACE_CONT
#define PTRACE_CONT PT_CONTINUE
#endif
...
...
@@ -653,3 +655,5 @@ void set_thread_context( struct thread *thread, const CONTEXT *context, unsigned
}
#endif
/* linux || __FreeBSD__ */
#endif
/* USE_PTRACE */
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