Commit 2acc11c2 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Import mspatcha instead of loading it dynamically.

parent 9e0045e1
...@@ -17372,7 +17372,7 @@ wine_fn_config_dll msisip enable_msisip ...@@ -17372,7 +17372,7 @@ wine_fn_config_dll msisip enable_msisip
wine_fn_config_dll msisys.ocx enable_msisys_ocx wine_fn_config_dll msisys.ocx enable_msisys_ocx
wine_fn_config_dll msls31 enable_msls31 wine_fn_config_dll msls31 enable_msls31
wine_fn_config_dll msnet32 enable_msnet32 wine_fn_config_dll msnet32 enable_msnet32
wine_fn_config_dll mspatcha enable_mspatcha wine_fn_config_dll mspatcha enable_mspatcha implib
wine_fn_config_dll msrle32 enable_msrle32 po wine_fn_config_dll msrle32 enable_msrle32 po
wine_fn_config_test dlls/msrle32/tests msrle32_test wine_fn_config_test dlls/msrle32/tests msrle32_test
wine_fn_config_dll mssign32 enable_mssign32 wine_fn_config_dll mssign32 enable_mssign32
......
...@@ -3074,7 +3074,7 @@ WINE_CONFIG_DLL(msisip) ...@@ -3074,7 +3074,7 @@ WINE_CONFIG_DLL(msisip)
WINE_CONFIG_DLL(msisys.ocx) WINE_CONFIG_DLL(msisys.ocx)
WINE_CONFIG_DLL(msls31) WINE_CONFIG_DLL(msls31)
WINE_CONFIG_DLL(msnet32) WINE_CONFIG_DLL(msnet32)
WINE_CONFIG_DLL(mspatcha) WINE_CONFIG_DLL(mspatcha,,[implib])
WINE_CONFIG_DLL(msrle32,,[po]) WINE_CONFIG_DLL(msrle32,,[po])
WINE_CONFIG_TEST(dlls/msrle32/tests) WINE_CONFIG_TEST(dlls/msrle32/tests)
WINE_CONFIG_DLL(mssign32) WINE_CONFIG_DLL(mssign32)
......
MODULE = msi.dll MODULE = msi.dll
IMPORTLIB = msi IMPORTLIB = msi
IMPORTS = uuid urlmon wininet comctl32 shell32 shlwapi cabinet oleaut32 ole32 version user32 gdi32 advapi32 IMPORTS = uuid urlmon wininet comctl32 shell32 shlwapi cabinet oleaut32 ole32 version user32 gdi32 advapi32
DELAYIMPORTS = odbccp32 wintrust crypt32 imagehlp DELAYIMPORTS = odbccp32 wintrust crypt32 imagehlp mspatcha
C_SRCS = \ C_SRCS = \
action.c \ action.c \
......
...@@ -43,13 +43,11 @@ ...@@ -43,13 +43,11 @@
#include "winuser.h" #include "winuser.h"
#include "winreg.h" #include "winreg.h"
#include "shlwapi.h" #include "shlwapi.h"
#include "patchapi.h"
#include "wine/unicode.h" #include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
static HMODULE hmspatcha;
static BOOL (WINAPI *ApplyPatchToFileW)(LPCWSTR, LPCWSTR, LPCWSTR, ULONG);
static void msi_file_update_ui( MSIPACKAGE *package, MSIFILE *f, const WCHAR *action ) static void msi_file_update_ui( MSIPACKAGE *package, MSIFILE *f, const WCHAR *action )
{ {
MSIRECORD *uirow; MSIRECORD *uirow;
...@@ -438,30 +436,6 @@ done: ...@@ -438,30 +436,6 @@ done:
return rc; return rc;
} }
static BOOL load_mspatcha(void)
{
hmspatcha = LoadLibraryA("mspatcha.dll");
if (!hmspatcha)
{
ERR("Failed to load mspatcha.dll: %d\n", GetLastError());
return FALSE;
}
ApplyPatchToFileW = (void*)GetProcAddress(hmspatcha, "ApplyPatchToFileW");
if(!ApplyPatchToFileW)
{
ERR("GetProcAddress(ApplyPatchToFileW) failed: %d.\n", GetLastError());
return FALSE;
}
return TRUE;
}
static void unload_mspatch(void)
{
FreeLibrary(hmspatcha);
}
static MSIFILEPATCH *get_next_filepatch( MSIPACKAGE *package, const WCHAR *key ) static MSIFILEPATCH *get_next_filepatch( MSIPACKAGE *package, const WCHAR *key )
{ {
MSIFILEPATCH *patch; MSIFILEPATCH *patch;
...@@ -525,7 +499,6 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package ) ...@@ -525,7 +499,6 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package )
MSIFILEPATCH *patch; MSIFILEPATCH *patch;
MSIMEDIAINFO *mi; MSIMEDIAINFO *mi;
UINT rc = ERROR_SUCCESS; UINT rc = ERROR_SUCCESS;
BOOL mspatcha_loaded = FALSE;
TRACE("%p\n", package); TRACE("%p\n", package);
...@@ -557,13 +530,6 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package ) ...@@ -557,13 +530,6 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package )
goto done; goto done;
} }
if (!mspatcha_loaded && !load_mspatcha())
{
rc = ERROR_FUNCTION_FAILED;
goto done;
}
mspatcha_loaded = TRUE;
data.mi = mi; data.mi = mi;
data.package = package; data.package = package;
data.cb = patchfiles_cb; data.cb = patchfiles_cb;
...@@ -587,8 +553,6 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package ) ...@@ -587,8 +553,6 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package )
done: done:
msi_free_media_info(mi); msi_free_media_info(mi);
if (mspatcha_loaded)
unload_mspatch();
return rc; return rc;
} }
......
MODULE = mspatcha.dll MODULE = mspatcha.dll
IMPORTLIB = mspatcha
C_SRCS = \ C_SRCS = \
mspatcha_main.c mspatcha_main.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment