CreateDeviceAccessInstance Permissions Problem


  • Hi, I'm attempting to communicate with my device driver using CreateDeviceAccessInstance(), and am receiving access denied. I'm guessing this is due to a permissions mismatch between my metro app and my device driver. I've followed the steps found in other posts. (adding a privileged interface property to the device driver's .inf file, adding that interface to the .appmanifest file, and creating a metadata file using the authoring tool built into visual studios) Even with all this done, I'm still unable to communicate with my driver.

    With this in-mind, I'd like to get clarification on parts of this process. My first question is, do I need to register a custom interface GUID just for the Metro app? Or can I use one that already exists in my project? My second question is, how do I handle installing the metadata file? Is it possible to install this file during the driver install?




    Thursday, June 14, 2012 9:29 PM


All replies

  • David,

    Did you enable test signing and reboot?

    Best Wishes - Eric

    Friday, June 15, 2012 12:23 AM
  • Yes. Test Mode is enabled.
    Friday, June 15, 2012 10:49 PM
  • What hardware device are you targeting?  Is the device external or internal to the PC?

    Best Wishes - Eric

    Saturday, June 16, 2012 12:59 AM
  • It's an internal audio device.

    Monday, June 18, 2012 4:51 PM
  • Hi Eric,

    Thanks for the help so far. Does that mean that it isn't possible to communicate with my driver at this time? I feel that I'm very close to doing so. I've already created a separate guid for my driver and set the permissions appropriately. Using instructions from another thread I was able to confirm this using the ddodiag tool:

          <DIO instanceId="DIO:\\?\ROOT#MEDIA#0000#{30f9421f-753a-4630-b863-216e321a991e}">
            <PropertyStore propertyCount="6">
              <Property key="PKEY_DeviceInterface_Enabled" type="VT_BOOL">
              <Property key="PKEY_Device_InstanceId" type="VT_LPWSTR">
              <Property key="PKEY_DeviceInterface_DevicePath" type="VT_LPWSTR">
              <Property key="PKEY_DeviceInterface_ClassGuid" type="VT_CLSID">
              <Property key="026e516e-b814-414b-83cd-856d6fef4822, 6" type="VT_BOOL">
              <Property key="PKEY_Device_ContainerId" type="VT_CLSID">

    I assume that the correct key to use here is {026e516e-b814-414b-83cd-856d6fef4822} to set permissions to restricted.

    I've also made sure that the guid is set in the appmanifest file:

        <DeviceCapability Name="30F9421F-753A-4630-B863-216E321A991E" />

    Finally, I've created a metadata file, and moved it to the metadata store (%ProgramData%\Microsoft\Windows\DeviceMetadataStore). However, even with all this I still receive error 0x80070005 (E_ACCESSDENIED).

    Tuesday, June 19, 2012 4:09 PM
  • We have yet to publish information about internal specialized devices from a Metro style app.

    Best Wishes - Eric

    Tuesday, June 19, 2012 5:30 PM