Overview of the Session Management Interface

RnaSessInitialize

This function is called by Dial-Up Networking to allow the SMM to initialize and prepare itself for managing the session. The overlaying SMM should do the following during this function.

In the sample, the SMM calls the PPPSMM's RnaSessInitialize function. If the function succeeds, the SMM successfully overlays the PPPSMM and returns the entry points to its RnaSessStart and RnaSessStop functions (SMMSessStart and SMMSessStop respectively) to Dial-Up Networking.

RnaSessGetErrorString

This function is called when Dial-Up Networking wants to get the displayable error string for the messages resource ID returned to Dial-Up Networking in the RnaComplete call. The overlaying SMM should do the following during this function.

In the sample, the overlaying SMM does not own any error string/message ID. If this function is called it means that the SMM for PPP fails the session configuration and passes a message resource ID when it calls RnaComplete to Dial-Up Networking.

RnaSessStart

This function is called when Dial-Up Networking wants the SMM to start managing the session. The overlaying SMM should do the following during this function.

In the sample, the function is named SMMSessStart. It verifies the session is for the "COM" device class and the "initiator" session type (client) before it spawns a session management thread to manage the session and returns to Dial-Up Networking. If either condition is not met, it hands off the control to the overlaid SMM (SMM for PPP) immediately.

RnaSessStop

This function is called when Dial-Up Networking wants to terminate the SMM. The overlaying SMM should do the following during this function.

In the sample, SMMSessStop determines whether it has started managing the session by the existence of the session control block for the connection. If the session control block does not exist, it never manages the session, so it can bypass the Stop function to the PPPSMM immediately. Otherwise, it signals an event the session management thread to stops managing the session. When the thread detects the event, it terminates the session and calls RnaComplete or simply calls the PPPSMM to stop the session.