Is it possible to read from a COM port already in use on Windows XP?
I would like to see the communication between some software and a device plugged into a serial device. I wrote a small program using C# to monitor the COM, but once it's in use by the other device it will not let you open it again. How can one monitor a COM port already in use?
I'm open to third-party software.
Yes, this is technically possible. You'll need a filter driver, a device driver type of a component that injects itself ahead of the native serial port driver. It gets a crack at the driver IRPs before sending them on to the regular driver.
This is the technique used by SysInternals' PortMon utility. However, you cannot write such a driver in C# code, the CLR cannot be loaded into ring 0. At least not until the super-secret Midori project sees the light of day.
COM filter drivers are pretty common, check out this one for example. You have to do some googling to find one that has a .NET wrapper though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With