I’m starting to have strange state-related problems when dialing RAS
connections via rasapi32 on win2k. It seems that calls to the API in rapid
succession can get RAS into a confused state, such that it is no longer
responsive. One common error I get back is “the connection is already
being dialed”. The only workaround I know of is a reboot.
KB article Q259580 describes one of these cases, but that’s the only
reference I have been able to find to this problem. Also, the following is
in the latest PSDK in the RasHangUp() entry:
An application should not call RasHangUp and then immediately exit. The
connection state machine needs time to properly terminate. If the system
prematurely terminates the state machine, the state machine may fail to
properly close a port, leaving the port in an inconsistent state. A simple
way to avoid this problem is to call Sleep(3000) after returning from
RasHangUp; after that pause, the application can exit. A more responsive
way to avoid the problem is, after returning from RasHangUp, to call
RasGetConnectStatus(hrasconn) and Sleep(0) in a loop until
RasGetConnectStatus returns ERROR_INVALID_HANDLE.
I have the appropriate sleep statements in the code (ugly…), but I still
get into this state occasionally. Anybody see this before?
Thanks.
-sd
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com