相信有很多朋友都开发过串口通讯程序.异步的或者同步的.也有好多人用过或者正在用SysInternals公司的PORTMON.exe吧.
请问,哪位大侠能讲讲PORTMON.exe 的实现原理
如果我们需要自己开发一个监听软件的串口通讯,提取数据,思路如何展开
如果使用HOOK的话,怎么开始

解决方案 »

  1.   

    还真没用过PORTMON.exe,找来看看!!
      

  2.   

    基本上类似Filter Driver. MarkRuss 这里有解释:http://www.microsoft.com/technet/sysinternals/utilities/portmon.mspx“When you select a port to monitor, Portmon sends a request to its device driver that includes the NT name (e.g. \device\serial0) that you are interested in. The driver uses standard filtering APIs to attach its own filter device object to the target device object. First, it uses ZwCreateFile to open the target device. Then it translates the handle it receives back from ZwCreateFile to a device object pointer. After creating its own filter device object that matches the characteristics of the target, the driver calls IoAttachDeviceByPointer to establish the filter. From that point on the Portmon driver will see all requests aimed at the target device. ”
      

  3.   

    http://www.codeguru.com/network/commspy.shtml,
      

  4.   

    PORTMON我记得有源代码的
    sysinternal当时很多都是公开代码的