Package oshi.jna.platform.windows
Interface Netapi32
- All Superinterfaces:
com.sun.jna.AltCallingConvention
,com.sun.jna.Library
,com.sun.jna.platform.win32.Netapi32
,com.sun.jna.win32.StdCall
,com.sun.jna.win32.StdCallLibrary
public interface Netapi32
extends com.sun.jna.platform.win32.Netapi32
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Netapi32.SESSION_INFO_10
Contains information about the session, including name of the computer; name of the user; and active and idle times for the session. -
Field Summary
Fields Modifier and Type Field Description static Netapi32
INSTANCE
static int
MAX_PREFERRED_LENGTH
-
Method Summary
Modifier and Type Method Description int
NetSessionEnum(com.sun.jna.WString servername, com.sun.jna.WString UncClientName, com.sun.jna.WString username, int level, com.sun.jna.ptr.PointerByReference bufptr, int prefmaxlen, com.sun.jna.ptr.IntByReference entriesread, com.sun.jna.ptr.IntByReference totalentries, com.sun.jna.ptr.IntByReference resume_handle)
Provides information about sessions established on a server.Methods inherited from interface com.sun.jna.platform.win32.Netapi32
DsEnumerateDomainTrusts, DsGetDcName, DsGetForestTrustInformation, NetApiBufferFree, NetGetDCName, NetGetJoinInformation, NetGroupEnum, NetLocalGroupEnum, NetShareAdd, NetShareDel, NetUserAdd, NetUserChangePassword, NetUserDel, NetUserEnum, NetUserGetGroups, NetUserGetInfo, NetUserGetLocalGroups
-
Field Details
-
INSTANCE
-
MAX_PREFERRED_LENGTH
static final int MAX_PREFERRED_LENGTH- See Also:
- Constant Field Values
-
-
Method Details
-
NetSessionEnum
int NetSessionEnum(com.sun.jna.WString servername, com.sun.jna.WString UncClientName, com.sun.jna.WString username, int level, com.sun.jna.ptr.PointerByReference bufptr, int prefmaxlen, com.sun.jna.ptr.IntByReference entriesread, com.sun.jna.ptr.IntByReference totalentries, com.sun.jna.ptr.IntByReference resume_handle)Provides information about sessions established on a server.- Parameters:
servername
- Pointer to a string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used.UncClientName
- Pointer to a string that specifies the name of the computer session for which information is to be returned. If this parameter is NULL, NetSessionEnum returns information for all computer sessions on the server.username
- Pointer to a string that specifies the name of the user for which information is to be returned. If this parameter is NULL, NetSessionEnum returns information for all users.level
- Specifies the information level of the data. This parameter can be one of 0, 1, 2, 10, 502.bufptr
- Pointer to the buffer that receives the data. The format of this data depends on the value of the level parameter, for exampleSESSION_INFO_0
for level 0.This buffer is allocated by the system and must be freed using the
Netapi32.NetApiBufferFree(com.sun.jna.Pointer)
function. Note that you must free the buffer even if the function fails withERROR_MORE_DATA
.prefmaxlen
- Specifies the preferred maximum length of returned data, in bytes. If you specifyMAX_PREFERRED_LENGTH
, the function allocates the amount of memory required for the data. If you specify another value in this parameter, it can restrict the number of bytes that the function returns. If the buffer size is insufficient to hold all entries, the function returnsERROR_MORE_DATA
.entriesread
- Pointer to a value that receives the count of elements actually enumerated.totalentries
- Pointer to a value that receives the total number of entries that could have been enumerated from the current resume position. Note that applications should consider this value only as a hint.resume_handle
- Pointer to a value that contains a resume handle which is used to continue an existing session search. The handle should be zero on the first call and left unchanged for subsequent calls. If resume_handle is NULL, no resume handle is stored.- Returns:
- If the function succeeds, the return value is NERR_Success (0). If the function fails, the return value is an error code.
-