Platform SDK: RAS/Routing and RAS

RasSecurityDialogBegin

The RasSecurityDialogBegin function is a third-party RAS security DLL entry point that the Windows NT/Windows 2000 RAS server calls when a remote user tries to connect. This enables the security DLL to begin its authentication of the remote user.

Note that Windows NT/Windows 2000 currently provides RAS security host support only for serial devices; other types of connections, such as ISDN or a virtual private network (VPN) connection, are not supported.

DWORD WINAPI RasSecurityDialogBegin(
  HPORT hPort,        // RAS handle to the port
  PBYTE pSendBuf,     // pointer to buffer for sending data
  DWORD SendBufSize,  // size, in bytes, of the send buffer
  PBYTE pRecvBuf,     // pointer to buffer for receiving data
  DWORD RecvBufSize,  // size, in bytes, of the receive buffer
  VOID (WINAPI * RasSecurityDialogComplete)
                      // pointer to the completion function
);

Parameters

hPort
Specifies a RAS port handle. The security DLL uses this handle in other RAS security functions, such as RasSecurityDialogSend and RasSecurityDialogReceive, to identify this authentication transaction.

Note that this handle is valid only in RAS security functions; you cannot use it in other Win32 I/O functions.

pSendBuf
Pointer to a buffer allocated by the RAS server. The security DLL uses this buffer with the RasSecurityDialogSend function to send text that is displayed in the RAS terminal window on the remote computer.
SendBufSize
Specifies the size, in bytes, of the pSendBuf buffer.
pRecvBuf
Pointer to a buffer allocated by the RAS server. The security DLL uses this buffer with the RasSecurityDialogReceive function to receive the response from the remote user.
RecvBufSize
Specifies the size, in bytes, of the pRecvBuf buffer.
RasSecurityDialogComplete
Specifies a pointer to a RasSecurityDialogComplete function. When the security DLL has completed the authentication of the remote user, it calls this function to report the results to the RAS server.

Return Values

If the security DLL successfully starts the authentication operation, RasSecurityDialogBegin should return NO_ERROR. In this case, the security DLL must later terminate the authentication transaction by calling the function pointed to by the RasSecurityDialogComplete parameter.

If an error occurs, RasSecurityDialogBegin should return a nonzero error code. In this case, the RAS server hangs up the call and records the error in the Windows NT/Windows 2000 event log. Returning a nonzero error code terminates the authentication transaction, so the security DLL does not need to call the RasSecurityDialogComplete function.

Remarks

When a Windows NT/Windows 2000 RAS server receives a call from a remote computer, it calls the RasSecurityDialogBegin function exported by the registered RAS security DLL, if there is one. When the RAS server calls this function, it passes the following information to the security DLL:

The port handle and buffer pointers are valid until you call RasSecurityDialogComplete to terminate the authentication transaction.

Your RasSecurityDialogBegin implementation must return as soon as possible, because the RAS server is blocked and cannot accept any other calls until RasSecurityDialogBegin returns. The RasSecurityDialogBegin function should copy the input parameters and create a thread to communicate with and authenticate the remote user.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Header: Declared in Rasshost.h.

See Also

Remote Access Service (RAS) Overview, RAS Server Administration Functions, RasSecurityDialogComplete, RasSecurityDialogReceive, RasSecurityDialogSend