Posted 02 December 2004 - 11:32 PM
I have developed a minidriver for a non-standard USB keyboard, targetted for Win2k and WinXP. In my application I'm calling the usual SetupDiXXX(..) functions in order to get the device name. Then I'm calling CreateFile(..). Always my CreateFile(..) is returning INVALID_HANDLE_VALUE. Functions arguments are : name, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL. If I call GetLastError() it returns 5(== ERROR_ACCESS_DENIED). What could be the prob?
One more observation is, if I call CreateFile(..) with dwDesiredAccess as 0, it will open a ahndle but with this handle, I cannot do read\write operations.
How do I go about the prob?