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
55d98c57
Commit
55d98c57
authored
Apr 19, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use the loadFrom directory to load dlls from the activation context.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=50978
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8f3383f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
1 deletion
+52
-1
loader.c
dlls/ntdll/loader.c
+52
-1
No files found.
dlls/ntdll/loader.c
View file @
55d98c57
...
...
@@ -2432,6 +2432,44 @@ failed:
/***********************************************************************
* build_dlldata_path
*
* Helper for find_actctx_dll.
*/
static
NTSTATUS
build_dlldata_path
(
LPCWSTR
libname
,
ACTCTX_SECTION_KEYED_DATA
*
data
,
LPWSTR
*
fullname
)
{
struct
dllredirect_data
*
dlldata
=
data
->
lpData
;
char
*
base
=
data
->
lpSectionBase
;
SIZE_T
total
=
dlldata
->
total_len
+
(
wcslen
(
libname
)
+
1
)
*
sizeof
(
WCHAR
);
WCHAR
*
p
,
*
buffer
;
NTSTATUS
status
=
STATUS_SUCCESS
;
ULONG
i
;
if
(
!
(
p
=
buffer
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
total
)))
return
STATUS_NO_MEMORY
;
for
(
i
=
0
;
i
<
dlldata
->
paths_count
;
i
++
)
{
memcpy
(
p
,
base
+
dlldata
->
paths
[
i
].
offset
,
dlldata
->
paths
[
i
].
len
);
p
+=
dlldata
->
paths
[
i
].
len
/
sizeof
(
WCHAR
);
}
wcscpy
(
p
,
libname
);
if
(
dlldata
->
flags
&
DLL_REDIRECT_PATH_EXPAND
)
{
RtlExpandEnvironmentStrings
(
NULL
,
buffer
,
wcslen
(
buffer
),
NULL
,
0
,
&
total
);
if
((
*
fullname
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
total
*
sizeof
(
WCHAR
)
)))
RtlExpandEnvironmentStrings
(
NULL
,
buffer
,
wcslen
(
buffer
),
*
fullname
,
total
,
NULL
);
else
status
=
STATUS_NO_MEMORY
;
RtlFreeHeap
(
GetProcessHeap
(),
0
,
buffer
);
}
else
*
fullname
=
buffer
;
return
status
;
}
/***********************************************************************
* find_actctx_dll
*
* Find the full path (if any) of the dll from the activation context.
...
...
@@ -2440,8 +2478,9 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname )
{
static
const
WCHAR
winsxsW
[]
=
{
'\\'
,
'w'
,
'i'
,
'n'
,
's'
,
'x'
,
's'
,
'\\'
};
ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
*
info
;
ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION
*
info
=
NULL
;
ACTCTX_SECTION_KEYED_DATA
data
;
struct
dllredirect_data
*
dlldata
;
UNICODE_STRING
nameW
;
NTSTATUS
status
;
SIZE_T
needed
,
size
=
1024
;
...
...
@@ -2454,6 +2493,18 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname )
&
nameW
,
&
data
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
if
(
data
.
ulLength
<
offsetof
(
struct
dllredirect_data
,
paths
[
0
]
))
{
status
=
STATUS_SXS_KEY_NOT_FOUND
;
goto
done
;
}
dlldata
=
data
.
lpData
;
if
(
!
(
dlldata
->
flags
&
DLL_REDIRECT_PATH_OMITS_ASSEMBLY_ROOT
))
{
status
=
build_dlldata_path
(
libname
,
&
data
,
fullname
);
goto
done
;
}
for
(;;)
{
if
(
!
(
info
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
size
)))
...
...
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