RasConnectionNotification function

The RasConnectionNotification function specifies an event object that the system sets to the signaled state when a RAS connection is created or terminated.

Syntax


DWORD RasConnectionNotification(
  _In_  HRASCONN hrasconn,
  _In_  HANDLE hEvent,
  _In_  DWORD dwFlags
);

Parameters

hrasconn [in]

A handle to the RAS connection that receives the notifications. This can be a handle returned by the RasDial or RasEnumConnections function. If this parameter is INVALID_HANDLE_VALUE, notifications are received for all RAS connections on the local client.

hEvent [in]

Specifies the handle of an event object. Use the CreateEvent function to create an event object.

dwFlags [in]

Specifies the RAS event that causes the system to signal the event object specified by the hEvent parameter. This parameter is a combination of the following values.

ValueMeaning
RASCN_Connection

If hrasconn is INVALID_HANDLE_VALUE, hEvent is signaled when any RAS connection is created.

RASCN_Disconnection

hEvent is signaled when the hrasconn connection is terminated. If hrasconn is a multilink connection, the event is signaled when all subentries are disconnected. If hrasconn is INVALID_HANDLE_VALUE, the event is signaled when any RAS connection is terminated.

RASCN_BandwidthAdded

Windows NT:  If hrasconn is a handle to a combined multilink connection, hEvent is signaled when a subentry is connected.

RASCN_BandwidthRemoved

Windows NT:  If hrasconn is a handle to a combined multilink connection, hEvent is signaled when a subentry is disconnected.

 

Return value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a non-zero error code from Routing and Remote Access Error Codes or Winerror.h.

Remarks

To determine when the event object is signaled, use any of the wait functions.

When the event is signaled, use other RAS functions, such as RasEnumConnections, to get more information about the RAS connection that was created or terminated.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Ras.h

Library

Rasapi32.lib

DLL

Rasapi32.dll

Unicode and ANSI names

RasConnectionNotificationW (Unicode) and RasConnectionNotificationA (ANSI)

See also

Remote Access Service (RAS) Overview
Remote Access Service Functions
CreateEvent
RasEnumConnections

 

 

Community Additions

ADD
Show:
© 2014 Microsoft