sriranga_s
November 30th, 2004, 01:49 AM
Hi,
I have developed a HID minidriver for a USB keyboard(for win 2k) in DDK. My keyboard is not a standard keyboard since it contains some sliders and other keys. I have been able to load the my driver instead of the system supplied driver. In my application, I want a ahndle to this keyboard so that I can read\write data. So I ahve called the SetupDiXXX() routines in order. At the end, if I call CreateFile(..), with dwDesiredAccess as GENERIC_READ|GENERIC_WRITE its returning INVALID_HANDLE_VALUE. When I called GetLastError(), it gave a value of 5, which means ACCESS_DENIED. However when I calll CraeteFile() with the dwDesiredAccess = 0, it opens a handle but I cant do read\write with this.
So my question is why am getting that error when I try to open a ahndle with dwDesiredAccess = GENERIC_READ|GENERIC_WRITE .
Plz help me out.
Thanks,
Sri
I have developed a HID minidriver for a USB keyboard(for win 2k) in DDK. My keyboard is not a standard keyboard since it contains some sliders and other keys. I have been able to load the my driver instead of the system supplied driver. In my application, I want a ahndle to this keyboard so that I can read\write data. So I ahve called the SetupDiXXX() routines in order. At the end, if I call CreateFile(..), with dwDesiredAccess as GENERIC_READ|GENERIC_WRITE its returning INVALID_HANDLE_VALUE. When I called GetLastError(), it gave a value of 5, which means ACCESS_DENIED. However when I calll CraeteFile() with the dwDesiredAccess = 0, it opens a handle but I cant do read\write with this.
So my question is why am getting that error when I try to open a ahndle with dwDesiredAccess = GENERIC_READ|GENERIC_WRITE .
Plz help me out.
Thanks,
Sri