Filter Driver in VB.Net?

  • Thread starter Thread starter Charles Law
  • Start date Start date
C

Charles Law

I want to intercept operations on serial ports (much like PortMon from
SysInternals), and I think I need a filter driver. Is that correct, and can
one be written in VB.NET?

If it is possible, can anyone point me to a reference? I have been hunting
around, and have found lots about the principal of filter drivers, but so
far nothing with a practical example.

Of course, if there is another/better way I would be interested to hear it.
The key thing is that the application needs to monitor two-way traffic on a
serial port, so it must not prevent normal opening and closing of the port
by another application.

TIA

Charles
 
Charles said:
I want to intercept operations on serial ports (much like PortMon from
SysInternals), and I think I need a filter driver. Is that correct, and can
one be written in VB.NET?

If it is possible, can anyone point me to a reference? I have been hunting
around, and have found lots about the principal of filter drivers, but so
far nothing with a practical example.

Of course, if there is another/better way I would be interested to hear it.
The key thing is that the application needs to monitor two-way traffic on a
serial port, so it must not prevent normal opening and closing of the port
by another application.

All I could find on this topic was an article from the October 2002
MSDN magazine, which detailed how to wrap P/Invoke'd API calls inside a
friendly .net class. This was for plain reading / writing to serial
ports. Also the 'My' namespace in Whidbey will include
My.Computer.Ports to make that task a lot easier.

None of this is much help to you unfortunately... except to suggest
that you will almost certainly have to use P/Invoke and the original
Win32 APIs to do this, rather than there being some framework to help
you.

The article I mentioned might be of use in explaining some P/Invoke
issues, the URL is

<http://msdn.microsoft.com/msdnmag/issues/02/10/netserialcomm/>
 
Hi Larry

Thanks for the reply. The article you mention I have seen; it helped me
resolve an issue with the serial code on Corrado Cavalli's site. I can also
report that the code would open a port exclusively, thereby preventing the
application to be monitored from opening the port.

My mention of filter drivers is based on the information at SysInternals,
where they talk about using ZwCreateFile, for example, but so far I cannot
even get ZwCreateFile to work, so I am a bit stuck.

Charles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top