Platform SDK: RAS/Routing and RAS

RasCustomScriptExecute

RAS calls the RasCustomScriptExecute function when establishing a connection for a phone-book entry that has the RASEO_CustomScript option set.

DWORD RasCustomScriptExecute(
  HANDLE               hPort,
  LPCWSTR              lpszPhonebook,
  LPCWSTR              lpszEntryName,
  PFNRASGETBUFFER      pfnRasGetBuffer,
  PFNRASFREEBUFFER     pfnRasFreeBuffer,
  PFNRASSENDBUFFER     pfnRasSendBuffer,
  PFNRASRECEIVEBUFFER  pfnRasReceiveBuffer,
  PFNRASRETRIEVEBUFFER pfnRasRetrieveBuffer,
  HWND                 hWnd
  RASDIALPARAMS       *pRasDialParams
  PVOID                pvReserved
);

Parameters

hPort
Handle to the port on which the connection is established. Use this handle when sending or receving data on the port.
lpszPhonebook
Pointer to a Unicode string containing the path to the phone book in which the entry for the connection resides.
lpszEntryName
Pointer to a Unicode string containing the name of the entry that was dialed to establish the connection.
pfnRasGetBuffer
Pointer to a function of type PFNRASGETBUFFER. The custom-scripting DLL should use this function to allocate memory to send data to the server.
pfnRasFreeBuffer
Pointer to a function of type PFNRASFREEBUFFER. The custom-scripting DLL should use this function to free memory allocated by the pfnRasGetBuffer function.
pfnRasSendBuffer
Pointer to a function of type PFNRASSENDBUFFER. The custom-scripting DLL uses this function to communicate with the server over the specified port.
pfnRasReceiveBuffer
Pointer to a function of type PFNRASRECEIVEBUFFER. The custom-scripting DLL uses this function to communicate with the server over the specified port.
pfnRasRetrieveBuffer
Pointer to a function of type PFNRASRETRIEVEBUFFER. The custom-scripting DLL uses this function to communicate with the server over the specified port.
hWnd
Handle to a window that the custom-scripting DLL can use to present a user interface to the user.
pRasDialParams
Pointer to a Unicode RASDIALPARAMS structure. This structure contains the authentication credentials for the user. The custom-scripting DLL can modify the szUserName, szPassword, and szDomain members of this structure. The Point-to-Point Protocol (PPP) will use whatever is stored in these members when RasCustomScriptExecute returns.
pvReserved
This parameter is reserved for future use.

Return Values

If the function succeeds, the return value should be ERROR_SUCCESS.

If the function fails, the return value should be an appropriate error code from Winerror.h or Raserror.h.

Remarks

When RAS calls RasCustomScriptExecute, the pRasDialParams parameter will point to a Unicode RASDIALPARAMS structure. That is, the structure contains only Unicode strings.

In some cases, the szUserName of the RASDIALPARAMS structure will be an empty string. In these case, the custom-scripting DLL should use the Unicode version of the GetUserName function to obtain the name of the current user.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Rasdlg.h.
  Unicode: Declared only as Unicode.

See Also

RAS Custom-Scripting, RasGetBuffer, RasFreeBuffer, RasSendBuffer, RasReceiveBuffer, RasRetrieveBuffer