Hi,
I have developed a HID minidriver for a USB keyboard which is not a
standard one. This is targetted to work on Win2k and WinXP. In my
application, I'm calling HIDd_GetGuid(..) and later am calling the normal
SetupDiXXX(..) routines to get teh device name. After this, I'm calling
CreateFile(..) to open a handle. Here, it is returning INVALID_HANDLE_VALUE.
The parameters are : name, GENERIC_READ|GENERIC_WRITE, 0, OPEN_EXISTING,
FILE_ATTRIBUTES_NORMAL, NULL. When I call GetLastError(), its showing 5 ==
ERROR_ACCESS_DENIED.
One more observation is : When I call the same CraeteFile(..) with
dwDesiredAccess = 0, its openeing a handle. But I cannot do any read\write
operations with this handle.
So How do I go about this prob?

Thanks,

Re: HID minidriver : ERROR_ACCESS_DENIED error message by Robert

Robert
Fri Dec 03 00:08:03 CST 2004

Sri wrote:
> Hi,
> I have developed a HID minidriver for a USB keyboard which is not a
> standard one. This is targetted to work on Win2k and WinXP. In my
> application, I'm calling HIDd_GetGuid(..) and later am calling the normal
> SetupDiXXX(..) routines to get teh device name. After this, I'm calling
> CreateFile(..) to open a handle. Here, it is returning INVALID_HANDLE_VALUE.
> The parameters are : name, GENERIC_READ|GENERIC_WRITE, 0, OPEN_EXISTING,
> FILE_ATTRIBUTES_NORMAL, NULL. When I call GetLastError(), its showing 5 ==
> ERROR_ACCESS_DENIED.
> One more observation is : When I call the same CraeteFile(..) with
> dwDesiredAccess = 0, its openeing a handle. But I cannot do any read\write
> operations with this handle.
> So How do I go about this prob?
>
> Thanks,
>

This is a standard behavior because Windows issues an exclusive
CreateFile call on all mice and keyboards.
Of course ReadFile and WriteFile fail on file handles not opened for
read or write.

Re: HID minidriver : ERROR_ACCESS_DENIED error message by Sri

Sri
Fri Dec 03 01:49:01 CST 2004

Ya I guessed so.. I had read this in some article.. But how to go about this
prob?

"Robert Marquardt" wrote:

> Sri wrote:
> > Hi,
> > I have developed a HID minidriver for a USB keyboard which is not a
> > standard one. This is targetted to work on Win2k and WinXP. In my
> > application, I'm calling HIDd_GetGuid(..) and later am calling the normal
> > SetupDiXXX(..) routines to get teh device name. After this, I'm calling
> > CreateFile(..) to open a handle. Here, it is returning INVALID_HANDLE_VALUE.
> > The parameters are : name, GENERIC_READ|GENERIC_WRITE, 0, OPEN_EXISTING,
> > FILE_ATTRIBUTES_NORMAL, NULL. When I call GetLastError(), its showing 5 ==
> > ERROR_ACCESS_DENIED.
> > One more observation is : When I call the same CraeteFile(..) with
> > dwDesiredAccess = 0, its openeing a handle. But I cannot do any read\write
> > operations with this handle.
> > So How do I go about this prob?
> >
> > Thanks,
> >
>
> This is a standard behavior because Windows issues an exclusive
> CreateFile call on all mice and keyboards.
> Of course ReadFile and WriteFile fail on file handles not opened for
> read or write.
>

Re: HID minidriver : ERROR_ACCESS_DENIED error message by Robert

Robert
Fri Dec 03 06:40:46 CST 2004

Sri wrote:
> Ya I guessed so.. I had read this in some article.. But how to go about this
> prob?

Use the standard way the HID minidrivers of Logitech, Kensington etc
use. Add a second interface to the driver (aka a side exit).
Logitech etc use that side exit to split the mouse data into standard
movement and clicks for Windows and extra buttons which are routed
through the side exit to the tray application which implements the
special assignments like playing a sound or starting an application etc.

Re: HID minidriver : ERROR_ACCESS_DENIED error message by Sri

Sri
Sun Dec 05 22:09:02 CST 2004

Hi,
Thanks for the reply. Sorry..but am not very clear about what u said.. Can
u be a bit more specific? Is there any article on internet where I can get
some more information?
U said add a second interface.. U mean to say that I ahve to change the
firmware to accomodate one more interface, give it a seperate guid and open a
handle to this particular interface?
Expecting your reply..
Thanks

"Robert Marquardt" wrote:

> Sri wrote:
> > Ya I guessed so.. I had read this in some article.. But how to go about this
> > prob?
>
> Use the standard way the HID minidrivers of Logitech, Kensington etc
> use. Add a second interface to the driver (aka a side exit).
> Logitech etc use that side exit to split the mouse data into standard
> movement and clicks for Windows and extra buttons which are routed
> through the side exit to the tray application which implements the
> special assignments like playing a sound or starting an application etc.
>