locked
ICreateDeviceAccessAsync returns E_ACCESSDENIED

    Question

  • I am developing a Windows Store App that communicates with a driver like the sample here http://code.msdn.microsoft.com/windowsapps/Custom-device-access-sample-43bde679. 

    I have followed the example but get an E_ACCESSDENIED when calling ICreateDeviceAccessAsync::GetResult().

    Here is a sanitized TraceView dump of deviceaccess.dll using my Windows Store App and custom driver:

    DeviceAccess	DeviceBroker: Opening handle for instance path \\?\ACPI#XXX3400#2&daba3ff&1#{0043cbde-43a1-481a-a5a7-30e23f38321e}
    DeviceAccess	DeviceInterfaceAccessCheck:  Entering for class GUID {0043CBDE-43A1-481A-A5A7-30E23F38321E}.
    DeviceAccess	DeviceInterfaceAccessCheck: Device interface path \\?\ACPI#XXX3400#2&daba3ff&1#{0043cbde-43a1-481a-a5a7-30e23f38321e} is restricted.
    DeviceAccess	DeviceInterfaceAccessCheck: Opening restricted interface; checking for AppID match.
    DeviceAccess	DeviceInterfaceAccessCheck: Checking for package "abcd.efgh.ijkl_gyer1wweeafyy" in privileged list for path \\?\ACPI#XXX3400#2&daba3ff&1#{0043cbde-43a1-481a-a5a7-30e23f38321e}.
    DeviceAccess	DeviceInterfaceAccessCheck: Container for path \\?\ACPI#XXX3400#2&daba3ff&1#{0043cbde-43a1-481a-a5a7-30e23f38321e} is {00000000-0000-0000-FFFF-FFFFFFFFFFFF}.
    DeviceAccess	DeviceBroker: Failed access check with hr 80070005.
    DeviceAccess	DeviceBroker: Exiting OpenDeviceFromInterfacePath with hr 80070005.

    Note that the privileged app list does not have any entries!

    For comparison, TraceView dump of deviceaccess.dll using the custom device access example (I have an OSR USB-FX-2 learning kit):

    DeviceAccess	DeviceBroker: Opening handle for instance path \\?\USB#VID_0547&PID_1002#6&58d4601&0&2#{573e8c73-0cb4-4471-a1bf-fab26c31d384}
    DeviceAccess	DeviceInterfaceAccessCheck:  Entering for class GUID {573E8C73-0CB4-4471-A1BF-FAB26C31D384}.
    DeviceAccess	DeviceInterfaceAccessCheck: Device interface path \\?\USB#VID_0547&PID_1002#6&58d4601&0&2#{573e8c73-0cb4-4471-a1bf-fab26c31d384} is restricted.
    DeviceAccess	DeviceInterfaceAccessCheck: Opening restricted interface; checking for AppID match.
    DeviceAccess	DeviceInterfaceAccessCheck: Checking for package "microsoft.sdksamples.customdeviceaccess.cs_8wekyb3d8bbwe" in privileged list for path \\?\USB#VID_0547&PID_1002#6&58d4601&0&2#{573e8c73-0cb4-4471-a1bf-fab26c31d384}.
    DeviceAccess	DeviceInterfaceAccessCheck: Container for path \\?\USB#VID_0547&PID_1002#6&58d4601&0&2#{573e8c73-0cb4-4471-a1bf-fab26c31d384} is {BC1A0B61-1886-11E2-BE9A-888888888788}.
    DeviceAccess	DeviceInterfaceAccessCheck: Found privileged app list.
    DeviceAccess	DeviceInterfaceAccessCheck: Found package "Microsoft.SDKSamples.CustomDeviceAccess.JS_8wekyb3d8bbwe" in privileged list; not a match.
    DeviceAccess	DeviceInterfaceAccessCheck: Found package match.
    DeviceAccess	DeviceBroker: Successfully brokered handle.
    DeviceAccess	DeviceBroker: Exiting OpenDeviceFromInterfacePath with hr 0.


    I followed the exact same Driver->Device Metadata->Authoring, reboot, disable driver signiture enforcement, install driver, steps in both cases.

    Is there anything else I can do to debug/resolve why my driver does not have a privileged apps list?

    Thanks!


    • Edited by SHIFTLOCK_ Wednesday, October 17, 2012 11:51 PM privacy
    Wednesday, October 17, 2012 6:57 PM

All replies

  • Forgot to mention:  my driver solution file actually contains seven driver projects.  I had this super solution open when doing the driver metadata authoring.  Does this matter?  

    I also tried authoring driver metadata after opening only the single driver solution that the App is communicating with, but this didn't work either.

    Wednesday, October 17, 2012 11:10 PM
  • You should add this to your Package.appxmanifest file:

     <Capabilities>
        <DeviceCapability Name="GUID" />
     </Capabilities>

    GUID - is your device interface id. (System.Devices.InterfaceClassGuid)

    • Proposed as answer by Can BilginMVP Sunday, January 27, 2013 8:59 AM
    Monday, December 24, 2012 5:34 PM