msi: Generalize the msi_custom_action_info struct so other custom actions can use it.

This commit is contained in:
James Hawkins 2007-04-15 03:10:00 -05:00 committed by Alexandre Julliard
parent 4cc48b7710
commit 06df9f790d
1 changed files with 13 additions and 13 deletions

View File

@ -412,8 +412,8 @@ static UINT wait_process_handle(MSIPACKAGE* package, UINT type,
typedef struct _msi_custom_action_info {
struct list entry;
MSIPACKAGE *package;
LPWSTR dllname;
LPWSTR function;
LPWSTR source;
LPWSTR target;
HANDLE handle;
LPWSTR action;
INT type;
@ -428,8 +428,8 @@ static void free_custom_action_data( msi_custom_action_info *info )
if (info->handle)
CloseHandle( info->handle );
msi_free( info->action );
msi_free( info->dllname );
msi_free( info->function );
msi_free( info->source );
msi_free( info->target );
msiobj_release( &info->package->hdr );
msi_free( info );
}
@ -497,16 +497,16 @@ static DWORD WINAPI ACTION_CallDllFunction( const GUID *guid )
return r;
}
TRACE("%s %s\n", debugstr_w( info->dllname ), debugstr_w( info->function ) );
TRACE("%s %s\n", debugstr_w( info->source ), debugstr_w( info->target ) );
hModule = LoadLibraryW( info->dllname );
hModule = LoadLibraryW( info->source );
if (!hModule)
{
ERR("failed to load dll %s\n", debugstr_w( info->dllname ) );
ERR("failed to load dll %s\n", debugstr_w( info->source ) );
return r;
}
proc = strdupWtoA( info->function );
proc = strdupWtoA( info->target );
fn = (MsiCustomActionEntryPoint) GetProcAddress( hModule, proc );
msi_free( proc );
if (fn)
@ -514,7 +514,7 @@ static DWORD WINAPI ACTION_CallDllFunction( const GUID *guid )
hPackage = alloc_msihandle( &info->package->hdr );
if (hPackage)
{
TRACE("calling %s\n", debugstr_w( info->function ) );
TRACE("calling %s\n", debugstr_w( info->target ) );
r = fn( hPackage );
MsiCloseHandle( hPackage );
}
@ -522,7 +522,7 @@ static DWORD WINAPI ACTION_CallDllFunction( const GUID *guid )
ERR("failed to create handle for %p\n", info->package );
}
else
ERR("GetProcAddress(%s) failed\n", debugstr_w( info->function ) );
ERR("GetProcAddress(%s) failed\n", debugstr_w( info->target ) );
FreeLibrary(hModule);
@ -549,7 +549,7 @@ static DWORD WINAPI DllThread( LPVOID arg )
}
static msi_custom_action_info *do_msidbCustomActionTypeDll(
MSIPACKAGE *package, INT type, LPCWSTR dllname, LPCWSTR function, LPCWSTR action )
MSIPACKAGE *package, INT type, LPCWSTR source, LPCWSTR target, LPCWSTR action )
{
msi_custom_action_info *info;
@ -560,8 +560,8 @@ static msi_custom_action_info *do_msidbCustomActionTypeDll(
msiobj_addref( &package->hdr );
info->package = package;
info->type = type;
info->function = strdupW( function );
info->dllname = strdupW( dllname );
info->target = strdupW( target );
info->source = strdupW( source );
info->action = strdupW( action );
CoCreateGuid( &info->guid );