RIT and PS/2 mice

Hello all.

Not sure that this is an appropriate place to ask this question, but let me try.

Digging into RIT implementation of XP I found that RIT expects PS/2 keyboards added dynamically, but not mice. Let me explain what I mean.

When RIT starts it creates list of input devices and tries to open them storing handle and state info input device information structures. It also registers device interface changes notifications for GUID_DEVINTERFACE_MOUSE, GUID_DEVINTERFACE_KEYBOARD and GUID_DEVINTERFACE_HID. When creating input device information structure function CreateDeviceInfo calls RequestDeviceChange in the case if the device is not HID. RequestDeviceChange in turn sets an event that belongs to device type (keyboard, mouse or HID). Let’s call it ‘EventOfDeviceType’. RIT executes KeWaitForMultipleObjects and one of the dispatcher objects is in the array is EventOfDeviceType. Handler of status belonging to EventOfDeviceType causes opening the device, reading data and so on.

The thing I don’t get is that why PS/2 keyboards allowed to be added dynamically while PS/2 mice are not? The logic described above says: ‘if a mouse is not HID and not found while scanning legacy names then do not open the device’. Well, AFAIR PS/2 keyboards are also not allowed to be added dynamically, but why the code of RIT allows them to do that in this case?


Thanking In Advance,
Mikae.

You are confused. The rit will handle all pnp keyboards and mice coming and going. Ps2 and hid are pnp. Ps2 is weird in that it will never go away at runtime like a usb hid can. What you are talking about is nt4 legacy naming compatibility pre pnp. Ps2 does not fall into this bucket. This is a one time scan of the legacy names and these can’t go away, regardless of how the device is connected to the machine

d

debt from my phone


From: xxxxx@yahoo.com
Sent: 4/26/2012 11:33 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] RIT and PS/2 mice

Hello all.

Not sure that this is an appropriate place to ask this question, but let me try.

Digging into RIT implementation of XP I found that RIT expects PS/2 keyboards added dynamically, but not mice. Let me explain what I mean.

When RIT starts it creates list of input devices and tries to open them storing handle and state info input device information structures. It also registers device interface changes notifications for GUID_DEVINTERFACE_MOUSE, GUID_DEVINTERFACE_KEYBOARD and GUID_DEVINTERFACE_HID. When creating input device information structure function CreateDeviceInfo calls RequestDeviceChange in the case if the device is not HID. RequestDeviceChange in turn sets an event that belongs to device type (keyboard, mouse or HID). Let’s call it ‘EventOfDeviceType’. RIT executes KeWaitForMultipleObjects and one of the dispatcher objects is in the array is EventOfDeviceType. Handler of status belonging to EventOfDeviceType causes opening the device, reading data and so on.

The thing I don’t get is that why PS/2 keyboards allowed to be added dynamically while PS/2 mice are not? The logic described above says: ‘if a mouse is not HID and not found while scanning legacy names then do not open the device’. Well, AFAIR PS/2 keyboards are also not allowed to be added dynamically, but why the code of RIT allows them to do that in this case?


Thanking In Advance,
Mikae.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Doron, well, probably I am. What I see in the code is something like this:

//RIT initialization:

apObjects[3] = CreateKernelEvent(SynchronizationEvent, 0);
aDeviceTemplate[KEYBOARD].Event = apObjects [3];

And RequestDeviceChange does something like this:

KeSetEvent(aDeviceTemplate[Index].Event);

Handler of STATUS_WAIT_3 is ProcessDeviceChanges that scans input device structures seeking for new devices of specified type. If found it opens devices and causes read.

Ok, it is not principal, I just wonder why keyboards deserve so much honor… Or I miss something.

Mice get the same behavior

d

debt from my phone


From: xxxxx@yahoo.com
Sent: 4/26/2012 12:02 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] RIT and PS/2 mice

Doron, well, probably I am. What I see in the code is something like this:

//RIT initialization:

apObjects[3] = CreateKernelEvent(SynchronizationEvent, 0);
aDeviceTemplate[KEYBOARD].Event = apObjects [3];

And RequestDeviceChange does something like this:

KeSetEvent(aDeviceTemplate[Index].Event);

Handler of STATUS_WAIT_3 is ProcessDeviceChanges that scans input device structures seeking for new devices of specified type. If found it opens devices and causes read.

Ok, it is not principal, I just wonder why keyboards deserve so much honor… Or I miss something.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Ok, principle is probably the same, but XP’s implementation calls ProcessDeviceChanges for mice from xxxMsgWaitForMultipleObjects <-xxxDesktopThread.