码迷,mamicode.com
首页 > 其他好文 > 详细

用CreateFile打开串口超过com10就不能打开,解决办法

时间:2017-02-04 18:44:44      阅读:263      评论:0      收藏:0      [点我收藏+]

标签:create   existing   打开   efi   ati   attribute   share   bsp   nic   

10以下的串口可以这样打开

CreateFile( 
              "COM5",          //  address  of  name  of  the  communications  device 
              fdwAccess,                    //  access  (read-write)  mode 
              0,                                    //  share  mode 
              NULL,                              //  address  of  security  descriptor 
              OPEN_EXISTING,            //  how  to  create 
              0,                                    //  file  attributes 
              NULL                                //  handle  of  file  with  attributes  to  copy 
        ); 

10以上的串口要这样才打的开

CreateFile( 
              "\\\\.\\COM10",          //  address  of  name  of  the  communications  device 
              fdwAccess,                    //  access  (read-write)  mode 
              0,                                    //  share  mode 
              NULL,                              //  address  of  security  descriptor 
              OPEN_EXISTING,            //  how  to  create 
              0,                                    //  file  attributes 
              NULL                                //  handle  of  file  with  attributes  to  copy 
        ); 

 

用CreateFile打开串口超过com10就不能打开,解决办法

标签:create   existing   打开   efi   ati   attribute   share   bsp   nic   

原文地址:http://www.cnblogs.com/micq/p/6365807.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!