problem with opening device using CreateFile
- From: "Joe B." <joe.news_ms@xxxxxxxxxxx>
- Date: Wed, 13 Dec 2006 15:32:29 -0500
Hello,
I posted this first in the C/C++ newsgroup and it was suggested I should try
here.
I have been wading through using SetupDi... API to get a device path to use
in CreateFile so that I could open a USB HID device.
I can now get a device path, but when I try to open for
GENERIC_READ|GENERIC_WRITE, I get an error that only tells me "Access
Denied". If I use zero in dwDesiredAccess, I get a valid handle that I can
use for device query access and use HidD_GetAttributes to read the Vendor ID
and Product ID so on that level I know I am accessing the correct devices.
However, I am not sure how to debug the "Access Denied" error so that I can
open the devices to use WriteFile and ReadFile.
I have tried various combinations of DesiredAccess and ShareMode.
The documentation on CreateFile indicates that the SecurityAttributes are
ignored. I am using Vis Studio 2005, working in C, op system is XP,
user-land Application.
Anyone have ideas?
Joe
.
- Follow-Ups:
- Re: problem with opening device using CreateFile
- From: Tim Roberts
- Re: problem with opening device using CreateFile
- Prev by Date: Re: Trap System Registry changes for a process
- Next by Date: Re: How to get imagebase after a DLL gets loaded
- Previous by thread: ReadDirectoryChangesW: security bug?
- Next by thread: Re: problem with opening device using CreateFile
- Index(es):
Relevant Pages
|