mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[WINESYNC] msi: Fix memory leaks.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 965ca1b4de78600366cde437c97a7208a954b18b by Hans Leidekker <hans@codeweavers.com>
This commit is contained in:
parent
0bbc2be92c
commit
4b4baf5cb8
1 changed files with 29 additions and 26 deletions
|
@ -553,46 +553,49 @@ UINT CDECL __wine_msi_call_dll_function(const GUID *guid)
|
||||||
if (r != ERROR_SUCCESS)
|
if (r != ERROR_SUCCESS)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
hPackage = alloc_msi_remote_handle( remote_package );
|
||||||
|
if (!hPackage)
|
||||||
|
{
|
||||||
|
ERR( "failed to create handle for %x\n", remote_package );
|
||||||
|
midl_user_free( dll );
|
||||||
|
midl_user_free( proc );
|
||||||
|
return ERROR_INSTALL_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
hModule = LoadLibraryW( dll );
|
hModule = LoadLibraryW( dll );
|
||||||
if (!hModule)
|
if (!hModule)
|
||||||
{
|
{
|
||||||
ERR( "failed to load dll %s (%u)\n", debugstr_w( dll ), GetLastError() );
|
ERR( "failed to load dll %s (%u)\n", debugstr_w( dll ), GetLastError() );
|
||||||
|
midl_user_free( dll );
|
||||||
|
midl_user_free( proc );
|
||||||
|
MsiCloseHandle( hPackage );
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn = (MsiCustomActionEntryPoint) GetProcAddress( hModule, proc );
|
fn = (MsiCustomActionEntryPoint) GetProcAddress( hModule, proc );
|
||||||
if (fn)
|
if (!fn) WARN( "GetProcAddress(%s) failed\n", debugstr_a(proc) );
|
||||||
|
else
|
||||||
{
|
{
|
||||||
hPackage = alloc_msi_remote_handle( remote_package );
|
|
||||||
if (hPackage)
|
|
||||||
{
|
|
||||||
TRACE("calling %s\n", debugstr_a(proc));
|
|
||||||
handle_msi_break(proc);
|
handle_msi_break(proc);
|
||||||
|
|
||||||
__TRY
|
__TRY
|
||||||
{
|
{
|
||||||
r = custom_proc_wrapper(fn, hPackage);
|
r = custom_proc_wrapper( fn, hPackage );
|
||||||
}
|
}
|
||||||
__EXCEPT_PAGE_FAULT
|
__EXCEPT_PAGE_FAULT
|
||||||
{
|
{
|
||||||
ERR("Custom action (%s:%s) caused a page fault: %08x\n",
|
ERR( "Custom action (%s:%s) caused a page fault: %08x\n",
|
||||||
debugstr_w(dll), debugstr_a(proc), GetExceptionCode());
|
debugstr_w(dll), debugstr_a(proc), GetExceptionCode() );
|
||||||
r = ERROR_SUCCESS;
|
r = ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
__ENDTRY;
|
__ENDTRY;
|
||||||
|
|
||||||
MsiCloseHandle( hPackage );
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
ERR("failed to create handle for %x\n", remote_package );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ERR("GetProcAddress(%s) failed\n", debugstr_a(proc));
|
|
||||||
|
|
||||||
FreeLibrary(hModule);
|
FreeLibrary(hModule);
|
||||||
|
|
||||||
midl_user_free(dll);
|
midl_user_free(dll);
|
||||||
midl_user_free(proc);
|
midl_user_free(proc);
|
||||||
|
MsiCloseHandle(hPackage);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue