Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 387 of file pdh_main.c.
{ struct query *query = handle; struct list *item, *next; TRACE("%p\n", handle); EnterCriticalSection( &pdh_handle_cs ); if (!query || query->magic != PDH_MAGIC_QUERY) { LeaveCriticalSection( &pdh_handle_cs ); return PDH_INVALID_HANDLE; } if (query->thread) { HANDLE thread = query->thread; SetEvent( query->stop ); LeaveCriticalSection( &pdh_handle_cs ); WaitForSingleObject( thread, INFINITE ); EnterCriticalSection( &pdh_handle_cs ); if (query->magic != PDH_MAGIC_QUERY) { LeaveCriticalSection( &pdh_handle_cs ); return ERROR_SUCCESS; } CloseHandle( query->stop ); CloseHandle( query->thread ); query->thread = NULL; } LIST_FOR_EACH_SAFE( item, next, &query->counters ) { struct counter *counter = LIST_ENTRY( item, struct counter, entry ); list_remove( &counter->entry ); destroy_counter( counter ); } destroy_query( query ); LeaveCriticalSection( &pdh_handle_cs ); return ERROR_SUCCESS; }