Module: wine Branch: stable Commit: c747c1f2586bc2bbc67046a80a9100080336090c URL: https://gitlab.winehq.org/wine/wine/-/commit/c747c1f2586bc2bbc67046a80a91000...
Author: Mohamad Al-Jaf mohamadaljaf@gmail.com Date: Tue Nov 1 20:49:41 2022 -0500
pdh: Implement PdhVbGetDoubleCounterValue().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54618 (cherry picked from commit e1c59cc5621a8d3420fc30314fd8daa5c6e55a26)
---
dlls/pdh/pdh.spec | 2 +- dlls/pdh/pdh_main.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/dlls/pdh/pdh.spec b/dlls/pdh/pdh.spec index 5f61a8a42ca..711c970029b 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(ptr ptr) @ stub PdhVbGetLogFileSize @ stub PdhVbGetOneCounterPath @ stub PdhVbIsGoodStatus diff --git a/dlls/pdh/pdh_main.c b/dlls/pdh/pdh_main.c index 7eae7872b48..121b7e712ce 100644 --- a/dlls/pdh/pdh_main.c +++ b/dlls/pdh/pdh_main.c @@ -1062,6 +1062,23 @@ PDH_STATUS WINAPI PdhVbAddCounter( PDH_HQUERY query, LPCSTR path, PDH_HCOUNTER * return PDH_NOT_IMPLEMENTED; }
+/*********************************************************************** + * 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 ); + + memset( &value, 0, sizeof(value) ); + status = PdhGetFormattedCounterValue( handle, PDH_FMT_DOUBLE, NULL, &value ); + + if (counter_status) *counter_status = status; + return value.u.doubleValue; +} + /*********************************************************************** * PdhValidatePathExA (PDH.@) */