Next, you’ll need to figure out where in the device stack access is being denied. First, the I/O manager will map the symbolic link to the real device path, then will map the device path to the right device. (In some cases, there will be additional path elements, but in this case, there usually isn’t.) The I/O manager will check the ACL and either allow/deny access.
If the ACL check passes, then the I/O manager will create an IRP_MJ_CREATE IRP, and send it to the device driver that is on the top of the device stack. This device driver will do whatever it needs to do, and it can potentially decide to the fail the request and return STATUS_ACCESS_DENIED. Or, if it wants to allow the request, it will either complete it (with success), or forward it down the stack. If it forwards it down the stack, then each driver below it has an opportunity to allow/deny access.
I would suggest using an IRP tracker to see what’s going on. There are many IRP tracker packages, including one offered at osronline.com. Use “Select Device” to choose the device you want to filter on, run your program, and see what happens. Does the IRP get beyond the I/O manager? How many drivers are layered into the device stack that you’re interested in? etc.
You can also do this manually, with breakpoints, but it’s rather tedious.
From: xxxxx@lists.osr.com [xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com [xxxxx@yahoo.com]
Sent: Wednesday, February 07, 2007 7:32 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] CreateFile() failed on Vista returning ERROR_ACCESS_DENIED
Ok, back to my original CreateFile() problem, the symbolic link name I pass to CreateFile() is exactly this:
\?\usb#vid_0471&pid_0815#ph00p5nx#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
This same call works on XP, but got access denied on Vista. I have ruled out the possibility “run as admin” or not, and the Task Manager Process lists the process user name as Administrator.
I tried using MAXIMUM_ALLOWED when calling CreateFile(), instead of GENERIC_READ | GENERIC_WRITE, but the problem persists.
The SysInternals WinObj utility reports this symbolic object disabled for read/write permission, but I found the same on XP, and I can’t enable read/write on either XP or Vista in WinObj.
Any suggestions? I am really stuck in here.
Thanks,
Charles
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer