Hans Leidekker (@hans) commented about dlls/pdh/pdh_main.c:
+/*********************************************************************** + * PdhVbGetDoubleCounterValue (PDH.@) + */ +double WINAPI PdhVbGetDoubleCounterValue( PDH_HCOUNTER handle, PDH_STATUS *counter_status ) +{ + PDH_FMT_COUNTERVALUE value; + PDH_STATUS status; + + TRACE( "%p %p\n", handle, counter_status ); + + status = PdhGetFormattedCounterValue( handle, PDH_FMT_DOUBLE, NULL, &value ); + if (counter_status) *counter_status = ( status == ERROR_SUCCESS ) ? value.CStatus : status; + + return ( status == ERROR_SUCCESS ) ? value.u.doubleValue : 0.0; +}
This could be simplified like this: `` double WINAPI PdhVbGetDoubleCounterValue( PDH_HCOUNTER handle, PDH_STATUS *counter_status ) { PDH_FMT_COUNTERVALUE value; PDH_STATUS status; TRACE( "%p %p\n", handle, counter_status ); memset( &value, 0, sizeof(value) ); status = PdhGetFormattedCounterValue( handle, PDH_FMT_DOUBLE, NULL, &value ); if (counter_status) *counter_status = status; return value.u.doubleValue; } `` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2337#note_26305