How to get RAS disconnect reason?

300 Views Asked by At

Working on USB Modem, Used RAS interface for dial/hangup.

  • For connection used RASDial() and for disconnection used RASHangUp() API's.
  • After successful connection waiting for the disconnect event using function RasConnectionNotification(rasHandle, event, RASCN_Disconnection), event notifies successfully when disconnect happens.
  • I need to find out the reason of disconnection, if it disconnect due to lost network signal then put my application on auto reconnect.

Is there any method or API which provides the reason for disconnection like LINK_FAILED, USER_SWITCH, USER_LOGOFF ... etc.

1

There are 1 best solutions below

1
On

RasGetConnectStatus API can give you the reason in RASCONNSTATUS.dwError field.