From 3fbe9db433519a67d2378fc031ea182966ca6c5f Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Tue, 3 Apr 2007 17:35:40 +0100 Subject: [PATCH] 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. --- dlls/msi/custom.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c index 48a07691c62..d1d492ca147 100644 --- a/dlls/msi/custom.c +++ b/dlls/msi/custom.c @@ -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 ); }