The RasDial function establishes a RAS connection between a RAS client and a RAS server. The connection data includes callback and user-authentication information.
DWORD RasDialA( LPRASDIALEXTENSIONS , LPCSTR , LPRASDIALPARAMSA , DWORD , LPVOID , LPHRASCONN );
If the function succeeds, the return value is ERROR_SUCCESS and a handle to the RAS connection is returned in the variable pointed to by lphRasConn.
If the function fails, the return value is from Routing and Remote Access Error Codes or Winerror.h.
An application must eventually call RasHangUp whenever a non-NULL connection handle is stored into *lphRasConn. This applies even if RasDial returns a nonzero (error) value.
An application can safely call RasHangUp from a RasDial notifier callback function. If this is done, however, the hang-up does not occur until the routine returns.
If the structure pointed to by lpRasDialExtensions enables RDEOPT_PausedStates, the RasDial function pauses whenever it enters a state in which the RASCS_PAUSED bit is set to one. To restart RasDial from such a paused state, call RasDial again, passing the connection handle returned from the original RasDial call in *lphRasConn. The same notifier used in the original RasDial call must be used when restarting from a paused state.
The lpvNotifier parameter is a handle to a window to receive progress notification messages. In a progress notification message, wParam is the equivalent of the rasconnstate parameter of RasDialFunc and RasDialFunc1, and lParam is the equivalent of the dwError parameter of RasDialFunc and RasDialFunc1.
The progress notification message uses a system registered message code. You can obtain the value of this message code as follows:
UINT unMsg = RegisterWindowMessageA( RASDIALEVENT ); if (unMsg == 0) unMsg = WM_RASDIALEVENT;
Because some phone-book entries require Extensible Authentication Protocol (EAP) for authentication, the caller should call RasGetEapUserIdentity before calling RasDial. If RasGetEapUserIdentity returns ERROR_INVALID_FUNCTION_FOR_ENTRY, the phone-book entry does not require EAP. However, if RasGetEapUserIdentity returns NO_ERROR, the caller should copy the EAP identity information from RasGetEapUserIdentity into the RasEapInfo member of RASDIALEXTENSIONS, and the szUserName member of RASDIALPARAMS. See RasGetEapUserIdentity for more information. If the phone-book entry requires EAP, the dwfOptions member of the RASENTRY structure for the entry contains the RASEO_RequireEAP flag.
To specify that RasDial should enter a RASCS_CallbackSetByCaller state, set lpRasDialParams->szCallbackNumber to "*" on the initial call to RasDial. When the notification handler is called with this state, set the callback number to a number supplied by the user.
|Windows version||Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]|