From: Bolan Chen <bolanchen123@gmail.com> --- dlls/ntdll/actctx.c | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index ca41b2bf16e..705ef85ade5 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -27,6 +27,7 @@ #include <stdlib.h> #include "ntstatus.h" +#include "windef.h" #include "winbase.h" #include "winnt.h" #include "winternl.h" @@ -3328,18 +3329,6 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit return io.Status; } -static BOOL is_mixed_clr_module( void *module ) -{ - const IMAGE_COR20_HEADER *cor; - ULONG size; - - if (!RtlImageNtHeader( module )) return FALSE; - cor = RtlImageDirectoryEntryToData( module, TRUE, IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR, &size ); - if (!cor || size < sizeof(*cor)) return FALSE; - - return !(cor->flags & COMIMAGE_FLAGS_ILONLY); -} - static void parse_probing_elem( xmlbuf_t *xmlbuf, const struct xml_elem *parent, WCHAR **private_path ) { struct xml_attr attr; @@ -3643,10 +3632,10 @@ static NTSTATUS probe_private_path( struct actctx_loader *acl, struct assembly_i if (p > buffer && p[-1] != '\\') *p++ = '\\'; *p = 0; status = open_manifest_file( acl, ai, lang, directory, buffer, total ); - if (status != STATUX_SXS_ASSEMBLY_NOT_FOUND) break; - if (!end) break; - path = end + 1; + if (status != STATUS_SXS_ASSEMBLY_NOT_FOUND) break; } + if (!end) break; + path = end + 1; } RtlFreeHeap( GetProcessHeap(), 0, buffer); @@ -3684,13 +3673,6 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl, return STATUS_NO_MEMORY; } - /* Lookup in <dir>\<privatePath>\name.dll - * <dir>\<privatePath>\name.manifest - * - * If the module is a mixed CLR module - */ - - /* Lookup in <dir>\name.dll * <dir>\name.manifest * <dir>\name\name.dll @@ -3718,6 +3700,8 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl, swprintf( p, total - (p - buffer), L"%s\\", ai->name ); status = open_manifest_file( acl, ai, lang, directory, buffer, total ); } + + if ((status = probe_private_path( acl, ai )) != STATUS_SXS_ASSEMBLY_NOT_FOUND) return status; done: RtlFreeHeap( GetProcessHeap(), 0, directory ); @@ -5622,7 +5606,7 @@ NTSTATUS WINAPI RtlCreateActivationContext( ACTIVATION_CONTEXT **new_actctx, con actctx->config.type = ACTIVATION_CONTEXT_PATH_TYPE_NONE; actctx->config.info = NULL; config_module = NtCurrentTeb()->Peb->ImageBaseAddress; - if (status = get_module_filename( config_module, &config_name, sizeof(L".config") )) + if ((status = get_module_filename( config_module, &config_name, sizeof(L".config") ))) goto error; wcscat( config_name.Buffer, L".config" ); config_nameW.Buffer = NULL; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10753