Mouse Filter driver for Win2000

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

You can send down an IOCTL, IOCTL_SERENUM_GET_PORT_NAME. Set
Irp->AssociatedIrp.SystemBuffer to the WCHAR pointer and
Parameters.DeviceIoControl.OutputBufferLength to the length of the
buffer (in bytes).

D

(yes, there is another layer in the way, it is serenum)

This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: Joe Moriarty [mailto:xxxxx@east.sun.com]
Sent: Monday, May 13, 2002 1:10 PM
To: NT Developers Interest List
Subject: [ntdev] Mouse Filter driver for Win2000

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


You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%