Bluetooth virtual COM port names corrupt when returned by GetPortNames.
My employer has a custom software product (written in VB.NET and compiled with Visual Studio 2019 Professional) that is run on tablet computers. The software uses Bluetooth virtual COM ports for serial communication, and has been working since the mid-2000’s on multiple brands of tablet computer under Windows XP Pro, Windows 7 Pro, and Windows 10 Pro. We recently had to change the hardware due to supply chain disruption, and the new tablet hardware is running Windows 10 IoT Enterprise. The software saves virtual COM port selections to its settings file, but cannot reload the settings from the file later due to the virtual COM port names being corrupted when returned by System.IO.Ports.SerialPort.GetPortNames() after a reboot. (And changing the software to recognize the corrupted names is not a reliable fix, because the corruption may randomly change in the future depending on the contents of memory etc.)
This affects only the Bluetooth virtual COM ports. (The system also uses a USB to serial adapter for RS232 communication, and its virtual COM port is unaffected.) The Bluetooth virtual COM port names are correct in Device Manager, in the registry, and when retrieved via a PowerShell script and do not change after a reboot. They are corrupt when retrieved via System.IO.Ports.SerialPort.GetPortNames() before a reboot, but corrupted after rebooting. The problem persists after all Windows updates have been installed, and after the Intel Bluetooth driver has been updated to the optional driver provided by Windows Update.
After the Bluetooth virtual COM port names are corrupted, using Device Manager to change a Bluetooth virtual serial port’s COM port number causes its virtual COM port name to be returned correctly by System.IO.Ports.SerialPort.GetPortNames() until the computer is rebooted. The user can log in and out of privileged and unprivileged logins (including the root Administrator) as long as the computer is not rebooted, and the correct COM port names will be returned. After a reboot (either by Shutdown and power up or by Restart) the Bluetooth virtual COM port names are again corrupted the same way as before. This is repeatable. To be clear about the origin of the problem, the COM port names are corrupt when returned to VB by System.IO.Ports.SerialPort.GetPortNames(), The corruption is not happening later in the program.
This problem bears a resemblance to the problem in a forum post from 2018 regarding Windows 10 x64 10586.104 )“Bluetooth stack inserts invalid COM port names into registry” https://answers.microsoft.com/en-us/windows/forum/all/bluetooth-stack-inserts-invalid-com-port-names/ff68fac4-62b0-4b3a-b83a-0c8b1712adf8). In both cases the names returned by the System.IO.Ports.SerialPort.GetPortNames() function are corrupted. However, the workaround presented in 2018 involved editing the corrupted COM port names in the registry, and the names are not corrupt in the registry this time. Therefore, the workaround provided in the forum thread is not applicable (I tried). The corrupted COM port names are also not found anywhere in the registry by a registry search, so it isn’t that they are just hiding in a different registry location. Also note that the corruption was in a similar form but was not identical to the 2018 incident.
Windows 10 IoT Enterprise
Installed on: 8/2/2022
OS build: 19044.1889
Experience: Windows Feature Experience Pack 120.2212.4180.0
Windows Update history
Problem existed before installing Windows updates.
Problem still existed after all Windows Updates were installed as of 8/16/2022.
Problem still existed after optional Intel Bluetooth driver update provided by Windows Update.
Is there a reliable workaround for this problem, or is an update from Microsoft needed?
Sign in to comment