-
CreateFile("COM" + 1->255) as suggested by Wael Dalloul
✔ Found com0com ports, took 234ms. -
QueryDosDevice()
✔ Found com0com ports, took 0ms. -
GetDefaultCommConfig("COM" + 1->255)
✔ Found com0com ports, took 235ms. -
"SetupAPI1" using calls to SETUPAPI.DLL
✔ Found com0com ports, also reported "friendly names", took 15ms. -
"SetupAPI2" using calls to SETUPAPI.DLL
✘ Did not find com0com ports, reported "friendly names", took 32ms. -
EnumPorts()
✘ Reported some non-COM ports, did not find com0com ports, took 15ms. -
Using WMI calls
✔ Found com0com ports, also reported "friendly names", took 47ms. -
COM Database using calls to MSPORTS.DLL
✔/✘ Reported some non-COM ports, found com0com ports, took 16ms. -
Iterate over registry key HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
✔ Found com0com ports, took 0ms.
Windows枚举出系统中所有的串口的9种方法
最新推荐文章于 2021-01-30 23:20:58 发布
本文对比了多种枚举Windows系统中串口的方法及其效率,包括使用CreateFile、QueryDosDevice、SetupAPI调用等,并记录了每种方法查找串口所花费的时间。
543

被折叠的 条评论
为什么被折叠?



