In my AddDevice routine, I want to know if I should add my filter driver to
the device stack or not. Unfortunately, I have had a hell of a time trying
to distinguish between a mouse connected to COM1 versus a similiar mouse
connected to COM2. I only want to connect my Mouse Filter Driver to a COM2
mouse. How do I distinguish in my AddDevice routine if this entry point is
for a COM1 mouse or a COM2 mouse?
I’ve tried the IoGetDeviceProperty function with no luck. None of the
DeviceProperty settings are giving me enough of a unique difference between
a mouse connected to COM1 and a mouse connected to COM2.
I’ve also tried the following piece of code to compare the PDO given to me
in my AddDevice routine versus the DeviceObject pointed to by the Symbolic
Link \??\Com2. No luck, there different. There seems to be another layer
in the device stack.
RtlInitUnicodeString(&Com2SymLinkName, L"\??\Com2");
Status = IoGetDeviceObjectPointer(&Com2SymLinkName, FILE_READ_DATA,
&pCom2FileObject, &pCom2DeviceObject);
This shouldn’t be that hard.
Thanks in Advance.
Joe