- Re: Access denied in CreateFile
- Posted by Brian on August 22nd, 2003
Ok, I have an interface GUID defined and i register and enable it, but when i enumerate it and go to open it, I get access denied. I'm looking in the registry under CurrentControlSet001/DeviceClasses/{GUID} and I see the device instance and symbolic link, and I also see a control off of the #key which contains the symbolic link, and in the control I see a reference count = 1. Is this as it should be given that only the driver has accessed that interface or should it be 0 and could this be causing CreateFile to fail?
Thank you for your time.
--
Brian V. Minier
Lead Software Engineer
Interactive Imaging Systems, Inc
www.iisvr.com
"Brian" <brian_minier@no-spam.iisvr.com> wrote in message news:uaHYfCCaDHA.1384@TK2MSFTNGP10.phx.gbl...
Ok, I'm attempting to get a handle to my PC Card device driver which registers an interface in add device and enables it in start device. Is my application I enumerate the devices of the interface and when i go to create file, i get an access denied? Can anyone give me some more information. I have used the generic/toaster src as a driver and am doing pretty much the same thing it is and cannot explain why create file would fail? Do i need to declare the interface in the registry or something?
Thanks
--
Brian V. Minier
Lead Software Engineer
Interactive Imaging Systems, Inc
www.iisvr.com
- Posted by Eliyas Yakub [MSFT] on August 23rd, 2003
Ref count 1 means that the interface is enabled. I don't think you should really dig that deep in the registry. What is the name of the GUID you are registering? Is that one of MS defined interface guids? Have you registered IRP_MJ_CREATE handler? The first think you need to find out is whether the access denied error is returned by the system due to security or exclusivity issue or some other driver in your device stack is failing the IRP_MJ_CREATE. You can set a break on the create dispath routine of the top level driver for your devicestack and see if you hit that.
Example:
Let us say 0x81F18808 is your deviceobject. Do !devstack on it to get information on the entire devstack.
1: kd> !devstack 0x81F18808
!DevObj !DrvObj !DevExt ObjectName
!DevNode 8220a270 :
DeviceInst is "PCI\VEN_8086&DEV_1229&SUBSYS_000E8086&REV_08\3&61 aaa01&0&48"
ServiceName is "GenPCI"
Now pick the toplevel driver "GenPCI" and do the following.
1: kd> !drvobj GENPCI 2
Driver object (81e2af38) is for:
\Driver\GenPCI
DriverEntry: f351b0a2 pcidrv!DriverEntry
DriverStartIo: 00000000
DriverUnload: f34fc0a0 pcidrv!FxCoreDriverUnload
Dispatch routines:
[00] IRP_MJ_CREATE f34fbcbd pcidrv!FxCoreGlobalDispatch
[01] IRP_MJ_CREATE_NAMED_PIPE f34fbcbd pcidrv!FxCoreGlobalDispatch
[02] IRP_MJ_CLOSE f34fbcbd pcidrv!FxCoreGlobalDispatch
[03] IRP_MJ_READ f34fbcbd pcidrv!FxCoreGlobalDispatch
[04] IRP_MJ_WRITE f34fbcbd pcidrv!FxCoreGlobalDispatch
[05] IRP_MJ_QUERY_INFORMATION f34fbcbd pcidrv!FxCoreGlobalDispatch
[06] IRP_MJ_SET_INFORMATION f34fbcbd pcidrv!FxCoreGlobalDispatch
[07] IRP_MJ_QUERY_EA f34fbcbd pcidrv!FxCoreGlobalDispatch
[08] IRP_MJ_SET_EA f34fbcbd pcidrv!FxCoreGlobalDispatch
[09] IRP_MJ_FLUSH_BUFFERS f34fbcbd pcidrv!FxCoreGlobalDispatch
[0a] IRP_MJ_QUERY_VOLUME_INFORMATION f34fbcbd pcidrv!FxCoreGlobalDispatch
[0b] IRP_MJ_SET_VOLUME_INFORMATION f34fbcbd pcidrv!FxCoreGlobalDispatch
[0c] IRP_MJ_DIRECTORY_CONTROL f34fbcbd pcidrv!FxCoreGlobalDispatch
[0d] IRP_MJ_FILE_SYSTEM_CONTROL f34fbcbd pcidrv!FxCoreGlobalDispatch
[0e] IRP_MJ_DEVICE_CONTROL f34fbcbd pcidrv!FxCoreGlobalDispatch
[0f] IRP_MJ_INTERNAL_DEVICE_CONTROL f34fbcbd pcidrv!FxCoreGlobalDispatch
[10] IRP_MJ_SHUTDOWN f34fbcbd pcidrv!FxCoreGlobalDispatch
[11] IRP_MJ_LOCK_CONTROL f34fbcbd pcidrv!FxCoreGlobalDispatch
[12] IRP_MJ_CLEANUP f34fbcbd pcidrv!FxCoreGlobalDispatch
[13] IRP_MJ_CREATE_MAILSLOT f34fbcbd pcidrv!FxCoreGlobalDispatch
[14] IRP_MJ_QUERY_SECURITY f34fbcbd pcidrv!FxCoreGlobalDispatch
[15] IRP_MJ_SET_SECURITY f34fbcbd pcidrv!FxCoreGlobalDispatch
[16] IRP_MJ_POWER f34fbcbd pcidrv!FxCoreGlobalDispatch
[17] IRP_MJ_SYSTEM_CONTROL f34fbcbd pcidrv!FxCoreGlobalDispatch
[18] IRP_MJ_DEVICE_CHANGE f34fbcbd pcidrv!FxCoreGlobalDispatch
[19] IRP_MJ_QUERY_QUOTA f34fbcbd pcidrv!FxCoreGlobalDispatch
[1a] IRP_MJ_SET_QUOTA f34fbcbd pcidrv!FxCoreGlobalDispatch
[1b] IRP_MJ_PNP f34fbcbd pcidrv!FxCoreGlobalDispatch
This one displays all the dispatch routines registered by the driver. Now set a breakpoint on create (bp pcidrv!FxCoreGlobalDispatch) and see you hit that breakpoint. If you don't when the app calls CreateFile then you have some other problem in the usermode.
--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/whdc/hwdev/driver/kb-drv.mspx
- Posted by Brian on August 25th, 2003
Ok, after setting a break point on SSD!SS_Create and running my user app, I do NOT get a break. Just to check, is it a problem that I do not see SSD!FxCoreGlobalDispatch when I list all the IRP dispatch routines? I wouldn't think so but at this point I'm totally stumped.
Thank you for your time.
--
Brian V. Minier
Lead Software Engineer
Interactive Imaging Systems, Inc
www.iisvr.com
"Brian" <brian_minier@no-spam.iisvr.com> wrote in message news:u%23qdHC0aDHA.2136@TK2MSFTNGP10.phx.gbl...
The name of my GUID is SECOND_SIGHT_GUID and was genereted with Create GUID. IRP_MJ_CREATE is registered in DriverEntry and I do not see my kdprints for SS_Create, but will attempt to verify by following the example you posted.
--
Brian V. Minier
Lead Software Engineer
Interactive Imaging Systems, Inc
www.iisvr.com
"Eliyas Yakub [MSFT]" <eliyasy@online.microsoft.com> wrote in message news:OdjyMFRaDHA.1384@TK2MSFTNGP10.phx.gbl...
Ref count 1 means that the interface is enabled. I don't think you should really dig that deep in the registry. What is the name of the GUID you are registering? Is that one of MS defined interface guids? Have you registered IRP_MJ_CREATE handler? The first think you need to find out is whether the access denied error is returned by the system due to security or exclusivity issue or some other driver in your device stack is failing the IRP_MJ_CREATE. You can set a break on the create dispath routine of the top level driver for your devicestack and see if you hit that.
Example:
Let us say 0x81F18808 is your deviceobject. Do !devstack on it to get information on the entire devstack.
1: kd> !devstack 0x81F18808
!DevObj !DrvObj !DevExt ObjectName
!DevNode 8220a270 :
DeviceInst is "PCI\VEN_8086&DEV_1229&SUBSYS_000E8086&REV_08\3&61 aaa01&0&48"
ServiceName is "GenPCI"
Now pick the toplevel driver "GenPCI" and do the following.
1: kd> !drvobj GENPCI 2
Driver object (81e2af38) is for:
\Driver\GenPCI
DriverEntry: f351b0a2 pcidrv!DriverEntry
DriverStartIo: 00000000
DriverUnload: f34fc0a0 pcidrv!FxCoreDriverUnload
Dispatch routines:
[00] IRP_MJ_CREATE f34fbcbd pcidrv!FxCoreGlobalDispatch
[01] IRP_MJ_CREATE_NAMED_PIPE f34fbcbd pcidrv!FxCoreGlobalDispatch
[02] IRP_MJ_CLOSE f34fbcbd pcidrv!FxCoreGlobalDispatch
[03] IRP_MJ_READ f34fbcbd pcidrv!FxCoreGlobalDispatch
[04] IRP_MJ_WRITE f34fbcbd pcidrv!FxCoreGlobalDispatch
[05] IRP_MJ_QUERY_INFORMATION f34fbcbd pcidrv!FxCoreGlobalDispatch
[06] IRP_MJ_SET_INFORMATION f34fbcbd pcidrv!FxCoreGlobalDispatch
[07] IRP_MJ_QUERY_EA f34fbcbd pcidrv!FxCoreGlobalDispatch
[08] IRP_MJ_SET_EA f34fbcbd pcidrv!FxCoreGlobalDispatch
[09] IRP_MJ_FLUSH_BUFFERS f34fbcbd pcidrv!FxCoreGlobalDispatch
[0a] IRP_MJ_QUERY_VOLUME_INFORMATION f34fbcbd pcidrv!FxCoreGlobalDispatch
[0b] IRP_MJ_SET_VOLUME_INFORMATION f34fbcbd pcidrv!FxCoreGlobalDispatch
[0c] IRP_MJ_DIRECTORY_CONTROL f34fbcbd pcidrv!FxCoreGlobalDispatch
[0d] IRP_MJ_FILE_SYSTEM_CONTROL f34fbcbd pcidrv!FxCoreGlobalDispatch
[0e] IRP_MJ_DEVICE_CONTROL f34fbcbd pcidrv!FxCoreGlobalDispatch
[0f] IRP_MJ_INTERNAL_DEVICE_CONTROL f34fbcbd pcidrv!FxCoreGlobalDispatch
[10] IRP_MJ_SHUTDOWN f34fbcbd pcidrv!FxCoreGlobalDispatch
[11] IRP_MJ_LOCK_CONTROL f34fbcbd pcidrv!FxCoreGlobalDispatch
[12] IRP_MJ_CLEANUP f34fbcbd pcidrv!FxCoreGlobalDispatch
[13] IRP_MJ_CREATE_MAILSLOT f34fbcbd pcidrv!FxCoreGlobalDispatch
[14] IRP_MJ_QUERY_SECURITY f34fbcbd pcidrv!FxCoreGlobalDispatch
[15] IRP_MJ_SET_SECURITY f34fbcbd pcidrv!FxCoreGlobalDispatch
[16] IRP_MJ_POWER f34fbcbd pcidrv!FxCoreGlobalDispatch
[17] IRP_MJ_SYSTEM_CONTROL f34fbcbd pcidrv!FxCoreGlobalDispatch
[18] IRP_MJ_DEVICE_CHANGE f34fbcbd pcidrv!FxCoreGlobalDispatch
[19] IRP_MJ_QUERY_QUOTA f34fbcbd pcidrv!FxCoreGlobalDispatch
[1a] IRP_MJ_SET_QUOTA f34fbcbd pcidrv!FxCoreGlobalDispatch
[1b] IRP_MJ_PNP f34fbcbd pcidrv!FxCoreGlobalDispatch
This one displays all the dispatch routines registered by the driver. Now set a breakpoint on create (bp pcidrv!FxCoreGlobalDispatch) and see you hit that breakpoint. If you don't when the app calls CreateFile then you have some other problem in the usermode.
--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/whdc/hwdev/driver/kb-drv.mspx