Win 2000 security for USB Keyboard

Hi,

We are developing a User mode client program for setting the Numlock and
Compose bit of USB keyboard in WINDOWS 2000 platform.

When we are trying to get the Handle of the USB Keyboard using Createfile()
API with GENERIC_READ|GENERIC_WRITE access it return a error ACCESS_DENIED.
But we are able to get the Handle if we give only the GENERIC_WRITE access
in Createfile() API. Later we found out that this is due to WIN2000 keeps
exclusive access of the USB Keyboard.

Then, we tried to generate the Output Report through WriteFile() API with
the Handle got from the Createfile with GENERIC_WRITE access. But when we
call WriteFile(), this function fails in WINDOWS 2000 and the
GetLastError() returns 1 ( ERROR_INVALID_FUNCTION ).

Is there any way of editing the Registry so that WIN 2000 will allow access
to USB Keyboard.
OR is there any way of generating the Output Report in WIN2000 and solving
this problem.

We also worked with Direct Input and it too gives the same problem with
Win2000. Any help would be greatly appreciated.

We tried the same code in WIN98. In WIN98, we are able to obtain a handle
to the USB keyboard with GENERIC_READ access also. We are also able to set
the Numlock and Compose bit using the Output Report and WriteFile.

Thanks a lot,

Sundar.S.


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

A filter driver might work.

Marc Reinig
System Solutions

-----Original Message-----
On Behalf Of xxxxx@yahoo.com
Sent: Tuesday, April 10, 2001 6:16 PM
Subject: [ntfsd] Win 2000 security for USB Keyboard

We are developing a User mode client program for setting the Numlock and
Compose bit of USB keyboard in WINDOWS 2000 platform.

When we are trying to get the Handle of the USB Keyboard using Createfile()
API with GENERIC_READ|GENERIC_WRITE access it return a error ACCESS_DENIED.
But we are able to get the Handle if we give only the GENERIC_WRITE access
in Createfile() API. Later we found out that this is due to WIN2000 keeps
exclusive access of the USB Keyboard.

Then, we tried to generate the Output Report through WriteFile() API with
the Handle got from the Createfile with GENERIC_WRITE access. But when we
call WriteFile(), this function fails in WINDOWS 2000 and the
GetLastError() returns 1 ( ERROR_INVALID_FUNCTION ).

Is there any way of editing the Registry so that WIN 2000 will allow access
to USB Keyboard.
OR is there any way of generating the Output Report in WIN2000 and solving
this problem.

We also worked with Direct Input and it too gives the same problem with
Win2000. Any help would be greatly appreciated.

We tried the same code in WIN98. In WIN98, we are able to obtain a handle
to the USB keyboard with GENERIC_READ access also. We are also able to set
the Numlock and Compose bit using the Output Report and WriteFile.


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com