Top Description Inners Fields Methods
com.sun.jna.platform.win32

public Interface Pdh

extends StdCallLibrary
Imports
com.sun.jna.Native, .Pointer, .Structure, .Structure.FieldOrder, com.sun.jna.platform.win32.BaseTSD.DWORD_PTR, .WinBase.FILETIME, .WinDef.DWORDByReference, .WinDef.LONGLONGByReference, .WinNT.HANDLE, .WinNT.HANDLEByReference, com.sun.jna.win32.StdCallLibrary, .W32APIOptions

Windows Performance Data Helper (a.k.a. PDH).
Author
Lyor Goldstein
See Also
Performance Counters

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Pdh.PDH_COUNTER_PATH_ELEMENTS

Components of a counter path

public static class
Pdh.PDH_RAW_COUNTER

The data as it was collected from the counter provider.

public static class
Pdh.PDH_TIME_INFO

Information on time intervals as applied to the sampling of performance data.

Field Summary

Modifier and TypeField and Description
public static final Pdh
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
PDH_MAX_COUNTER_NAME

Maximum counter name length.

public static final int
PDH_MAX_COUNTER_PATH

Maximum full counter path length.

public static final int
PDH_MAX_DATASOURCE_PATH

Maximum full counter log name length.

public static final int
PDH_MAX_INSTANCE_NAME

Maximum counter instance name length.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
Inherited from com.sun.jna.win32.StdCallLibrary:
FUNCTION_MAPPERSTDCALL_CONVENTION

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

ERROR_SUCCESS if successful
PdhAddCounter
(WinNT.HANDLE
Handle to the query to which you want to add the counter.
hQuery
,
String
String that contains the counter path. The maximum length of a counter path is PDH_MAX_COUNTER_PATH.
szFullCounterPath
,
BaseTSD.DWORD_PTR
User-defined value.
dwUserData
,
WinNT.HANDLEByReference
(Out) Handle to the counter that was added to the query.
phCounter
)

Adds the specified counter to the query.

public int
PdhAddEnglishCounter(WinNT.HANDLE hQuery, String szFullCounterPath, BaseTSD.DWORD_PTR dwUserData, WinNT.HANDLEByReference phCounter)

public int

Returns:

ERROR_SUCCESS if successful
PdhCloseQuery
(WinNT.HANDLE
Handle to the query to close.
hQuery
)

Closes all counters contained in the specified query, closes all handles related to the query, and frees all memory associated with the query.

public int

Returns:

ERROR_SUCCESS if successful
PdhCollectQueryData
(WinNT.HANDLE
Handle to the query
hQuery
)

Collects the current raw data value for all counters in the specified query and updates the status code of each counter.

public int

Returns:

ERROR_SUCCESS if successful
PdhCollectQueryDataEx
(WinNT.HANDLE
Handle to the query
hQuery
,
int
Time interval to wait, in seconds.
dwIntervalTime
,
WinNT.HANDLE
Handle to the event that you want PDH to signal after the time interval expires. To create an event object, call the Kernel32#CreateEvent(com.sun.jna.platform.win32.WinBase.SECURITY_ATTRIBUTES, boolean, boolean, String) function
hNewDataEvent
)

Uses a separate thread to collect the current raw data value for all counters in the specified query.

public int

Returns:

ERROR_SUCCESS if successful
PdhCollectQueryDataWithTime
(WinNT.HANDLE
Handle to the query
hQuery
,
WinDef.LONGLONGByReference
Time stamp when the first counter value in the query was retrieved. The time is specified as WinBase.FILETIME.
pllTimeStamp
)

Collects the current raw data value for all counters in the specified query and updates the status code of each counter.

public int

Returns:

ERROR_SUCCESS if successful
PdhConnectMachine
(String
The name of the computer to connect to. If null, PDH connects to the local computer.
szMachineName
)

Connects to the specified computer.

public int

Returns:

If the function succeeds, it returns ERROR_SUCCESS. If the function fails, the return value is a system error code or a PDH error code.
PdhEnumObjectItems
(String
String that specifies the name of the log file used to enumerate the counter and instance names. If NULL, the function uses the computer specified in the szMachineName parameter to enumerate the names.
szDataSource
,
String
String that specifies the name of the computer that contains the counter and instance names that you want to enumerate. Include the leading slashes in the computer name, for example, \\computername. If the szDataSource parameter is NULL, you can set szMachineName to NULL to specify the local computer.
szMachineName
,
String
String that specifies the name of the object whose counter and instance names you want to enumerate.
szObjectName
,
Pointer
Caller-allocated buffer that receives a list of null-terminated counter names provided by the specified object. The list contains unique counter names. The list is terminated by two NULL characters. Set to NULL if the pcchCounterListLengthparameter is zero.
mszCounterList
,
WinDef.DWORDByReference
Size of the mszCounterList buffer, in TCHARs. If zero on input and the object exists, the function returns PDH_MORE_DATA and sets this parameter to the required buffer size. If the buffer is larger than the required size, the function sets this parameter to the actual size of the buffer that was used. If the specified size on input is greater than zero but less than the required size, you should not rely on the returned size to reallocate the buffer.
pcchCounterListLength
,
Pointer
Caller-allocated buffer that receives a list of null-terminated instance names provided by the specified object. The list contains unique instance names. The list is terminated by two NULL characters. Set to NULL if pcchInstanceListLength is zero.
mszInstanceList
,
WinDef.DWORDByReference
Size of the mszInstanceList buffer, in TCHARs. If zero on input and the object exists, the function returns PDH_MORE_DATA and sets this parameter to the required buffer size. If the buffer is larger than the required size, the function sets this parameter to the actual size of the buffer that was used. If the specified size on input is greater than zero but less than the required size, you should not rely on the returned size to reallocate the buffer. If the specified object does not support variable instances, then the returned value will be zero. If the specified object does support variable instances, but does not currently have any instances, then the value returned is 2, which is the size of an empty MULTI_SZ list string.
pcchInstanceListLength
,
int
Detail level of the performance items to return. All items that are of the specified detail level or less will be returned.
dwDetailLevel
,
int
This parameter must be zero.
dwFlags
)

Returns the specified object's counter and instance names that exist on the specified computer or in the specified log file.

public int

Returns:

ERROR_SUCCESS if successful
PdhGetDllVersion
(WinDef.DWORDByReference
A variable that receives the version of Pdh.dll.
lpdwVersion
)

Returns the version of the currently installed Pdh.dll file.

public int

Returns:

ERROR_SUCCESS if successful
PdhGetRawCounterValue
(WinNT.HANDLE
Handle of the counter from which to retrieve the current raw value.
hCounter
,
WinDef.DWORDByReference
Receives the counter type - this parameter is optional
lpdwType
,
Pdh.PDH_RAW_COUNTER
The PDH_RAW_COUNTER structure to receive the data
pValue
)

public int

Returns:

If the function succeeds, it returns ERROR_SUCCESS. If the function fails, the return value is a system error code or a PDH error code.
PdhLookupPerfIndexByName
(String
Null-terminated string that specifies the name of the computer where the specified counter is located. The computer name can be specified by the DNS name or the IP address. If NULL, the function uses the local computer.
szMachineName
,
String
Null-terminated string that contains the counter name.
szNameBuffer
,
WinDef.DWORDByReference
Index of the counter.
pdwIndex
)

Returns the counter index corresponding to the specified counter name.

public int

Returns:

If the function succeeds, it returns ERROR_SUCCESS. If the function fails, the return value is a system error code or a PDH error code.
PdhLookupPerfNameByIndex
(String
Null-terminated string that specifies the name of the computer where the specified performance object or counter is located. The computer name can be specified by the DNS name or the IP address. If NULL, the function uses the local computer.
szMachineName
,
int
Index of the performance object or counter.
dwNameIndex
,
Pointer
Caller-allocated buffer that receives the null-terminated name of the performance object or counter. Set to NULL if pcchNameBufferSize is zero.
szNameBuffer
,
WinDef.DWORDByReference
Size of the szNameBuffer buffer, in TCHARs. If zero on input, the function returns PDH_MORE_DATA and sets this parameter to the required buffer size. If the buffer is larger than the required size, the function sets this parameter to the actual size of the buffer that was used. If the specified size on input is greater than zero but less than the required size, you should not rely on the returned size to reallocate the buffer.
pcchNameBufferSize
)

Returns the performance object name or counter name corresponding to the specified index.

public int

Returns:

ERROR_SUCCESS (or PDH_MORE_DATA)
PdhMakeCounterPath
(Pdh.PDH_COUNTER_PATH_ELEMENTS
Structure that contains the members used to make up the path
pCounterPathElements
,
char[]
Caller-allocated buffer that receives a null-terminated counter path. The maximum length of a counter path is PDH_MAX_COUNTER_PATH. Set to null if pcchBufferSize is zero.
szFullPathBuffer
,
WinDef.DWORDByReference
Size of the szFullPathBuffer buffer. If zero on input, the function returns PDH_MORE_DATA and sets this parameter to the required buffer size. If the buffer is larger than the required size, the function sets this parameter to the actual size of the buffer that was used.
pcchBufferSize
,
int
Format of the input and output counter values.
dwFlags
)

Creates a full counter path using the members specified in the Pdh.PDH_COUNTER_PATH_ELEMENTS structure.

public int

Returns:

ERROR_SUCCESS if successful
PdhOpenQuery
(String
The name of the log file from which to retrieve performance data. If null, performance data is collected from a real-time data source.
szDataSource
,
BaseTSD.DWORD_PTR
User-defined value to associate with this query.
dwUserData
,
WinNT.HANDLEByReference
(Out) Handle to the query. You use this handle in subsequent calls.
phQuery
)

Creates a new query that is used to manage the collection of performance data.

public int

Returns:

ERROR_SUCCESS if successful
PdhRemoveCounter
(WinNT.HANDLE
Handle of the counter to remove from its query.
hCounter
)

Removes a counter from a query.

public int

Returns:

ERROR_SUCCESS if successful
PdhSetQueryTimeRange
(WinNT.HANDLE
Handle to the query.
hQuery
,
Pdh.PDH_TIME_INFO
A PDH_TIME_INFO structure that specifies the time range.
pInfo
)

public int

Returns:

ERROR_SUCCESS if successful
PdhValidatePath
(String
The counter path to validate
szFullCounterPath
)

Validates that the counter is present on the computer specified in the counter path.

Field Detail

INSTANCEback to summary
public static final Pdh INSTANCE
PDH_CSTATUS_NO_MACHINEback to summary
public static final int PDH_CSTATUS_NO_MACHINE
PDH_CSTATUS_NO_OBJECTback to summary
public static final int PDH_CSTATUS_NO_OBJECT
PDH_CVERSION_WIN40back to summary
public static final int PDH_CVERSION_WIN40
PDH_CVERSION_WIN50back to summary
public static final int PDH_CVERSION_WIN50
PDH_FMT_1000back to summary
public static final int PDH_FMT_1000
PDH_FMT_ANSIback to summary
public static final int PDH_FMT_ANSI
PDH_FMT_DOUBLEback to summary
public static final int PDH_FMT_DOUBLE
PDH_FMT_LARGEback to summary
public static final int PDH_FMT_LARGE
PDH_FMT_LONGback to summary
public static final int PDH_FMT_LONG
PDH_FMT_NOCAP100back to summary
public static final int PDH_FMT_NOCAP100
PDH_FMT_NODATAback to summary
public static final int PDH_FMT_NODATA
PDH_FMT_NOSCALEback to summary
public static final int PDH_FMT_NOSCALE
PDH_FMT_RAWback to summary
public static final int PDH_FMT_RAW
PDH_FMT_UNICODEback to summary
public static final int PDH_FMT_UNICODE
PDH_INSUFFICIENT_BUFFERback to summary
public static final int PDH_INSUFFICIENT_BUFFER
PDH_INVALID_ARGUMENTback to summary
public static final int PDH_INVALID_ARGUMENT
PDH_MAX_COUNTER_NAMEback to summary
public static final int PDH_MAX_COUNTER_NAME

Maximum counter name length.

PDH_MAX_COUNTER_PATHback to summary
public static final int PDH_MAX_COUNTER_PATH

Maximum full counter path length.

PDH_MAX_DATASOURCE_PATHback to summary
public static final int PDH_MAX_DATASOURCE_PATH

Maximum full counter log name length.

PDH_MAX_INSTANCE_NAMEback to summary
public static final int PDH_MAX_INSTANCE_NAME

Maximum counter instance name length.

PDH_MEMORY_ALLOCATION_FAILUREback to summary
public static final int PDH_MEMORY_ALLOCATION_FAILURE
PDH_MORE_DATAback to summary
public static final int PDH_MORE_DATA
PDH_PATH_WBEM_INPUTback to summary
public static final int PDH_PATH_WBEM_INPUT
PDH_PATH_WBEM_RESULTback to summary
public static final int PDH_PATH_WBEM_RESULT
PDH_VERSIONback to summary
public static final int PDH_VERSION
PERF_DETAIL_COSTLYback to summary
public static final int PERF_DETAIL_COSTLY
PERF_DETAIL_STANDARDback to summary
public static final int PERF_DETAIL_STANDARD

Method Detail

PdhAddCounterback to summary
public int PdhAddCounter(WinNT.HANDLE hQuery, String szFullCounterPath, BaseTSD.DWORD_PTR dwUserData, WinNT.HANDLEByReference phCounter)

Adds the specified counter to the query.

Parameters
hQuery:WinNT.HANDLE

Handle to the query to which you want to add the counter.

szFullCounterPath:String

String that contains the counter path. The maximum length of a counter path is PDH_MAX_COUNTER_PATH.

dwUserData:BaseTSD.DWORD_PTR

User-defined value.

phCounter:WinNT.HANDLEByReference

(Out) Handle to the counter that was added to the query.

Returns:int

ERROR_SUCCESS if successful

See Also
PdhAddCounter, Specifying a Counter Path
PdhAddEnglishCounterback to summary
public int PdhAddEnglishCounter(WinNT.HANDLE hQuery, String szFullCounterPath, BaseTSD.DWORD_PTR dwUserData, WinNT.HANDLEByReference phCounter)
PdhCloseQueryback to summary
public int PdhCloseQuery(WinNT.HANDLE hQuery)

Closes all counters contained in the specified query, closes all handles related to the query, and frees all memory associated with the query.

Parameters
hQuery:WinNT.HANDLE

Handle to the query to close.

Returns:int

ERROR_SUCCESS if successful

See Also
PdhCloseQuery
PdhCollectQueryDataback to summary
public int PdhCollectQueryData(WinNT.HANDLE hQuery)

Collects the current raw data value for all counters in the specified query and updates the status code of each counter.

Parameters
hQuery:WinNT.HANDLE

Handle to the query

Returns:int

ERROR_SUCCESS if successful

See Also
PdhCollectQueryData
PdhCollectQueryDataExback to summary
public int PdhCollectQueryDataEx(WinNT.HANDLE hQuery, int dwIntervalTime, WinNT.HANDLE hNewDataEvent)

Uses a separate thread to collect the current raw data value for all counters in the specified query. The function then signals the application-defined event and waits the specified time interval before returning.

Parameters
hQuery:WinNT.HANDLE

Handle to the query

dwIntervalTime:int

Time interval to wait, in seconds.

hNewDataEvent:WinNT.HANDLE

Handle to the event that you want PDH to signal after the time interval expires. To create an event object, call the Kernel32#CreateEvent(com.sun.jna.platform.win32.WinBase.SECURITY_ATTRIBUTES, boolean, boolean, String) function

Returns:int

ERROR_SUCCESS if successful

See Also
PdhCollectQueryDataEx
PdhCollectQueryDataWithTimeback to summary
public int PdhCollectQueryDataWithTime(WinNT.HANDLE hQuery, WinDef.LONGLONGByReference pllTimeStamp)

Collects the current raw data value for all counters in the specified query and updates the status code of each counter.

Parameters
hQuery:WinNT.HANDLE

Handle to the query

pllTimeStamp:WinDef.LONGLONGByReference

Time stamp when the first counter value in the query was retrieved. The time is specified as WinBase.FILETIME.

Returns:int

ERROR_SUCCESS if successful

See Also
PdhCollectQueryDataWithTime
PdhConnectMachineback to summary
public int PdhConnectMachine(String szMachineName)

Connects to the specified computer.

Parameters
szMachineName:String

The name of the computer to connect to. If null, PDH connects to the local computer.

Returns:int

ERROR_SUCCESS if successful

See Also
PdhConnectMachine
PdhEnumObjectItemsback to summary
public int PdhEnumObjectItems(String szDataSource, String szMachineName, String szObjectName, Pointer mszCounterList, WinDef.DWORDByReference pcchCounterListLength, Pointer mszInstanceList, WinDef.DWORDByReference pcchInstanceListLength, int dwDetailLevel, int dwFlags)

Returns the specified object's counter and instance names that exist on the specified computer or in the specified log file.

Parameters
szDataSource:String

String that specifies the name of the log file used to enumerate the counter and instance names. If NULL, the function uses the computer specified in the szMachineName parameter to enumerate the names.

szMachineName:String

String that specifies the name of the computer that contains the counter and instance names that you want to enumerate. Include the leading slashes in the computer name, for example, \\computername. If the szDataSource parameter is NULL, you can set szMachineName to NULL to specify the local computer.

szObjectName:String

String that specifies the name of the object whose counter and instance names you want to enumerate.

mszCounterList:Pointer

Caller-allocated buffer that receives a list of null-terminated counter names provided by the specified object. The list contains unique counter names. The list is terminated by two NULL characters. Set to NULL if the pcchCounterListLengthparameter is zero.

pcchCounterListLength:WinDef.DWORDByReference

Size of the mszCounterList buffer, in TCHARs. If zero on input and the object exists, the function returns PDH_MORE_DATA and sets this parameter to the required buffer size. If the buffer is larger than the required size, the function sets this parameter to the actual size of the buffer that was used. If the specified size on input is greater than zero but less than the required size, you should not rely on the returned size to reallocate the buffer.

mszInstanceList:Pointer

Caller-allocated buffer that receives a list of null-terminated instance names provided by the specified object. The list contains unique instance names. The list is terminated by two NULL characters. Set to NULL if pcchInstanceListLength is zero.

pcchInstanceListLength:WinDef.DWORDByReference

Size of the mszInstanceList buffer, in TCHARs. If zero on input and the object exists, the function returns PDH_MORE_DATA and sets this parameter to the required buffer size. If the buffer is larger than the required size, the function sets this parameter to the actual size of the buffer that was used. If the specified size on input is greater than zero but less than the required size, you should not rely on the returned size to reallocate the buffer. If the specified object does not support variable instances, then the returned value will be zero. If the specified object does support variable instances, but does not currently have any instances, then the value returned is 2, which is the size of an empty MULTI_SZ list string.

dwDetailLevel:int

Detail level of the performance items to return. All items that are of the specified detail level or less will be returned.

dwFlags:int

This parameter must be zero.

Returns:int

If the function succeeds, it returns ERROR_SUCCESS. If the function fails, the return value is a system error code or a PDH error code.

See Also
PdhEnumObjectItems
PdhGetDllVersionback to summary
public int PdhGetDllVersion(WinDef.DWORDByReference lpdwVersion)

Returns the version of the currently installed Pdh.dll file.

Parameters
lpdwVersion:WinDef.DWORDByReference

A variable that receives the version of Pdh.dll.

Returns:int

ERROR_SUCCESS if successful

See Also
PdhGetDllVersion
PdhGetRawCounterValueback to summary
public int PdhGetRawCounterValue(WinNT.HANDLE hCounter, WinDef.DWORDByReference lpdwType, Pdh.PDH_RAW_COUNTER pValue)
Parameters
hCounter:WinNT.HANDLE

Handle of the counter from which to retrieve the current raw value.

lpdwType:WinDef.DWORDByReference

Receives the counter type - this parameter is optional

pValue:Pdh.PDH_RAW_COUNTER

The PDH_RAW_COUNTER structure to receive the data

Returns:int

ERROR_SUCCESS if successful

See Also
PdhGetRawCounterValue
PdhLookupPerfIndexByNameback to summary
public int PdhLookupPerfIndexByName(String szMachineName, String szNameBuffer, WinDef.DWORDByReference pdwIndex)

Returns the counter index corresponding to the specified counter name.

Parameters
szMachineName:String

Null-terminated string that specifies the name of the computer where the specified counter is located. The computer name can be specified by the DNS name or the IP address. If NULL, the function uses the local computer.

szNameBuffer:String

Null-terminated string that contains the counter name.

pdwIndex:WinDef.DWORDByReference

Index of the counter.

Returns:int

If the function succeeds, it returns ERROR_SUCCESS. If the function fails, the return value is a system error code or a PDH error code.

See Also
PdhLookupPerfIndexByName
PdhLookupPerfNameByIndexback to summary
public int PdhLookupPerfNameByIndex(String szMachineName, int dwNameIndex, Pointer szNameBuffer, WinDef.DWORDByReference pcchNameBufferSize)

Returns the performance object name or counter name corresponding to the specified index.

Parameters
szMachineName:String

Null-terminated string that specifies the name of the computer where the specified performance object or counter is located. The computer name can be specified by the DNS name or the IP address. If NULL, the function uses the local computer.

dwNameIndex:int

Index of the performance object or counter.

szNameBuffer:Pointer

Caller-allocated buffer that receives the null-terminated name of the performance object or counter. Set to NULL if pcchNameBufferSize is zero.

pcchNameBufferSize:WinDef.DWORDByReference

Size of the szNameBuffer buffer, in TCHARs. If zero on input, the function returns PDH_MORE_DATA and sets this parameter to the required buffer size. If the buffer is larger than the required size, the function sets this parameter to the actual size of the buffer that was used. If the specified size on input is greater than zero but less than the required size, you should not rely on the returned size to reallocate the buffer.

Returns:int

If the function succeeds, it returns ERROR_SUCCESS. If the function fails, the return value is a system error code or a PDH error code.

See Also
PdhLookupPerfNameByIndex
PdhMakeCounterPathback to summary
public int PdhMakeCounterPath(Pdh.PDH_COUNTER_PATH_ELEMENTS pCounterPathElements, char[] szFullPathBuffer, WinDef.DWORDByReference pcchBufferSize, int dwFlags)

Creates a full counter path using the members specified in the Pdh.PDH_COUNTER_PATH_ELEMENTS structure.

Parameters
pCounterPathElements:Pdh.PDH_COUNTER_PATH_ELEMENTS

Structure that contains the members used to make up the path

szFullPathBuffer:char[]

Caller-allocated buffer that receives a null-terminated counter path. The maximum length of a counter path is PDH_MAX_COUNTER_PATH. Set to null if pcchBufferSize is zero.

pcchBufferSize:WinDef.DWORDByReference

Size of the szFullPathBuffer buffer. If zero on input, the function returns PDH_MORE_DATA and sets this parameter to the required buffer size. If the buffer is larger than the required size, the function sets this parameter to the actual size of the buffer that was used.

dwFlags:int

Format of the input and output counter values.

Returns:int

ERROR_SUCCESS (or PDH_MORE_DATA)

See Also
PdhMakeCounterPath
PdhOpenQueryback to summary
public int PdhOpenQuery(String szDataSource, BaseTSD.DWORD_PTR dwUserData, WinNT.HANDLEByReference phQuery)

Creates a new query that is used to manage the collection of performance data.

Parameters
szDataSource:String

The name of the log file from which to retrieve performance data. If null, performance data is collected from a real-time data source.

dwUserData:BaseTSD.DWORD_PTR

User-defined value to associate with this query.

phQuery:WinNT.HANDLEByReference

(Out) Handle to the query. You use this handle in subsequent calls.

Returns:int

ERROR_SUCCESS if successful

See Also
PdhOpenQuery
PdhRemoveCounterback to summary
public int PdhRemoveCounter(WinNT.HANDLE hCounter)

Removes a counter from a query.

Parameters
hCounter:WinNT.HANDLE

Handle of the counter to remove from its query.

Returns:int

ERROR_SUCCESS if successful

See Also
PdhRemoveCounter
PdhSetQueryTimeRangeback to summary
public int PdhSetQueryTimeRange(WinNT.HANDLE hQuery, Pdh.PDH_TIME_INFO pInfo)
Parameters
hQuery:WinNT.HANDLE

Handle to the query.

pInfo:Pdh.PDH_TIME_INFO

A PDH_TIME_INFO structure that specifies the time range.

Returns:int

ERROR_SUCCESS if successful

See Also
PdhSetQueryTimeRange
PdhValidatePathback to summary
public int PdhValidatePath(String szFullCounterPath)

Validates that the counter is present on the computer specified in the counter path.

Parameters
szFullCounterPath:String

The counter path to validate

Returns:int

ERROR_SUCCESS if successful

See Also
PdhValidatePath
com.sun.jna.platform.win32 back to summary

public Class Pdh.PDH_COUNTER_PATH_ELEMENTS

extends Structure
Class Inheritance
Annotations
@FieldOrder:szMachineName, szObjectName, szInstanceName, szParentInstance, dwInstanceIndex, szCounterName

Components of a counter path
See Also
PDH_COUNTER_PATH_ELEMENTS, Windows Server 2003 Performance Counters Reference

Field Summary

Modifier and TypeField and Description
public int
public String
public String
public String
public String
public String
Inherited from com.sun.jna.Structure:
ALIGN_DEFAULTALIGN_GNUCALIGN_MSVCALIGN_NONECALCULATE_SIZE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.jna.Structure:
allocateMemoryallocateMemoryautoAllocateautoReadautoReadautoWriteautoWritecacheTypeInfocalculateSizeclearcreateFieldsOrdercreateFieldsOrdercreateFieldsOrdercreateFieldsOrderdataEqualsdataEqualsensureAllocatedequalsfieldOffsetgetAutoReadgetAutoWritegetFieldListgetFieldOrdergetFieldsgetNativeAlignmentgetNativeSizegetNativeSizegetPointergetStringEncodinggetStructAlignmenthashCodenewInstancenewInstancereadreadFieldreadFieldsetAlignTypesetAutoReadsetAutoSynchsetAutoWritesetStringEncodingsizesortFieldstoArraytoArraytoStringtoStringuseMemoryuseMemorywritewriteFieldwriteFieldwriteField

Field Detail

dwInstanceIndexback to summary
public int dwInstanceIndex
szCounterNameback to summary
public String szCounterName
szInstanceNameback to summary
public String szInstanceName
szMachineNameback to summary
public String szMachineName
szObjectNameback to summary
public String szObjectName
szParentInstanceback to summary
public String szParentInstance

Constructor Detail

PDH_COUNTER_PATH_ELEMENTSback to summary
public PDH_COUNTER_PATH_ELEMENTS()
com.sun.jna.platform.win32 back to summary

public Class Pdh.PDH_RAW_COUNTER

extends Structure
Class Inheritance
Annotations
@FieldOrder:CStatus, TimeStamp, FirstValue, SecondValue, MultiCount

The data as it was collected from the counter provider. No translation, formatting, or other interpretation is performed on the data.
See Also
PDH_RAW_COUNTER

Field Summary

Modifier and TypeField and Description
public int
CStatus

Counter status that indicates if the counter value is valid.

public long
FirstValue

First raw counter value.

public int
MultiCount

If the counter type contains the PERF_MULTI_COUNTER flag, this member contains the additional counter data used in the calculation

public long
SecondValue

Second raw counter value.

public WinBase.FILETIME
TimeStamp

Local time for when the data was collected

Inherited from com.sun.jna.Structure:
ALIGN_DEFAULTALIGN_GNUCALIGN_MSVCALIGN_NONECALCULATE_SIZE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.jna.Structure:
allocateMemoryallocateMemoryautoAllocateautoReadautoReadautoWriteautoWritecacheTypeInfocalculateSizeclearcreateFieldsOrdercreateFieldsOrdercreateFieldsOrdercreateFieldsOrderdataEqualsdataEqualsensureAllocatedequalsfieldOffsetgetAutoReadgetAutoWritegetFieldListgetFieldOrdergetFieldsgetNativeAlignmentgetNativeSizegetNativeSizegetPointergetStringEncodinggetStructAlignmenthashCodenewInstancenewInstancereadreadFieldreadFieldsetAlignTypesetAutoReadsetAutoSynchsetAutoWritesetStringEncodingsizesortFieldstoArraytoArraytoStringtoStringuseMemoryuseMemorywritewriteFieldwriteFieldwriteField

Field Detail

CStatusback to summary
public int CStatus

Counter status that indicates if the counter value is valid.

FirstValueback to summary
public long FirstValue

First raw counter value.

MultiCountback to summary
public int MultiCount

If the counter type contains the PERF_MULTI_COUNTER flag, this member contains the additional counter data used in the calculation

SecondValueback to summary
public long SecondValue

Second raw counter value.

TimeStampback to summary
public WinBase.FILETIME TimeStamp

Local time for when the data was collected

Constructor Detail

PDH_RAW_COUNTERback to summary
public PDH_RAW_COUNTER()
com.sun.jna.platform.win32 back to summary

public Class Pdh.PDH_TIME_INFO

extends Structure
Class Inheritance
Annotations
@FieldOrder:StartTime, EndTime, SampleCount

Information on time intervals as applied to the sampling of performance data.
See Also
PDH_TIME_INFO

Field Summary

Modifier and TypeField and Description
public long
EndTime

Ending time of the sample interval, in local FILETIME format.

public int
SampleCount

Number of samples collected during the interval.

public long
StartTime

Starting time of the sample interval, in local FILETIME format.

Inherited from com.sun.jna.Structure:
ALIGN_DEFAULTALIGN_GNUCALIGN_MSVCALIGN_NONECALCULATE_SIZE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.jna.Structure:
allocateMemoryallocateMemoryautoAllocateautoReadautoReadautoWriteautoWritecacheTypeInfocalculateSizeclearcreateFieldsOrdercreateFieldsOrdercreateFieldsOrdercreateFieldsOrderdataEqualsdataEqualsensureAllocatedequalsfieldOffsetgetAutoReadgetAutoWritegetFieldListgetFieldOrdergetFieldsgetNativeAlignmentgetNativeSizegetNativeSizegetPointergetStringEncodinggetStructAlignmenthashCodenewInstancenewInstancereadreadFieldreadFieldsetAlignTypesetAutoReadsetAutoSynchsetAutoWritesetStringEncodingsizesortFieldstoArraytoArraytoStringtoStringuseMemoryuseMemorywritewriteFieldwriteFieldwriteField

Field Detail

EndTimeback to summary
public long EndTime

Ending time of the sample interval, in local FILETIME format.

SampleCountback to summary
public int SampleCount

Number of samples collected during the interval.

StartTimeback to summary
public long StartTime

Starting time of the sample interval, in local FILETIME format.

Constructor Detail

PDH_TIME_INFOback to summary
public PDH_TIME_INFO()