Package oshi.driver.windows.registry
Class SessionWtsData
- java.lang.Object
-
- oshi.driver.windows.registry.SessionWtsData
-
@ThreadSafe public final class SessionWtsData extends java.lang.Object
Utility to read process data from HKEY_PERFORMANCE_DATA information with backup from Performance Counters or WMI
-
-
Field Summary
Fields Modifier and Type Field Description private static booleanIS_VISTA_OR_GREATERprivate static com.sun.jna.platform.win32.Wtsapi32WTSprivate static intWTS_ACTIVEprivate static intWTS_CLIENTADDRESSprivate static intWTS_CLIENTPROTOCOLTYPEprivate static intWTS_SESSIONINFO
-
Constructor Summary
Constructors Modifier Constructor Description privateSessionWtsData()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static int[]convertBytesToInts(byte[] address)Per WTS_INFO_CLASS docs, the IP address is offset by two bytes from the start of the Address member of the WTS_CLIENT_ADDRESS structure.static java.util.List<OSSession>queryUserSessions()
-
-
-
Field Detail
-
WTS_ACTIVE
private static final int WTS_ACTIVE
- See Also:
- Constant Field Values
-
WTS_CLIENTADDRESS
private static final int WTS_CLIENTADDRESS
- See Also:
- Constant Field Values
-
WTS_SESSIONINFO
private static final int WTS_SESSIONINFO
- See Also:
- Constant Field Values
-
WTS_CLIENTPROTOCOLTYPE
private static final int WTS_CLIENTPROTOCOLTYPE
- See Also:
- Constant Field Values
-
IS_VISTA_OR_GREATER
private static final boolean IS_VISTA_OR_GREATER
-
WTS
private static final com.sun.jna.platform.win32.Wtsapi32 WTS
-
-
Method Detail
-
queryUserSessions
public static java.util.List<OSSession> queryUserSessions()
-
convertBytesToInts
private static int[] convertBytesToInts(byte[] address)
Per WTS_INFO_CLASS docs, the IP address is offset by two bytes from the start of the Address member of the WTS_CLIENT_ADDRESS structure. Also contrary to docs, IPv4 is not a null terminated string.This method converts the byte[20] to an int[4] parseable by existing code
- Parameters:
address- The 20-byte array from the WTS_CLIENT_ADDRESS structure- Returns:
- A 4-int array for
ParseUtil.parseUtAddrV6toIP(int[])
-
-