Nikolay Sivov : sxs: Query context that contains the GUID in SxsLookupClrGuid().
Alexandre Julliard
julliard at winehq.org
Mon Dec 7 15:51:32 CST 2020
Module: wine
Branch: master
Commit: c7ba8b7aa49f9938b24f55a7c3cd049c27d73aad
URL: https://source.winehq.org/git/wine.git/?a=commit;h=c7ba8b7aa49f9938b24f55a7c3cd049c27d73aad
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Mon Dec 7 10:27:56 2020 +0300
sxs: Query context that contains the GUID in SxsLookupClrGuid().
This restores pre-2cfc85dc55d403a7fcb885a62bb28f8d73498c2d logic;
activation/deactivation still happens, and user context in this case is
returned from FindActCtxSectionGuid().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50139
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/sxs/sxs.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/dlls/sxs/sxs.c b/dlls/sxs/sxs.c
index 7150f55c33e..cd1d0f7bb56 100644
--- a/dlls/sxs/sxs.c
+++ b/dlls/sxs/sxs.c
@@ -135,14 +135,20 @@ BOOL WINAPI SxsLookupClrGuid(DWORD flags, GUID *clsid, HANDLE actctx, void *buff
if (flags & SXS_LOOKUP_CLR_GUID_FIND_SURROGATE)
{
- if ((retval = FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES, clsid, &guid_info)))
+ if ((retval = FindActCtxSectionGuid(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL,
+ ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES, clsid, &guid_info)))
+ {
flags &= ~SXS_LOOKUP_CLR_GUID_FIND_CLR_CLASS;
+ }
}
if (!retval && (flags & SXS_LOOKUP_CLR_GUID_FIND_CLR_CLASS))
{
- if ((retval = FindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION, clsid, &guid_info)))
+ if ((retval = FindActCtxSectionGuid(FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX, NULL,
+ ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION, clsid, &guid_info)))
+ {
flags &= ~SXS_LOOKUP_CLR_GUID_FIND_SURROGATE;
+ }
}
if (!retval)
@@ -151,7 +157,7 @@ BOOL WINAPI SxsLookupClrGuid(DWORD flags, GUID *clsid, HANDLE actctx, void *buff
goto out;
}
- retval = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX, NULL, &guid_info.ulAssemblyRosterIndex,
+ retval = QueryActCtxW(0, guid_info.hActCtx, &guid_info.ulAssemblyRosterIndex,
AssemblyDetailedInformationInActivationContext, NULL, 0, &bytes_assembly_info);
if (!retval && GetLastError() != ERROR_INSUFFICIENT_BUFFER)
{
@@ -159,7 +165,7 @@ BOOL WINAPI SxsLookupClrGuid(DWORD flags, GUID *clsid, HANDLE actctx, void *buff
}
assembly_info = heap_alloc(bytes_assembly_info);
- if (!(retval = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX, NULL, &guid_info.ulAssemblyRosterIndex,
+ if (!(retval = QueryActCtxW(0, guid_info.hActCtx, &guid_info.ulAssemblyRosterIndex,
AssemblyDetailedInformationInActivationContext, assembly_info,
bytes_assembly_info, &bytes_assembly_info)))
{
@@ -225,6 +231,7 @@ BOOL WINAPI SxsLookupClrGuid(DWORD flags, GUID *clsid, HANDLE actctx, void *buff
SetLastError(0);
out:
+ ReleaseActCtx(guid_info.hActCtx);
if (flags & SXS_LOOKUP_CLR_GUID_USE_ACTCTX)
DeactivateActCtx(0, cookie);
More information about the wine-cvs
mailing list