Accessing the communications port
Generally, the overlaying SMM wants to directly access and transfer raw data across the connected device. For instance, it may want to do the front-end user verification or run a script over the wire. Dial-Up Networking provides a standard scheme for the SMM to access the device directly through the following steps.
- During the RnaSessStart function, the SMM needs to verify that the connection was made through the class of the device it knows how to access. The SMM must call the RnaGetDeviceInfo function to obtain the device information and verify the device class contained in the device information. The device class identifies the API set that the SMM can use with the device. For instance the 'COM' device class is for the Win32 Comm API set.
- When the SMM wants to access the device, it uses the TAPI information in the device information (obtained from the RnaGetDeviceInfo call.) The TAPI information includes the TAPI line handle, the TAPI call handle and the address ID of the device.
- The SMM calls TAPI's lineGetID function with all the TAPI information for the known device class to obtain the device handle that the SMM can use to directly access the device.
In the sample the SMM obtains the Win32 Comm handle by calling the lineGetID function for the "data/modem" class. Them it uses this handle with the Win32 comm APIs to transfer data to/from the Dial-up Server.