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
68a425b1
Commit
68a425b1
authored
Apr 28, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add a helper to exec wineserver.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d01f58a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
4 deletions
+48
-4
server.c
dlls/ntdll/server.c
+48
-4
No files found.
dlls/ntdll/server.c
View file @
68a425b1
...
...
@@ -113,6 +113,8 @@ static const enum cpu_type client_cpu = CPU_ARM64;
#error Unsupported CPU
#endif
static
const
BOOL
is_win64
=
(
sizeof
(
void
*
)
>
sizeof
(
int
));
const
char
*
build_dir
=
NULL
;
const
char
*
data_dir
=
NULL
;
const
char
*
config_dir
=
NULL
;
...
...
@@ -1217,6 +1219,51 @@ int server_pipe( int fd[2] )
/***********************************************************************
* exec_wineserver
*
* Exec a new wine server.
*/
static
void
exec_wineserver
(
char
**
argv
)
{
char
*
path
;
if
(
build_dir
)
{
if
(
!
is_win64
)
/* look for 64-bit server */
{
char
*
loader
=
realpath_dirname
(
build_path
(
build_dir
,
"loader/wine64"
));
if
(
loader
)
{
argv
[
0
]
=
build_path
(
loader
,
"../server/wineserver"
);
execv
(
argv
[
0
],
argv
);
}
}
argv
[
0
]
=
build_path
(
build_dir
,
"server/wineserver"
);
execv
(
argv
[
0
],
argv
);
return
;
}
argv
[
0
]
=
build_path
(
bin_dir
,
"wineserver"
);
execv
(
argv
[
0
],
argv
);
argv
[
0
]
=
getenv
(
"WINESERVER"
);
if
(
argv
[
0
])
execv
(
argv
[
0
],
argv
);
if
((
path
=
getenv
(
"PATH"
)))
{
for
(
path
=
strtok
(
strdup
(
path
),
":"
);
path
;
path
=
strtok
(
NULL
,
":"
))
{
argv
[
0
]
=
build_path
(
path
,
"wineserver"
);
execvp
(
argv
[
0
],
argv
);
}
}
argv
[
0
]
=
build_path
(
BINDIR
,
"wineserver"
);
execv
(
argv
[
0
],
argv
);
}
/***********************************************************************
* start_server
*
* Start a new wine server.
...
...
@@ -1225,7 +1272,6 @@ static void start_server(void)
{
static
BOOL
started
;
/* we only try once */
char
*
argv
[
3
];
static
char
wineserver
[]
=
"server/wineserver"
;
static
char
debug
[]
=
"-d"
;
if
(
!
started
)
...
...
@@ -1235,10 +1281,9 @@ static void start_server(void)
if
(
pid
==
-
1
)
fatal_perror
(
"fork"
);
if
(
!
pid
)
{
argv
[
0
]
=
wineserver
;
argv
[
1
]
=
TRACE_ON
(
server
)
?
debug
:
NULL
;
argv
[
2
]
=
NULL
;
wine_exec_wine_binary
(
argv
[
0
],
argv
,
getenv
(
"WINESERVER"
)
);
exec_wineserver
(
argv
);
fatal_error
(
"could not exec wineserver
\n
"
);
}
waitpid
(
pid
,
&
status
,
0
);
...
...
@@ -1732,7 +1777,6 @@ void server_init_process_done(void)
size_t
server_init_thread
(
void
*
entry_point
,
BOOL
*
suspend
)
{
static
const
char
*
cpu_names
[]
=
{
"x86"
,
"x86_64"
,
"PowerPC"
,
"ARM"
,
"ARM64"
};
static
const
BOOL
is_win64
=
(
sizeof
(
void
*
)
>
sizeof
(
int
));
const
char
*
arch
=
getenv
(
"WINEARCH"
);
int
ret
;
int
reply_pipe
[
2
];
...
...
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