https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f474f080a1275bb86752e…
commit f474f080a1275bb86752e73ace16f61f5649726e
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Mar 13 00:16:44 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:28:13 2022 +0100
[WINESYNC] msi: Initialize assembly caches before disabling redirection.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=46638
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id a70ece68b7fa98e55e62eaed1006ceea961666ce by Hans Leidekker
<hans(a)codeweavers.com>
---
dll/win32/msi/action.c | 13 ++++++-------
dll/win32/msi/assembly.c | 5 +++++
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c
index ad2f40cd78f..4901fe75936 100644
--- a/dll/win32/msi/action.c
+++ b/dll/win32/msi/action.c
@@ -1002,13 +1002,6 @@ UINT msi_load_all_components( MSIPACKAGE *package )
if (r != ERROR_SUCCESS)
return r;
- if (!msi_init_assembly_caches( package ))
- {
- ERR("can't initialize assembly caches\n");
- msiobj_release( &view->hdr );
- return ERROR_FUNCTION_FAILED;
- }
-
r = MSI_IterateRecords(view, NULL, load_component, package);
msiobj_release(&view->hdr);
return r;
@@ -8112,6 +8105,12 @@ UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR
*action)
TRACE("Performing action (%s)\n", debugstr_w(action));
+ if (!msi_init_assembly_caches( package ))
+ {
+ ERR("can't initialize assembly caches\n");
+ return ERROR_FUNCTION_FAILED;
+ }
+
package->action_progress_increment = 0;
rc = ACTION_HandleStandardAction(package, action);
diff --git a/dll/win32/msi/assembly.c b/dll/win32/msi/assembly.c
index f46ff02eeb6..cb406111c9b 100644
--- a/dll/win32/msi/assembly.c
+++ b/dll/win32/msi/assembly.c
@@ -41,6 +41,7 @@ static HRESULT (WINAPI *pCreateAssemblyNameObject)( IAssemblyName **,
LPCWSTR, D
static HRESULT (WINAPI *pCreateAssemblyEnum)( IAssemblyEnum **, IUnknown *, IAssemblyName
*, DWORD, LPVOID );
static HMODULE hfusion10, hfusion11, hfusion20, hfusion40, hmscoree, hsxs;
+static BOOL assembly_caches_initialized;
static BOOL init_function_pointers( void )
{
@@ -91,12 +92,16 @@ static BOOL init_function_pointers( void )
BOOL msi_init_assembly_caches( MSIPACKAGE *package )
{
+ if (assembly_caches_initialized) return TRUE;
if (!init_function_pointers()) return FALSE;
+
if (pCreateAssemblyCacheSxs( &package->cache_sxs, 0 ) != S_OK) return FALSE;
if (pCreateAssemblyCacheNet10) pCreateAssemblyCacheNet10(
&package->cache_net[CLR_VERSION_V10], 0 );
if (pCreateAssemblyCacheNet11) pCreateAssemblyCacheNet11(
&package->cache_net[CLR_VERSION_V11], 0 );
if (pCreateAssemblyCacheNet20) pCreateAssemblyCacheNet20(
&package->cache_net[CLR_VERSION_V20], 0 );
if (pCreateAssemblyCacheNet40) pCreateAssemblyCacheNet40(
&package->cache_net[CLR_VERSION_V40], 0 );
+
+ assembly_caches_initialized = TRUE;
return TRUE;
}