https://bugs.winehq.org/show_bug.cgi?id=54618
--- Comment #2 from Mohamad Al-Jaf mowinebugs@mail.com --- Comment on attachment 74160 --> https://bugs.winehq.org/attachment.cgi?id=74160 Implement PdhVbGetDoubleCounterValue
From 482b428ad04345fc9bd2d5dd44247d36bb743b3e Mon Sep 17 00:00:00 2001 From: Mohamad Al-Jaf mohamadaljaf@gmail.com Date: Tue, 1 Nov 2022 20:49:00 -0500 Subject: [PATCH 1/2] pdh: Implement PdhVbGetDoubleCounterValue().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54618
dlls/pdh/pdh.spec | 2 +- dlls/pdh/pdh_main.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/pdh/pdh.spec b/dlls/pdh/pdh.spec index 5f61a8a42ca..c4a32f0cc08 100644 --- a/dlls/pdh/pdh.spec +++ b/dlls/pdh/pdh.spec @@ -145,7 +145,7 @@ @ stub PdhVbCreateCounterPathList @ stub PdhVbGetCounterPathElements @ stub PdhVbGetCounterPathFromList -@ stub PdhVbGetDoubleCounterValue +@ stdcall PdhVbGetDoubleCounterValue(long ptr) @ stub PdhVbGetLogFileSize @ stub PdhVbGetOneCounterPath @ stub PdhVbIsGoodStatus diff --git a/dlls/pdh/pdh_main.c b/dlls/pdh/pdh_main.c index 7eae7872b48..de59ec727cf 100644 --- a/dlls/pdh/pdh_main.c +++ b/dlls/pdh/pdh_main.c @@ -1062,6 +1062,22 @@ PDH_STATUS WINAPI PdhVbAddCounter( PDH_HQUERY query, LPCSTR path, PDH_HCOUNTER * return PDH_NOT_IMPLEMENTED; }
+/***********************************************************************
PdhVbGetDoubleCounterValue (PDH.@)
- */
+double WINAPI PdhVbGetDoubleCounterValue( LONG handle, LONG *counter_status ) +{
- PDH_FMT_COUNTERVALUE value;
- PDH_STATUS status;
- TRACE( "%ld %p\n", handle, counter_status );
- status = PdhGetFormattedCounterValue( UlongToPtr(handle), PDH_FMT_DOUBLE, NULL, &value );
- if (counter_status) *counter_status = ( status == ERROR_SUCCESS ) ? value.CStatus : status;
- return status == ERROR_SUCCESS && ( value.CStatus == PDH_CSTATUS_VALID_DATA || value.CStatus == PDH_CSTATUS_NEW_DATA ) ? value.u.doubleValue : 0.0;
+}
/***********************************************************************
PdhValidatePathExA (PDH.@)
*/
2.39.2