-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pdh.go alway get incorrect data #12
Comments
/*
typedef long LONG;
typedef unsigned long DWORD;
typedef struct _PDH_FMT_COUNTERVALUE_DOUBLE
{
DWORD CStatus;
double DoubleValue;
}PDH_FMT_COUNTERVALUE_DOUBLE;
*/
import "C" this struct will be better |
That's weird. When I created the code (+ the example in the comments) it worked fine. When I try it right now myself, I also get garbled data. |
I'm also running into this using |
Code above will get processes count of windows. which usually in my system is around 60
but with
pdh.go
version I always get meaningless data. here is my code:here is the output
after some dig on this. I found out a solution:
pass in a c struct instead of go struct
here is the code:
I checked these counters they all give me correct data
The text was updated successfully, but these errors were encountered: