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

public Interface Rasapi32

extends StdCallLibrary
Imports
com.sun.jna.Native, .Pointer, com.sun.jna.platform.win32.WinDef.BOOLByReference, .WinNT.HANDLE, .WinNT.HANDLEByReference, .WinRas.RASCONN, .WinRas.RASCONNSTATUS, .WinRas.RASCREDENTIALS, .WinRas.RASDIALEXTENSIONS, .WinRas.RASDIALPARAMS, .WinRas.RASENTRY, .WinRas.RAS_STATS, .WinRas.RasDialFunc2, com.sun.jna.ptr.IntByReference, com.sun.jna.win32.StdCallLibrary, .W32APIOptions

Rasapi32.dll Interface.

Field Summary

Modifier and TypeField and Description
public static final Rasapi32
Inherited from com.sun.jna.win32.StdCallLibrary:
FUNCTION_MAPPERSTDCALL_CONVENTION

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

If the function succeeds, the return value is ERROR_SUCCESS.
RasDial
(WinRas.RASDIALEXTENSIONS.ByReference
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.
lpRasDialExtensions
,
String
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.
lpszPhonebook
,
WinRas.RASDIALPARAMS.ByReference
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.
lpRasDialParams
,
int
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.
dwNotifierType
,
WinRas.RasDialFunc2
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.
lpvNotifier
,
WinNT.HANDLEByReference
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.
lphRasConn
)

The RasDial function establishes a RAS connection between a RAS client and a RAS server.

public int

Returns:

If the function succeeds, the return value is ERROR_SUCCESS.
RasEnumConnections
(WinRas.RASCONN[]
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.
lprasconn
,
IntByReference
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.
lpcb
,
IntByReference
Pointer to a variable that receives the number of RASCONN structures written to the buffer specified by lprasconn.
lpcConnections
)

The RasEnumConnections function lists all active RAS connections.

public int

Returns:

If the function succeeds, the return value is ERROR_SUCCESS.
RasGetConnectionStatistics
(WinNT.HANDLE
Handle to the connection. Use RasDial or RasEnumConnections to obtain this handle.
hrasconn
,
Structure.ByReference
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.
lpStatistics
)

The RasGetConnectionStatistics function retrieves accumulated connection statistics for the specified connection.

public int

Returns:

If the function succeeds, the return value is ERROR_SUCCESS.
RasGetConnectStatus
(WinNT.HANDLE
Specifies the remote access connection for which to retrieve the status. This handle must have been obtained from RasDial or RasEnumConnections.
hrasconn
,
Structure.ByReference
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.
lprasconnstatus
)

The RasGetConnectionStatistics function retrieves accumulated connection statistics for the specified connection.

public int

Returns:

If the function succeeds, the return value is ERROR_SUCCESS.
RasGetCredentials
(String
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.
lpszPhonebook
,
String
Pointer to a null-terminated string that specifies the name of a phone-book entry.
lpszEntry
,
WinRas.RASCREDENTIALS.ByReference
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.
lpCredentials
)

The RasGetCredentials function retrieves the user credentials associated with a specified RAS phone-book entry.

public int

Returns:

If the function succeeds, the return value is ERROR_SUCCESS.
RasGetEntryDialParams
(String
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.
lpszPhonebook
,
WinRas.RASDIALPARAMS.ByReference
Pointer to a RASDIALPARAMS structure.
lprasdialparams
,
WinDef.BOOLByReference
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.
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.

public int

Returns:

If the function succeeds, the return value is ERROR_SUCCESS.
RasGetEntryProperties
(String
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.
lpszPhonebook
,
String
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.
lpszEntry
,
WinRas.RASENTRY.ByReference
Pointer to a RASENTRY structure followed by additional bytes for the alternate phone number list, if there is one.
lpRasEntry
,
IntByReference
Pointer to a variable that, on input, specifies the size, in bytes, of the lpRasEntry buffer.
lpdwEntryInfoSize
,
Pointer
This parameter is no longer used. The calling function should set this parameter to NULL.
lpbDeviceInfo
,
Pointer
This parameter is unused. The calling function should set this parameter to NULL.
lpdwDeviceInfoSize
)

The RasGetEntryProperties function retrieves the properties of a phone-book entry.

public int

Returns:

status
RasGetErrorString
(int
Specifies the error value of interest. These are values returned by one of the RAS functions: those listed in the RasError.h header file.
uErrorValue
,
char[]
Pointer to a buffer that receives the error string. This parameter must not be NULL.
lpszErrorString
,
int
Specifies the size, in characters, of the buffer pointed to by lpszErrorString.
cBufSize
)

The RasGetErrorString function obtains an error message string for a specified RAS error value.

public int

Returns:

If the function succeeds, the return value is ERROR_SUCCESS.
RasGetProjectionInfo
(WinNT.HANDLE
Handle to the remote access connection of interest. An application obtains a RAS connection handle from the RasDial or RasEnumConnections function.
hrasconn
,
int
Specifies the RASPROJECTION enumerated type value that identifies the protocol of interest.
rasprojection
,
Pointer
Pointer to a buffer that receives the information specified by the rasprojection parameter. The information is in a structure appropriate to the rasprojection value.
lpprojection
,
IntByReference
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.
lpcb
)

The RasGetProjectionInfo function obtains information about a remote access projection operation for a specified remote access component protocol.

public int

Returns:

If the function succeeds, the return value is ERROR_SUCCESS.
RasHangUp
(WinNT.HANDLE
Specifies the remote access connection to terminate. This is a handle returned from a previous call to RasDial or RasEnumConnections.
hrasconn
)

The RasHangUp function terminates a remote access connection.

public int

Returns:

If the function succeeds, the return value is ERROR_SUCCESS.
RasSetEntryProperties
(String
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.
lpszPhonebook
,
String
Pointer to a null-terminated string that specifies an entry name.
lpszEntry
,
WinRas.RASENTRY.ByReference
Pointer to the RASENTRY structure that specifies the new connection data to be associated with the phone-book entry indicated by the lpszEntry parameter.
lpRasEntry
,
int
Specifies the size, in bytes, of the buffer identified by the lpRasEntry parameter.
dwEntryInfoSize
,
byte[]
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.
lpbDeviceInfo
,
int
Specifies the size, in bytes, of the lpbDeviceInfo buffer.
dwDeviceInfoSize
)

The RasSetEntryProperties function changes the connection information for an entry in the phone book or creates a new phone-book entry.

Field Detail

INSTANCEback to summary
public static final Rasapi32 INSTANCE

Method Detail

RasDialback to summary
public int RasDial(WinRas.RASDIALEXTENSIONS.ByReference lpRasDialExtensions, 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:WinRas.RASDIALEXTENSIONS.ByReference

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:String

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:WinRas.RASDIALPARAMS.ByReference

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:int

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:WinRas.RasDialFunc2

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:WinNT.HANDLEByReference

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:int

If the function succeeds, the return value is ERROR_SUCCESS.

RasEnumConnectionsback to summary
public 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:WinRas.RASCONN[]

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:IntByReference

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:IntByReference

Pointer to a variable that receives the number of RASCONN structures written to the buffer specified by lprasconn.

Returns:int

If the function succeeds, the return value is ERROR_SUCCESS.

RasGetConnectionStatisticsback to summary
public int RasGetConnectionStatistics(WinNT.HANDLE hrasconn, Structure.ByReference lpStatistics)

The RasGetConnectionStatistics function retrieves accumulated connection statistics for the specified connection.

Parameters
hrasconn:WinNT.HANDLE

Handle to the connection. Use RasDial or RasEnumConnections to obtain this handle.

lpStatistics:Structure.ByReference

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:int

If the function succeeds, the return value is ERROR_SUCCESS.

RasGetConnectStatusback to summary
public int RasGetConnectStatus(WinNT.HANDLE hrasconn, Structure.ByReference lprasconnstatus)

The RasGetConnectionStatistics function retrieves accumulated connection statistics for the specified connection.

Parameters
hrasconn:WinNT.HANDLE

Specifies the remote access connection for which to retrieve the status. This handle must have been obtained from RasDial or RasEnumConnections.

lprasconnstatus:Structure.ByReference

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:int

If the function succeeds, the return value is ERROR_SUCCESS.

RasGetCredentialsback to summary
public int RasGetCredentials(String lpszPhonebook, String lpszEntry, WinRas.RASCREDENTIALS.ByReference lpCredentials)

The RasGetCredentials function retrieves the user credentials associated with a specified RAS phone-book entry.

Parameters
lpszPhonebook:String

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:String

Pointer to a null-terminated string that specifies the name of a phone-book entry.

lpCredentials:WinRas.RASCREDENTIALS.ByReference

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:int

If the function succeeds, the return value is ERROR_SUCCESS.

RasGetEntryDialParamsback to summary
public int RasGetEntryDialParams(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:String

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:WinRas.RASDIALPARAMS.ByReference

Pointer to a RASDIALPARAMS structure.

lpfPassword:WinDef.BOOLByReference

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:int

If the function succeeds, the return value is ERROR_SUCCESS.

RasGetEntryPropertiesback to summary
public int RasGetEntryProperties(String lpszPhonebook, 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:String

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:String

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:WinRas.RASENTRY.ByReference

Pointer to a RASENTRY structure followed by additional bytes for the alternate phone number list, if there is one.

lpdwEntryInfoSize:IntByReference

Pointer to a variable that, on input, specifies the size, in bytes, of the lpRasEntry buffer.

lpbDeviceInfo:Pointer

This parameter is no longer used. The calling function should set this parameter to NULL.

lpdwDeviceInfoSize:Pointer

This parameter is unused. The calling function should set this parameter to NULL.

Returns:int

If the function succeeds, the return value is ERROR_SUCCESS.

RasGetErrorStringback to summary
public int RasGetErrorString(int uErrorValue, char[] lpszErrorString, int cBufSize)

The RasGetErrorString function obtains an error message string for a specified RAS error value.

Parameters
uErrorValue:int

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:char[]

Pointer to a buffer that receives the error string. This parameter must not be NULL.

cBufSize:int

Specifies the size, in characters, of the buffer pointed to by lpszErrorString.

Returns:int

status

RasGetProjectionInfoback to summary
public 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:WinNT.HANDLE

Handle to the remote access connection of interest. An application obtains a RAS connection handle from the RasDial or RasEnumConnections function.

rasprojection:int

Specifies the RASPROJECTION enumerated type value that identifies the protocol of interest.

lpprojection:Pointer

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:IntByReference

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:int

If the function succeeds, the return value is ERROR_SUCCESS.

RasHangUpback to summary
public 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:WinNT.HANDLE

Specifies the remote access connection to terminate. This is a handle returned from a previous call to RasDial or RasEnumConnections.

Returns:int

If the function succeeds, the return value is ERROR_SUCCESS.

RasSetEntryPropertiesback to summary
public int RasSetEntryProperties(String lpszPhonebook, 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:String

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:String

Pointer to a null-terminated string that specifies an entry name.

lpRasEntry:WinRas.RASENTRY.ByReference

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:int

Specifies the size, in bytes, of the buffer identified by the lpRasEntry parameter.

lpbDeviceInfo:byte[]

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:int

Specifies the size, in bytes, of the lpbDeviceInfo buffer.

Returns:int

If the function succeeds, the return value is ERROR_SUCCESS.