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
ba1495f7
Commit
ba1495f7
authored
Apr 27, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Avoid using wine_dll_enum_load_path() from libwine.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3e0c90e4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
8 deletions
+40
-8
env.c
dlls/ntdll/env.c
+2
-3
loader.c
dlls/ntdll/loader.c
+3
-5
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+2
-0
server.c
dlls/ntdll/server.c
+33
-0
No files found.
dlls/ntdll/env.c
View file @
ba1495f7
...
...
@@ -38,7 +38,6 @@
#define WIN32_NO_STATUS
#include "windef.h"
#include "winternl.h"
#include "wine/library.h"
#include "wine/debug.h"
#include "ntdll_misc.h"
#include "winnt.h"
...
...
@@ -412,10 +411,10 @@ static void set_wow64_environment( WCHAR **env )
set_wine_path_variable
(
env
,
winehomedirW
,
home
);
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
++
)
for
(
i
=
0
;
dll_paths
[
i
]
;
i
++
)
{
NTDLL_swprintf
(
buf
,
winedlldirW
,
i
);
set_wine_path_variable
(
env
,
buf
,
p
);
set_wine_path_variable
(
env
,
buf
,
dll_paths
[
i
]
);
}
NTDLL_swprintf
(
buf
,
winedlldirW
,
i
);
set_wine_path_variable
(
env
,
buf
,
NULL
);
...
...
dlls/ntdll/loader.c
View file @
ba1495f7
...
...
@@ -2715,7 +2715,6 @@ 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
;
unsigned
int
i
,
pos
,
len
,
namelen
,
maxlen
=
0
;
char
*
ptr
,
*
file
;
NTSTATUS
status
=
STATUS_DLL_NOT_FOUND
;
...
...
@@ -2723,8 +2722,7 @@ static NTSTATUS find_builtin_dll( const WCHAR *name, WINE_MODREF **pwm,
len
=
wcslen
(
name
);
if
(
build_dir
)
maxlen
=
strlen
(
build_dir
)
+
sizeof
(
"/programs/"
)
+
len
;
for
(
i
=
0
;
(
path
=
wine_dll_enum_load_path
(
i
));
i
++
)
maxlen
=
max
(
maxlen
,
strlen
(
path
)
+
1
);
maxlen
+=
len
+
sizeof
(
".so"
);
maxlen
=
max
(
maxlen
,
dll_path_maxlen
)
+
len
+
sizeof
(
".so"
);
if
(
!
(
file
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
maxlen
)))
return
STATUS_NO_MEMORY
;
...
...
@@ -2763,10 +2761,10 @@ static NTSTATUS find_builtin_dll( const WCHAR *name, WINE_MODREF **pwm,
if
(
status
!=
STATUS_DLL_NOT_FOUND
)
goto
done
;
}
for
(
i
=
0
;
(
path
=
wine_dll_enum_load_path
(
i
))
;
i
++
)
for
(
i
=
0
;
dll_paths
[
i
]
;
i
++
)
{
file
[
pos
+
len
+
1
]
=
0
;
ptr
=
prepend
(
file
+
pos
,
path
,
strlen
(
path
)
);
ptr
=
prepend
(
file
+
pos
,
dll_paths
[
i
],
strlen
(
dll_paths
[
i
]
)
);
status
=
open_builtin_file
(
ptr
,
pwm
,
module
,
image_info
,
st
,
so_name
);
if
(
status
==
STATUS_IMAGE_MACHINE_TYPE_MISMATCH
)
found_image
=
TRUE
;
else
if
(
status
!=
STATUS_DLL_NOT_FOUND
)
goto
done
;
...
...
dlls/ntdll/ntdll_misc.h
View file @
ba1495f7
...
...
@@ -108,6 +108,8 @@ extern WCHAR **__wine_main_wargv;
extern
const
char
*
build_dir
DECLSPEC_HIDDEN
;
extern
const
char
*
data_dir
DECLSPEC_HIDDEN
;
extern
const
char
*
config_dir
DECLSPEC_HIDDEN
;
extern
const
char
**
dll_paths
DECLSPEC_HIDDEN
;
extern
size_t
dll_path_maxlen
DECLSPEC_HIDDEN
;
extern
timeout_t
server_start_time
DECLSPEC_HIDDEN
;
extern
unsigned
int
server_cpus
DECLSPEC_HIDDEN
;
extern
BOOL
is_wow64
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/server.c
View file @
ba1495f7
...
...
@@ -116,6 +116,8 @@ static const enum cpu_type client_cpu = CPU_ARM64;
const
char
*
build_dir
=
NULL
;
const
char
*
data_dir
=
NULL
;
const
char
*
config_dir
=
NULL
;
const
char
**
dll_paths
=
NULL
;
size_t
dll_path_maxlen
=
0
;
static
const
char
*
server_dir
;
static
const
char
*
bin_dir
;
...
...
@@ -1312,6 +1314,36 @@ static const char *init_config_dir(void)
/***********************************************************************
* build_dll_path
*/
static
void
build_dll_path
(
const
char
*
dll_dir
)
{
const
char
*
default_dlldir
=
DLLDIR
;
char
*
p
,
*
path
=
getenv
(
"WINEDLLPATH"
);
int
i
,
count
=
0
;
if
(
path
)
for
(
p
=
path
,
count
=
1
;
*
p
;
p
++
)
if
(
*
p
==
':'
)
count
++
;
dll_paths
=
malloc
(
(
count
+
2
)
*
sizeof
(
*
dll_paths
)
);
count
=
0
;
if
(
!
build_dir
&&
dll_dir
)
dll_paths
[
count
++
]
=
dll_dir
;
if
(
path
)
{
path
=
strdup
(
path
);
for
(
p
=
strtok
(
path
,
":"
);
p
;
p
=
strtok
(
NULL
,
":"
))
dll_paths
[
count
++
]
=
strdup
(
p
);
free
(
path
);
}
if
(
!
build_dir
&&
!
dll_dir
)
dll_paths
[
count
++
]
=
default_dlldir
;
for
(
i
=
0
;
i
<
count
;
i
++
)
dll_path_maxlen
=
max
(
dll_path_maxlen
,
strlen
(
dll_paths
[
i
])
);
dll_paths
[
count
]
=
NULL
;
}
/***********************************************************************
* init_paths
*/
void
init_paths
(
void
)
...
...
@@ -1343,6 +1375,7 @@ void init_paths(void)
data_dir
=
build_path
(
bin_dir
,
BIN_TO_DATADIR
);
}
build_dll_path
(
dll_dir
);
config_dir
=
init_config_dir
();
}
...
...
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