msi: Don't wait on closed handles in ACTION_FinishCustomActions.

The handle will be closed by free_custom_action_data, so duplicate the 
handle before calling it.
This commit is contained in:
Rob Shearman 2007-04-03 17:35:40 +01:00 committed by Alexandre Julliard
parent 20171ac200
commit 3fbe9db433
1 changed files with 5 additions and 1 deletions

View File

@ -887,7 +887,8 @@ void ACTION_FinishCustomActions(MSIPACKAGE* package)
{
if (info->package == package )
{
wait_handles[handle_count++] = info->handle;
if (DuplicateHandle(GetCurrentProcess(), info->handle, GetCurrentProcess(), &wait_handles[handle_count], SYNCHRONIZE, FALSE, 0))
handle_count++;
free_custom_action_data( info );
}
}
@ -895,7 +896,10 @@ void ACTION_FinishCustomActions(MSIPACKAGE* package)
LeaveCriticalSection( &msi_custom_action_cs );
for (i = 0; i < handle_count; i++)
{
msi_dialog_check_messages( wait_handles[i] );
CloseHandle( wait_handles[i] );
}
HeapFree( GetProcessHeap(), 0, wait_handles );
}