release mozctl_install_semaphore semaphore when the user doesn't want to download the mozilla control

svn path=/trunk/; revision=20881
This commit is contained in:
Martin Fuchs 2006-01-15 01:24:59 +00:00
parent 1eafbf2c6b
commit e592a21cc6

View file

@ -406,6 +406,7 @@ static BOOL SHDOCVW_TryDownloadMozillaControl(void)
WCHAR buf[0x100]; WCHAR buf[0x100];
static const WCHAR szTitle[] = { 'R','e','a','c','t','O','S',0 }; static const WCHAR szTitle[] = { 'R','e','a','c','t','O','S',0 };
HANDLE hsem; HANDLE hsem;
BOOL ret = TRUE;
SetLastError( ERROR_SUCCESS ); SetLastError( ERROR_SUCCESS );
hsem = CreateSemaphoreA( NULL, 0, 1, "mozctl_install_semaphore"); hsem = CreateSemaphoreA( NULL, 0, 1, "mozctl_install_semaphore");
@ -413,17 +414,18 @@ static BOOL SHDOCVW_TryDownloadMozillaControl(void)
{ {
LoadStringW( shdocvw_hinstance, 1001, buf, sizeof buf/sizeof(WCHAR) ); LoadStringW( shdocvw_hinstance, 1001, buf, sizeof buf/sizeof(WCHAR) );
r = MessageBoxW(NULL, buf, szTitle, MB_YESNO | MB_ICONQUESTION); r = MessageBoxW(NULL, buf, szTitle, MB_YESNO | MB_ICONQUESTION);
if( r != IDYES ) if( r == IDYES )
return FALSE;
DialogBoxW(shdocvw_hinstance, MAKEINTRESOURCEW(100), 0, dlProc); DialogBoxW(shdocvw_hinstance, MAKEINTRESOURCEW(100), 0, dlProc);
else
ret = FALSE;
} }
else else
WaitForSingleObject( hsem, INFINITE ); WaitForSingleObject( hsem, INFINITE );
ReleaseSemaphore( hsem, 1, NULL ); ReleaseSemaphore( hsem, 1, NULL );
CloseHandle( hsem ); CloseHandle( hsem );
return TRUE; return ret;
} }
static BOOL SHDOCVW_TryLoadMozillaControl(void) static BOOL SHDOCVW_TryLoadMozillaControl(void)