pdh: Fix two missing LeaveCriticalSection() on error paths.

This commit is contained in:
Michael Stefaniuc 2007-10-30 21:10:09 +01:00 committed by Alexandre Julliard
parent 1c7c9de498
commit 9056049882
1 changed files with 10 additions and 2 deletions

View File

@ -407,7 +407,11 @@ PDH_STATUS WINAPI PdhCloseQuery( PDH_HQUERY handle )
WaitForSingleObject( thread, INFINITE );
EnterCriticalSection( &pdh_handle_cs );
if (query->magic != PDH_MAGIC_QUERY) return ERROR_SUCCESS;
if (query->magic != PDH_MAGIC_QUERY)
{
LeaveCriticalSection( &pdh_handle_cs );
return ERROR_SUCCESS;
}
CloseHandle( query->stop );
CloseHandle( query->thread );
query->thread = NULL;
@ -530,7 +534,11 @@ PDH_STATUS WINAPI PdhCollectQueryDataEx( PDH_HQUERY handle, DWORD interval, HAND
WaitForSingleObject( thread, INFINITE );
EnterCriticalSection( &pdh_handle_cs );
if (query->magic != PDH_MAGIC_QUERY) return PDH_INVALID_HANDLE;
if (query->magic != PDH_MAGIC_QUERY)
{
LeaveCriticalSection( &pdh_handle_cs );
return PDH_INVALID_HANDLE;
}
CloseHandle( query->thread );
query->thread = NULL;
}