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
3e0c90e4
Commit
3e0c90e4
authored
Apr 27, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Avoid using wine_get_build/data_dir() from libwine.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9122bc10
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
83 additions
and
9 deletions
+83
-9
Makefile.in
dlls/ntdll/Makefile.in
+7
-0
env.c
dlls/ntdll/env.c
+2
-2
loader.c
dlls/ntdll/loader.c
+1
-1
locale.c
dlls/ntdll/locale.c
+0
-3
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+3
-0
process.c
dlls/ntdll/process.c
+1
-1
server.c
dlls/ntdll/server.c
+68
-2
thread.c
dlls/ntdll/thread.c
+1
-0
No files found.
dlls/ntdll/Makefile.in
View file @
3e0c90e4
...
...
@@ -56,3 +56,10 @@ C_SRCS = \
wcstring.c
RC_SRCS
=
version.rc
server_EXTRADEFS
=
\
-DBINDIR
=
\"
${
bindir
}
\"
\
-DDLLDIR
=
\"
${
dlldir
}
\"
\
-DBIN_TO_DLLDIR
=
\"
`
$(MAKEDEP)
-R
${
bindir
}
${
dlldir
}
`
\"
\
-DDLL_TO_BINDIR
=
\"
`
$(MAKEDEP)
-R
${
dlldir
}
${
bindir
}
`
\"
\
-DBIN_TO_DATADIR
=
\"
`
$(MAKEDEP)
-R
${
bindir
}
${
datadir
}
/wine
`
\"
dlls/ntdll/env.c
View file @
3e0c90e4
...
...
@@ -408,9 +408,9 @@ static void set_wow64_environment( WCHAR **env )
/* set the Wine paths */
set_wine_path_variable
(
env
,
winedatadirW
,
wine_get_data_dir
()
);
set_wine_path_variable
(
env
,
winedatadirW
,
data_dir
);
set_wine_path_variable
(
env
,
winehomedirW
,
home
);
set_wine_path_variable
(
env
,
winebuilddirW
,
wine_get_build_dir
()
);
set_wine_path_variable
(
env
,
winebuilddirW
,
build_dir
);
set_wine_path_variable
(
env
,
wineconfigdirW
,
config_dir
);
for
(
i
=
0
;
(
p
=
wine_dll_enum_load_path
(
i
));
i
++
)
{
...
...
dlls/ntdll/loader.c
View file @
3e0c90e4
...
...
@@ -2715,7 +2715,7 @@ static NTSTATUS find_builtin_dll( const WCHAR *name, WINE_MODREF **pwm,
void
**
module
,
pe_image_info_t
*
image_info
,
struct
stat
*
st
,
char
**
so_name
)
{
const
char
*
path
,
*
build_dir
=
wine_get_build_dir
()
;
const
char
*
path
;
unsigned
int
i
,
pos
,
len
,
namelen
,
maxlen
=
0
;
char
*
ptr
,
*
file
;
NTSTATUS
status
=
STATUS_DLL_NOT_FOUND
;
...
...
dlls/ntdll/locale.c
View file @
3e0c90e4
...
...
@@ -39,7 +39,6 @@
#include "winbase.h"
#include "winnls.h"
#include "ntdll_misc.h"
#include "wine/library.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
nls
);
...
...
@@ -758,8 +757,6 @@ static const struct { const char *name; UINT cp; } charset_names[] =
static
void
load_unix_cptable
(
unsigned
int
cp
)
{
const
char
*
build_dir
=
wine_get_build_dir
();
const
char
*
data_dir
=
wine_get_data_dir
();
const
char
*
dir
=
build_dir
?
build_dir
:
data_dir
;
struct
stat
st
;
char
*
name
;
...
...
dlls/ntdll/ntdll_misc.h
View file @
3e0c90e4
...
...
@@ -96,6 +96,7 @@ extern void heap_set_debug_flags( HANDLE handle ) DECLSPEC_HIDDEN;
extern
void
init_unix_codepage
(
void
)
DECLSPEC_HIDDEN
;
extern
void
init_locale
(
HMODULE
module
)
DECLSPEC_HIDDEN
;
extern
void
init_user_process_params
(
SIZE_T
data_size
)
DECLSPEC_HIDDEN
;
extern
void
init_paths
(
void
)
DECLSPEC_HIDDEN
;
extern
char
**
build_envp
(
const
WCHAR
*
envW
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
restart_process
(
RTL_USER_PROCESS_PARAMETERS
*
params
,
NTSTATUS
status
)
DECLSPEC_HIDDEN
;
...
...
@@ -104,6 +105,8 @@ extern char **__wine_main_argv;
extern
WCHAR
**
__wine_main_wargv
;
/* server support */
extern
const
char
*
build_dir
DECLSPEC_HIDDEN
;
extern
const
char
*
data_dir
DECLSPEC_HIDDEN
;
extern
const
char
*
config_dir
DECLSPEC_HIDDEN
;
extern
timeout_t
server_start_time
DECLSPEC_HIDDEN
;
extern
unsigned
int
server_cpus
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/process.c
View file @
3e0c90e4
...
...
@@ -1008,7 +1008,7 @@ static const char *get_alternate_loader( char **ret_env )
*
ret_env
=
NULL
;
if
(
wine_get_build_dir
()
)
loader
=
is_win64
?
"loader/wine"
:
"loader/wine64"
;
if
(
build_dir
)
loader
=
is_win64
?
"loader/wine"
:
"loader/wine64"
;
if
(
loader_env
)
{
...
...
dlls/ntdll/server.c
View file @
3e0c90e4
...
...
@@ -113,8 +113,11 @@ static const enum cpu_type client_cpu = CPU_ARM64;
#error Unsupported CPU
#endif
const
char
*
build_dir
=
NULL
;
const
char
*
data_dir
=
NULL
;
const
char
*
config_dir
=
NULL
;
static
const
char
*
server_dir
;
static
const
char
*
bin_dir
;
unsigned
int
server_cpus
=
0
;
BOOL
is_wow64
=
FALSE
;
...
...
@@ -177,6 +180,35 @@ static void fatal_perror( const char *err, ... )
exit
(
1
);
}
/* canonicalize path and return its directory name */
static
char
*
realpath_dirname
(
const
char
*
name
)
{
char
*
p
,
*
fullpath
=
realpath
(
name
,
NULL
);
if
(
fullpath
)
{
p
=
strrchr
(
fullpath
,
'/'
);
if
(
p
==
fullpath
)
p
++
;
if
(
p
)
*
p
=
0
;
}
return
fullpath
;
}
/* if string ends with tail, remove it */
static
char
*
remove_tail
(
const
char
*
str
,
const
char
*
tail
)
{
size_t
len
=
strlen
(
str
);
size_t
tail_len
=
strlen
(
tail
);
char
*
ret
;
if
(
len
<
tail_len
)
return
NULL
;
if
(
strcmp
(
str
+
len
-
tail_len
,
tail
))
return
NULL
;
ret
=
malloc
(
len
-
tail_len
+
1
);
memcpy
(
ret
,
str
,
len
-
tail_len
);
ret
[
len
-
tail_len
]
=
0
;
return
ret
;
}
/* build a path from the specified dir and name */
static
char
*
build_path
(
const
char
*
dir
,
const
char
*
name
)
{
...
...
@@ -1280,6 +1312,42 @@ static const char *init_config_dir(void)
/***********************************************************************
* init_paths
*/
void
init_paths
(
void
)
{
const
char
*
dll_dir
=
NULL
;
#ifdef HAVE_DLADDR
Dl_info
info
;
if
(
dladdr
(
init_paths
,
&
info
)
&&
info
.
dli_fname
[
0
]
==
'/'
)
dll_dir
=
realpath_dirname
(
info
.
dli_fname
);
#endif
#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
bin_dir
=
realpath_dirname
(
"/proc/self/exe"
);
#elif defined (__FreeBSD__) || defined(__DragonFly__)
bin_dir
=
realpath_dirname
(
"/proc/curproc/file"
);
#else
bin_dir
=
realpath_dirname
(
__wine_main_argv
[
0
]
);
#endif
if
(
dll_dir
)
build_dir
=
remove_tail
(
dll_dir
,
"/dlls/ntdll"
);
else
if
(
bin_dir
)
build_dir
=
remove_tail
(
bin_dir
,
"/loader"
);
if
(
!
build_dir
)
{
if
(
!
bin_dir
)
bin_dir
=
dll_dir
?
build_path
(
dll_dir
,
DLL_TO_BINDIR
)
:
BINDIR
;
else
if
(
!
dll_dir
)
dll_dir
=
build_path
(
bin_dir
,
BIN_TO_DLLDIR
);
data_dir
=
build_path
(
bin_dir
,
BIN_TO_DATADIR
);
}
config_dir
=
init_config_dir
();
}
/***********************************************************************
* setup_config_dir
*
* Setup the wine configuration dir.
...
...
@@ -1524,8 +1592,6 @@ void server_init_process(void)
obj_handle_t
version
;
const
char
*
env_socket
=
getenv
(
"WINESERVERSOCKET"
);
config_dir
=
init_config_dir
();
server_pid
=
-
1
;
if
(
env_socket
)
{
...
...
dlls/ntdll/thread.c
View file @
3e0c90e4
...
...
@@ -299,6 +299,7 @@ TEB *thread_init(void)
signal_init_thread
(
teb
);
virtual_init_threading
();
debug_init
();
init_paths
();
set_process_name
(
__wine_main_argc
,
__wine_main_argv
);
/* initialize time values in user_shared_data */
...
...
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