Rasapi32 (JNA API)

com.sun.jna.platform.win32

## Interface Rasapi32

- All Superinterfaces:
    AltCallingConvention, Library, StdCall, StdCallLibrary

      public interface Rasapi32
      extends StdCallLibrary

  Rasapi32.dll Interface.

- - ### Nested Class Summary

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

      `StdCallLibrary.StdCallCallback`

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

      `Library.Handler`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Rasapi32` | `INSTANCE`

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

      `FUNCTION_MAPPER, STDCALL_CONVENTION`

    - ### 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`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `RasDial(WinRas.RASDIALEXTENSIONS.ByReference lpRasDialExtensions, java.lang.String lpszPhonebook, WinRas.RASDIALPARAMS.ByReference lpRasDialParams, int dwNotifierType, WinRas.RasDialFunc2 lpvNotifier, WinNT.HANDLEByReference lphRasConn)` The RasDial function establishes a RAS connection between a RAS client and a RAS server.
    `int` | `RasEnumConnections(WinRas.RASCONN[] lprasconn, IntByReference lpcb, IntByReference lpcConnections)` The RasEnumConnections function lists all active RAS connections.
    `int` | `RasGetConnectionStatistics(WinNT.HANDLE hrasconn, Structure.ByReference lpStatistics)` The RasGetConnectionStatistics function retrieves accumulated connection statistics for the specified connection.
    `int` | `RasGetConnectStatus(WinNT.HANDLE hrasconn, Structure.ByReference lprasconnstatus)` The RasGetConnectionStatistics function retrieves accumulated connection statistics for the specified connection.
    `int` | `RasGetCredentials(java.lang.String lpszPhonebook, java.lang.String lpszEntry, WinRas.RASCREDENTIALS.ByReference lpCredentials)` The RasGetCredentials function retrieves the user credentials associated with a specified RAS phone-book entry.
    `int` | `RasGetEntryDialParams(java.lang.String lpszPhonebook, WinRas.RASDIALPARAMS.ByReference lprasdialparams, WinDef.BOOLByReference lpfPassword)` The RasGetEntryDialParams function retrieves the connection information saved by the last successful call to the RasDial or RasSetEntryDialParams function for a specified phone-book entry.
    `int` | `RasGetEntryProperties(java.lang.String lpszPhonebook, java.lang.String lpszEntry, WinRas.RASENTRY.ByReference lpRasEntry, IntByReference lpdwEntryInfoSize, Pointer lpbDeviceInfo, Pointer lpdwDeviceInfoSize)` The RasGetEntryProperties function retrieves the properties of a phone-book entry.
    `int` | `RasGetErrorString(int uErrorValue, char[] lpszErrorString, int cBufSize)` The RasGetErrorString function obtains an error message string for a specified RAS error value.
    `int` | `RasGetProjectionInfo(WinNT.HANDLE hrasconn, int rasprojection, Pointer lpprojection, IntByReference lpcb)` The RasGetProjectionInfo function obtains information about a remote access projection operation for a specified remote access component protocol.
    `int` | `RasHangUp(WinNT.HANDLE hrasconn)` The RasHangUp function terminates a remote access connection.
    `int` | `RasSetEntryProperties(java.lang.String lpszPhonebook, java.lang.String lpszEntry, WinRas.RASENTRY.ByReference lpRasEntry, int dwEntryInfoSize, byte[] lpbDeviceInfo, int dwDeviceInfoSize)` The RasSetEntryProperties function changes the connection information for an entry in the phone book or creates a new phone-book entry.

- - ### Field Detail

    - #### INSTANCE

          static final Rasapi32 INSTANCE

  - ### Method Detail

    - #### RasDial

          int RasDial(WinRas.RASDIALEXTENSIONS.ByReference lpRasDialExtensions,
                    java.lang.String lpszPhonebook,
                    WinRas.RASDIALPARAMS.ByReference lpRasDialParams,
                    int dwNotifierType,
                    WinRas.RasDialFunc2 lpvNotifier,
                    WinNT.HANDLEByReference lphRasConn)

      The RasDial function establishes a RAS connection between a RAS client and a RAS server. The connection data includes callback and user-authentication information.
      Parameters:
        `lpRasDialExtensions` - Pointer to a RASDIALEXTENSIONS structure that specifies a set of RasDial extended features to enable. Set this parameter to NULL if there is not a need to enable these features.
        `lpszPhonebook` - Pointer to a null-terminated string that specifies the full path and file name of a phone-book (PBK) file. If this parameter is NULL, the function uses the current default phone-book file. The default phone-book file is the one selected by the user in the User Preferences property sheet of the Dial-Up Networking dialog box.
        `lpRasDialParams` - Pointer to a RASDIALPARAMS structure that specifies calling parameters for the RAS connection. Use the RasGetEntryDialParams function to retrieve a copy of this structure for a particular phone-book entry.
        `dwNotifierType` - Specifies the nature of the lpvNotifier parameter. If lpvNotifier is NULL, dwNotifierType is ignored. If lpvNotifier is not NULL, set dwNotifierType to one of the following values.
        `lpvNotifier` - Specifies a window handle or a RasDialFunc, RasDialFunc1, or RasDialFunc2 callback function to receive RasDial event notifications. The dwNotifierType parameter specifies the nature of lpvNotifier. Please refer to its description preceding for further detail.
        `lphRasConn` - Pointer to a variable of type HRASCONN. Set the HRASCONN variable to NULL before calling RasDial. If RasDial succeeds, it stores a handle to the RAS connection into *lphRasConn.
      Returns:
        If the function succeeds, the return value is ERROR_SUCCESS.

    - #### RasEnumConnections

          int RasEnumConnections(WinRas.RASCONN[] lprasconn,
                               IntByReference lpcb,
                               IntByReference lpcConnections)

      The RasEnumConnections function lists all active RAS connections. It returns each connection's handle and phone-book entry name.
      Parameters:
        `lprasconn` - Pointer to a buffer that receives, on output, an array of RASCONN structures, one for each RAS connection. On input, an application must set the dwSize member of the first RASCONN structure in the buffer to sizeof(RASCONN) in order to identify the version of the structure being passed.
        `lpcb` - Pointer to a variable that, on input, contains the size, in bytes, of the buffer specified by lprasconn. On output, the function sets this variable to the number of bytes required to enumerate the RAS connections.
        `lpcConnections` - Pointer to a variable that receives the number of RASCONN structures written to the buffer specified by lprasconn.
      Returns:
        If the function succeeds, the return value is ERROR_SUCCESS.

    - #### RasGetConnectionStatistics

          int RasGetConnectionStatistics(WinNT.HANDLE hrasconn,
                                       Structure.ByReference lpStatistics)

      The RasGetConnectionStatistics function retrieves accumulated connection statistics for the specified connection.
      Parameters:
        `hrasconn` - Handle to the connection. Use RasDial or RasEnumConnections to obtain this handle.
        `lpStatistics` - Pointer to the RASCONNSTATUS structure that, on output, receives the status information. On input, set the dwSize member of the structure to sizeof(RASCONNSTATUS) in order to identify the version of the structure being passed.
      Returns:
        If the function succeeds, the return value is ERROR_SUCCESS.

    - #### RasGetConnectStatus

          int RasGetConnectStatus(WinNT.HANDLE hrasconn,
                                Structure.ByReference lprasconnstatus)

      The RasGetConnectionStatistics function retrieves accumulated connection statistics for the specified connection.
      Parameters:
        `hrasconn` - Specifies the remote access connection for which to retrieve the status. This handle must have been obtained from RasDial or RasEnumConnections.
        `lprasconnstatus` - Pointer to the RASCONNSTATUS structure that, on output, receives the status information. On input, set the dwSize member of the structure to sizeof(RASCONNSTATUS) in order to identify the version of the structure being passed.
      Returns:
        If the function succeeds, the return value is ERROR_SUCCESS.

    - #### RasGetCredentials

          int RasGetCredentials(java.lang.String lpszPhonebook,
                              java.lang.String lpszEntry,
                              WinRas.RASCREDENTIALS.ByReference lpCredentials)

      The RasGetCredentials function retrieves the user credentials associated with a specified RAS phone-book entry.
      Parameters:
        `lpszPhonebook` - Pointer to a null-terminated string that specifies the full path and file name of a phone-book (PBK) file. If this parameter is NULL, the function uses the current default phone-book file. The default phone-book file is the one selected by the user in the User Preferences property sheet of the Dial-Up Networking dialog box.
        `lpszEntry` - Pointer to a null-terminated string that specifies the name of a phone-book entry.
        `lpCredentials` - Pointer to the RASCREDENTIALS structure that, on output, receives the user credentials associated with the specified phone-book entry. On input, set the dwSize member of the structure to sizeof(RASCREDENTIALS), and set the dwMask member to indicate the credential information to retrieve. When the function returns, dwMask indicates the members that were successfully retrieved.
      Returns:
        If the function succeeds, the return value is ERROR_SUCCESS.

    - #### RasGetEntryProperties

          int RasGetEntryProperties(java.lang.String lpszPhonebook,
                                  java.lang.String lpszEntry,
                                  WinRas.RASENTRY.ByReference lpRasEntry,
                                  IntByReference lpdwEntryInfoSize,
                                  Pointer lpbDeviceInfo,
                                  Pointer lpdwDeviceInfoSize)

      The RasGetEntryProperties function retrieves the properties of a phone-book entry.
      Parameters:
        `lpszPhonebook` - Pointer to a null-terminated string that specifies the full path and file name of a phone-book (PBK) file. If this parameter is NULL, the function uses the current default phone-book file. The default phone-book file is the one selected by the user in the User Preferences property sheet of the Dial-Up Networking dialog box.
        `lpszEntry` - Pointer to a null-terminated string that specifies an existing entry name. If an empty string is specified, the function returns default values in the buffers pointed to by the lpRasEntry and lpbDeviceInfo parameters.
        `lpRasEntry` - Pointer to a RASENTRY structure followed by additional bytes for the alternate phone number list, if there is one.
        `lpdwEntryInfoSize` - Pointer to a variable that, on input, specifies the size, in bytes, of the lpRasEntry buffer.
        `lpbDeviceInfo` - This parameter is no longer used. The calling function should set this parameter to NULL.
        `lpdwDeviceInfoSize` - This parameter is unused. The calling function should set this parameter to NULL.
      Returns:
        If the function succeeds, the return value is ERROR_SUCCESS.

    - #### RasGetProjectionInfo

          int RasGetProjectionInfo(WinNT.HANDLE hrasconn,
                                 int rasprojection,
                                 Pointer lpprojection,
                                 IntByReference lpcb)

      The RasGetProjectionInfo function obtains information about a remote access projection operation for a specified remote access component protocol.
      Parameters:
        `hrasconn` - Handle to the remote access connection of interest. An application obtains a RAS connection handle from the RasDial or RasEnumConnections function.
        `rasprojection` - Specifies the RASPROJECTION enumerated type value that identifies the protocol of interest.
        `lpprojection` - Pointer to a buffer that receives the information specified by the rasprojection parameter. The information is in a structure appropriate to the rasprojection value.
        `lpcb` - Pointer to a variable that, on input, specifies the size, in bytes, of the buffer pointed to by lpprojection. On output, this variable receives the size, in bytes, of the lpprojection buffer.
      Returns:
        If the function succeeds, the return value is ERROR_SUCCESS.

    - #### RasHangUp

          int RasHangUp(WinNT.HANDLE hrasconn)

      The RasHangUp function terminates a remote access connection. The connection is specified with a RAS connection handle. The function releases all RASAPI32.DLL resources associated with the handle.
      Parameters:
        `hrasconn` - Specifies the remote access connection to terminate. This is a handle returned from a previous call to RasDial or RasEnumConnections.
      Returns:
        If the function succeeds, the return value is ERROR_SUCCESS.

    - #### RasSetEntryProperties

          int RasSetEntryProperties(java.lang.String lpszPhonebook,
                                  java.lang.String lpszEntry,
                                  WinRas.RASENTRY.ByReference lpRasEntry,
                                  int dwEntryInfoSize,
                                  byte[] lpbDeviceInfo,
                                  int dwDeviceInfoSize)

      The RasSetEntryProperties function changes the connection information for an entry in the phone book or creates a new phone-book entry.
      Parameters:
        `lpszPhonebook` - Pointer to a null-terminated string that specifies the full path and file name of a phone-book (PBK) file. If this parameter is NULL, the function uses the current default phone-book file. The default phone-book file is the one selected by the user in the User Preferences property sheet of the Dial-Up Networking dialog box.
        `lpszEntry` - Pointer to a null-terminated string that specifies an entry name.
        `lpRasEntry` - Pointer to the RASENTRY structure that specifies the new connection data to be associated with the phone-book entry indicated by the lpszEntry parameter.
        `dwEntryInfoSize` - Specifies the size, in bytes, of the buffer identified by the lpRasEntry parameter.
        `lpbDeviceInfo` - Pointer to a buffer that specifies device-specific configuration information. This is opaque TAPI device configuration information. For more information about TAPI device configuration, see the lineGetDevConfig function in Telephony Application Programming Interfaces (TAPI) in the Platform SDK.
        `dwDeviceInfoSize` - Specifies the size, in bytes, of the lpbDeviceInfo buffer.
      Returns:
        If the function succeeds, the return value is ERROR_SUCCESS.

    - #### RasGetEntryDialParams

          int RasGetEntryDialParams(java.lang.String lpszPhonebook,
                                  WinRas.RASDIALPARAMS.ByReference lprasdialparams,
                                  WinDef.BOOLByReference lpfPassword)

      The RasGetEntryDialParams function retrieves the connection information saved by the last successful call to the RasDial or RasSetEntryDialParams function for a specified phone-book entry.
      Parameters:
        `lpszPhonebook` - Pointer to a null-terminated string that specifies the full path and file name of a phone-book (PBK) file. If this parameter is NULL, the function uses the current default phone-book file. The default phone-book file is the one selected by the user in the User Preferences property sheet of the Dial-Up Networking dialog box.
        `lprasdialparams` - Pointer to a RASDIALPARAMS structure.
        `lpfPassword` - Pointer to a flag that indicates whether the function retrieved the password associated with the user name for the phone-book entry. The lpfPassword parameter is TRUE if the system has saved a password for the specified entry. If the system has no password saved for this entry, lpfPassword is FALSE.
      Returns:
        If the function succeeds, the return value is ERROR_SUCCESS.

    - #### RasGetErrorString

          int RasGetErrorString(int uErrorValue,
                              char[] lpszErrorString,
                              int cBufSize)

      The RasGetErrorString function obtains an error message string for a specified RAS error value.
      Parameters:
        `uErrorValue` - Specifies the error value of interest. These are values returned by one of the RAS functions: those listed in the RasError.h header file.
        `lpszErrorString` - Pointer to a buffer that receives the error string. This parameter must not be NULL.
        `cBufSize` - Specifies the size, in characters, of the buffer pointed to by lpszErrorString.
      Returns:
        status

Copyright © 2007-2016 Timothy Wall. All Rights Reserved.