(SIGAR-207) Add Pdh.getCounterType method
This commit is contained in:
1 parent
7905904cb6
commit
2dc981dfa8
3 files changed
+43
No files matched your search
@@ -254,6 +254,23 @@ JNIEXPORT jstring SIGAR_JNI(win32_Pdh_pdhGetDescription)
|
||||
return retval;
|
||||
}
|
||||
|
||||
JNIEXPORT jlong SIGAR_JNI(win32_Pdh_pdhGetCounterType)
|
||||
(JNIEnv *env, jclass cur, jlong counter)
|
||||
{
|
||||
HCOUNTER h_counter = (HCOUNTER)counter;
|
||||
PDH_COUNTER_INFO info;
|
||||
DWORD size = sizeof(info);
|
||||
PDH_STATUS status;
|
||||
|
||||
status = PdhGetCounterInfo(h_counter, FALSE, &size, &info);
|
||||
if (status != ERROR_SUCCESS) {
|
||||
win32_throw_exception(env, get_error_message(status));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return info.dwType;
|
||||
}
|
||||
|
||||
JNIEXPORT jobjectArray SIGAR_JNI(win32_Pdh_pdhGetInstances)
|
||||
(JNIEnv *env, jclass cur, jstring cp)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user