msi: Set stale function pointers to NULL.

A crash occurs during install of dotnet35 on a 64-bit prefix
as when msi_destroy_assembly_caches is called, the mscoree
library is unloaded but the function pointers are not set back
to NULL.

Signed-off-by: Brendan McGrath <brendan@redmandi.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Brendan McGrath 2018-11-26 20:23:34 +11:00 committed by Alexandre Julliard
parent 74042733b1
commit 256ca317a2
1 changed files with 4 additions and 1 deletions

View File

@ -36,7 +36,6 @@ static HRESULT (WINAPI *pCreateAssemblyCacheNet11)( IAssemblyCache **, DWORD );
static HRESULT (WINAPI *pCreateAssemblyCacheNet20)( IAssemblyCache **, DWORD ); static HRESULT (WINAPI *pCreateAssemblyCacheNet20)( IAssemblyCache **, DWORD );
static HRESULT (WINAPI *pCreateAssemblyCacheNet40)( IAssemblyCache **, DWORD ); static HRESULT (WINAPI *pCreateAssemblyCacheNet40)( IAssemblyCache **, DWORD );
static HRESULT (WINAPI *pCreateAssemblyCacheSxs)( IAssemblyCache **, DWORD ); static HRESULT (WINAPI *pCreateAssemblyCacheSxs)( IAssemblyCache **, DWORD );
static HRESULT (WINAPI *pLoadLibraryShim)( LPCWSTR, LPCWSTR, LPVOID, HMODULE * );
static HRESULT (WINAPI *pGetFileVersion)( LPCWSTR, LPWSTR, DWORD, DWORD * ); static HRESULT (WINAPI *pGetFileVersion)( LPCWSTR, LPWSTR, DWORD, DWORD * );
static HRESULT (WINAPI *pCreateAssemblyNameObject)( IAssemblyName **, LPCWSTR, DWORD, LPVOID ); static HRESULT (WINAPI *pCreateAssemblyNameObject)( IAssemblyName **, LPCWSTR, DWORD, LPVOID );
static HRESULT (WINAPI *pCreateAssemblyEnum)( IAssemblyEnum **, IUnknown *, IAssemblyName *, DWORD, LPVOID ); static HRESULT (WINAPI *pCreateAssemblyEnum)( IAssemblyEnum **, IUnknown *, IAssemblyName *, DWORD, LPVOID );
@ -52,6 +51,7 @@ static BOOL init_function_pointers( void )
static const WCHAR szVersion11[] = {'v','1','.','1','.','4','3','2','2',0}; static const WCHAR szVersion11[] = {'v','1','.','1','.','4','3','2','2',0};
static const WCHAR szVersion20[] = {'v','2','.','0','.','5','0','7','2','7',0}; static const WCHAR szVersion20[] = {'v','2','.','0','.','5','0','7','2','7',0};
static const WCHAR szVersion40[] = {'v','4','.','0','.','3','0','3','1','9',0}; static const WCHAR szVersion40[] = {'v','4','.','0','.','3','0','3','1','9',0};
HRESULT (WINAPI *pLoadLibraryShim)( LPCWSTR, LPCWSTR, LPVOID, HMODULE * );
WCHAR path[MAX_PATH]; WCHAR path[MAX_PATH];
DWORD len = GetSystemDirectoryW( path, MAX_PATH ); DWORD len = GetSystemDirectoryW( path, MAX_PATH );
@ -121,6 +121,9 @@ void msi_destroy_assembly_caches( MSIPACKAGE *package )
pCreateAssemblyCacheNet11 = NULL; pCreateAssemblyCacheNet11 = NULL;
pCreateAssemblyCacheNet20 = NULL; pCreateAssemblyCacheNet20 = NULL;
pCreateAssemblyCacheNet40 = NULL; pCreateAssemblyCacheNet40 = NULL;
pGetFileVersion = NULL;
pCreateAssemblyNameObject = NULL;
pCreateAssemblyEnum = NULL;
FreeLibrary( hfusion10 ); FreeLibrary( hfusion10 );
FreeLibrary( hfusion11 ); FreeLibrary( hfusion11 );
FreeLibrary( hfusion20 ); FreeLibrary( hfusion20 );