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.

    Nested classes/interfaces inherited from interface com.sun.jna.Library

    com.sun.jna.Library.Handler

    Nested classes/interfaces inherited from interface com.sun.jna.win32.StdCallLibrary

    com.sun.jna.win32.StdCallLibrary.StdCallCallback
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static Netapi32 INSTANCE  
    static int MAX_PREFERRED_LENGTH  

    Fields inherited from interface com.sun.jna.Library

    OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_CLASSLOADER, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRING_ENCODING, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER

    Fields inherited from interface com.sun.jna.win32.StdCallLibrary

    FUNCTION_MAPPER, STDCALL_CONVENTION
  • 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

  • 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 example SESSION_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 with ERROR_MORE_DATA.

      prefmaxlen - Specifies the preferred maximum length of returned data, in bytes. If you specify MAX_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 returns ERROR_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.