mirror of
https://github.com/reactos/wine.git
synced 2025-02-19 12:21:46 +00:00
ntdll: Load dll from the directory containing the manifest for local assemblies.
This commit is contained in:
parent
a1a8036bbb
commit
5b6bb63adb
@ -1592,6 +1592,7 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file,
|
|||||||
static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname )
|
static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname )
|
||||||
{
|
{
|
||||||
static const WCHAR winsxsW[] = {'\\','w','i','n','s','x','s','\\'};
|
static const WCHAR winsxsW[] = {'\\','w','i','n','s','x','s','\\'};
|
||||||
|
static const WCHAR dotManifestW[] = {'.','m','a','n','i','f','e','s','t',0};
|
||||||
|
|
||||||
ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION *info;
|
ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION *info;
|
||||||
ACTCTX_SECTION_KEYED_DATA data;
|
ACTCTX_SECTION_KEYED_DATA data;
|
||||||
@ -1624,6 +1625,29 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname )
|
|||||||
/* restart with larger buffer */
|
/* restart with larger buffer */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((p = strrchrW( info->lpAssemblyManifestPath, '\\' )))
|
||||||
|
{
|
||||||
|
DWORD dirlen = info->ulAssemblyDirectoryNameLength / sizeof(WCHAR);
|
||||||
|
|
||||||
|
p++;
|
||||||
|
if (strncmpiW( p, info->lpAssemblyDirectoryName, dirlen ) || strcmpiW( p + dirlen, dotManifestW ))
|
||||||
|
{
|
||||||
|
/* manifest name does not match directory name, so it's not a global
|
||||||
|
* windows/winsxs manifest; use the manifest directory name instead */
|
||||||
|
dirlen = p - info->lpAssemblyManifestPath;
|
||||||
|
needed = (dirlen + 1) * sizeof(WCHAR) + nameW.Length;
|
||||||
|
if (!(*fullname = p = RtlAllocateHeap( GetProcessHeap(), 0, needed )))
|
||||||
|
{
|
||||||
|
status = STATUS_NO_MEMORY;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
memcpy( p, info->lpAssemblyManifestPath, dirlen * sizeof(WCHAR) );
|
||||||
|
p += dirlen;
|
||||||
|
strcpyW( p, libname );
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
needed = (windows_dir.Length + sizeof(winsxsW) + info->ulAssemblyDirectoryNameLength +
|
needed = (windows_dir.Length + sizeof(winsxsW) + info->ulAssemblyDirectoryNameLength +
|
||||||
nameW.Length + 2*sizeof(WCHAR));
|
nameW.Length + 2*sizeof(WCHAR));
|
||||||
|
|
||||||
@ -1640,7 +1664,6 @@ static NTSTATUS find_actctx_dll( LPCWSTR libname, LPWSTR *fullname )
|
|||||||
p += info->ulAssemblyDirectoryNameLength / sizeof(WCHAR);
|
p += info->ulAssemblyDirectoryNameLength / sizeof(WCHAR);
|
||||||
*p++ = '\\';
|
*p++ = '\\';
|
||||||
strcpyW( p, libname );
|
strcpyW( p, libname );
|
||||||
TRACE ("found %s for %s\n", debugstr_w(*fullname), debugstr_w(libname) );
|
|
||||||
done:
|
done:
|
||||||
RtlFreeHeap( GetProcessHeap(), 0, info );
|
RtlFreeHeap( GetProcessHeap(), 0, info );
|
||||||
RtlReleaseActivationContext( data.hActCtx );
|
RtlReleaseActivationContext( data.hActCtx );
|
||||||
@ -1687,6 +1710,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname,
|
|||||||
status = find_actctx_dll( libname, &fullname );
|
status = find_actctx_dll( libname, &fullname );
|
||||||
if (status == STATUS_SUCCESS)
|
if (status == STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
|
TRACE ("found %s for %s\n", debugstr_w(fullname), debugstr_w(libname) );
|
||||||
RtlFreeHeap( GetProcessHeap(), 0, dllname );
|
RtlFreeHeap( GetProcessHeap(), 0, dllname );
|
||||||
libname = dllname = fullname;
|
libname = dllname = fullname;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user