Platform SDK: RAS/Routing and RAS |
The RasConnectionNotification function specifies an event object that the system sets to the signaled state when a RAS connection is created or terminated.
DWORD RasConnectionNotification( HRASCONN hrasconn, // handle to a RAS connection HANDLE hEvent, // handle to an event object DWORD dwFlags // type of event to receive notifications for );
Value | Meaning |
---|---|
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 4.0 and earlier versions only: If hrasconn is a handle to a combined multilink connection, hEvent is signaled when a subentry is connected. |
RASCN_BandwidthRemoved | Windows NT 4.0 and earlier versions only: If hrasconn is a handle to a combined multilink connection, hEvent is signaled when a subentry is disconnected. |
If the function succeeds, the return value is zero.
If the function fails, the return value is a nonzero error code.
To determine when the event object is signaled, use any of the wait functions.
When the event is signaled, you can use other RAS functions, such as RasEnumConnections, to get more information about the RAS connection that was created or terminated.
Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98: Requires Windows 98.
Header: Declared in Ras.h.
Library: Use Rasapi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
Remote Access Service (RAS) Overview, Remote Access Service Functions, CreateEvent, RasEnumConnections