locked
OSRUsbFx2 driver+MoFx2App E_ACCESSDENIED issue--Need Help

    Question

  • --Amendment to original question--
    I think I am facing an issue with Device Metadata Store when testing the OSR learning kit and MoFx2App from sample gallery. Except for the OSR board(the order is still on its way), I had driver installed with devcon.exe(show exclamatory marke on icon of device manager) and Metro side setup according to document instructed.
    Additionally, I updated <ShowDeviceInDisconnectedState>true</ShowDeviceInDisconnectedState> element in WindowsInfo.xml inside Device metadata package. Also changed program.js code "var selector = "System.Devices.InterfaceClassGuid:={50DD5230-BA8A-11D1-BF5D-0000F805F530} AND " + "System.Devices.InterfaceEnabled:=FALSE"; "
    After launched MoFx2App sample, the sample showed the identical error message like this thread http://social.msdn.microsoft.com/Forums/en-US/tailoringappsfordevices/thread/1a18d08b-6c7b-4300-8e87-f73f4f55ad78. (MoFx2App ICreateDeviceAccessAsync::GetResult() returned E_AccessDenied)
    I was expecting to see some error message related to "device state" topic, but why Access Denied?
    Some observations and notes were recorded:
    -In addition to the error message, the device was failed to be listed in "Control Panel\Devices and Printers" either. According to Device Metadata package doc, it should be listed in dim color based on the WindowsInfo.xml setting: <ShowDeviceInDisconnectedState>true</ShowDeviceInDisconnectedState>, right?
    -Can't see any ETW event fired from Event Viewer either ("Enable log" was checked).
    Wondering if there is something wrong with Device metadata package shipped inside OSRUsbFx2 WDK , I simply copied over Device store folder w/o modification coz everything inside the package looks alright.
    -Noticed other preloaded device metadata packages in Device metadata store folder are all digitally signed with Sign.cat file for each subfolder, whileas mime doesn't. Is that the reason Access Denied?
    Sorry for the lengthy posting.
    Any useful hint is greatly appreciated!
    • Edited by Mr_Jones_ Monday, November 14, 2011 5:09 PM amendment
    Thursday, November 10, 2011 5:16 AM

Answers

  • One question still has no answers for: if it's possible to have a Bus Driver(creating PDO) with matching Function driver to support the custom-device scenario, so that Metro app can access simulated devices?

    Mr Jones,

     

    Great question.  Metro style apps do not support simulated devices in any manner.  Creating a bus driver does not change this.

     

    Best Wishes - Eric

    Wednesday, December 14, 2011 10:25 PM
    Moderator

All replies

  • Rolling Stone I will look into this for you. Best Wishes - Eric
    Friday, November 11, 2011 2:19 AM
    Moderator
  • Motivation behind this prototype is to build a driver for Metro app to use my 'Virtual device'.

    So it's the restricted access model I am trying to implement with customized driver, that is not working.

    One thing I did NOT do is declaring <ExperienceId> in <Relationships> element inside the StoreManifest.xml, because I can't find file location.

    Eric, I'm looking forward to your advises.

     


    Saturday, November 12, 2011 3:27 AM
  • Rolling Stone,

     

    Are you wanting to write a software only driver and communicate to it from a Metro style app? 

     

    Best Wishes - Eric

    Wednesday, November 16, 2011 1:34 AM
    Moderator
  • Eric,

    For the Access Denied error in Metro style app I describe above:

    -If the Device Metadata Package configure properly, am I supposed to see the device state in disconnected from "Devices and Printers" view? Should I sign it first for this to work? What process I should follow to sign a testing Device metadata package instead of copy it over DeviceMetadataStore folder?

    -I was expecting Metro to report error later when trying to get IDeviceIoControl object, but it stop earlier in ICreateDeviceAccessAsync::GetResult() call, is this expected for device not presented? Is the device disconnection state cause Metro app Access Denied error, or something else?

    -Also, Software driver for Metro style app is another question I'd like to ask about.

    Thanks,

    R.

    Wednesday, November 16, 2011 4:16 PM
  • Rolling Stone,

    It is not possible to access software only drivers from Metro style apps. 

    With regards to your other question:

     

    Did you restart the machine and go to Devices and Printers (Control Panel\Hardware and Sound\Devices and Printers) and press F5 to refresh the container?  You may need to wait for the hardware to arrive from OSR...

    Wednesday, November 16, 2011 11:28 PM
    Moderator
  • I finally got the OSR kit. Immediately recompiled UMDF driver(%WDK_DIR%\src\USB\osrusbfx2\umdf\fx2_driver\final) and get it installed.

    Driver metadata package already copied into the Driver Store en-us folder.

    "Control Panel\Devices and Printers" have Fx2 icon show up as well as device info display correctly.

     

    However, MoFx2App sample(no code change) still reported Access Denied error, screen shot attached below. Please advise.

     

    As far as software-driver is concerned, I am wondering if Bus Driver+Function Driver will be one way that official supports? It's because I am working on porting device emulator drivers from Desktop to Metro style app. Thank you.


    • Edited by Mr_Jones_ Monday, November 28, 2011 4:50 AM
    Saturday, November 26, 2011 4:31 AM
  • Rolling Stone,

     

    I am glad you got your board in the mail.  Did you restart the machine and go to Devices and Printers (Control Panel\Hardware and Sound\Devices and Printers) and press F5 to refresh the container?

    Tuesday, November 29, 2011 12:54 AM
    Moderator
  • OSR Kit start working after I reinstalling the Win8 all over, previous reason of failure remains mysterious to me.

    One question still has no answers for: if it's possible to have a Bus Driver(creating PDO) with matching Function driver to support the custom-device scenario, so that Metro app can access simulated devices?

    If so, how to do that?

    Tuesday, November 29, 2011 10:02 PM
  • RS - Good news on that working.  I am looking into the bus driver idea.

     

    Best Wishes - Eric

    Tuesday, November 29, 2011 10:32 PM
    Moderator
  • In general when you get access denied please check the following,

     

    1. Ensure that the driver inf has the property key set to enable access to metro applications. Look at the OSRUSBFX2 sample INF for information on how to set this property key.

    2. The device metadata has been authored for the device and it has been loaded into the system.

    3. The device metadata has the right information notably the PrivilegedApplications section

    4. The application manifest as the interface guid declared as a DeviceCapability.

    Wednesday, November 30, 2011 7:22 PM
  • Eric mentioned several times "hitting F5 to refresh 'Device and Printers' container", I am wondering is this a step required in future production version, or it's a bug existing in current version?

     

    Thanks,

    Tuesday, December 6, 2011 7:07 PM
  • Eric mentioned several times "hitting F5 to refresh 'Device and Printers' container", I am wondering is this a step required in future production version, or it's a bug existing in current version?

     

    Thanks,


    Just an issue with the //preview build.
    Tuesday, December 6, 2011 10:15 PM
    Moderator
  • Thanks Eric, any update on bus driver compliance issue I raised above?
    Wednesday, December 7, 2011 4:44 AM
  • RS,

    Support in the //build preview covers built in devices and devices attached to external busses such as the MoFx2App Sample and external credit card readers.

    Best Wishes - Eric

    Saturday, December 10, 2011 12:14 AM
    Moderator
  • One question still has no answers for: if it's possible to have a Bus Driver(creating PDO) with matching Function driver to support the custom-device scenario, so that Metro app can access simulated devices?

    Mr Jones,

     

    Great question.  Metro style apps do not support simulated devices in any manner.  Creating a bus driver does not change this.

     

    Best Wishes - Eric

    Wednesday, December 14, 2011 10:25 PM
    Moderator
  •  

    I have created a simple plug and play driver which I install using control panel in DEVICES.

    hr = CreateDeviceAccessInstance(IID_IDeviceIoControl,L"\\\\?\\ROOT#SYSTEM#0001#{6A1F2554-9865-41B0-8020-5196350F4C8F}",(GENERIC_READ | GENERIC_WRITE),&pCreateDeviceAccessAsync);

     hr = pCreateDeviceAccessAsync->Start();

     hr = pCreateDeviceAccessAsync->Wait(INFINITE);

    -----------------Using dbgview I can see IRP_MJ_CREATE and IRP_MJ_CLOSE being sent to driver

     hr = pCreateDeviceAccessAsync->GetResult((void**) &m_pDeviceIoControl);  ---------------- Here it is system cannot find specified file.

    How is it determined wheather the driver talks to actual hardware or not.

    Is there any way to let the system know that I am using actual hardware by using some API.

     


    Windows developer
    Wednesday, January 25, 2012 2:57 PM
  • AMSingh,

     

    What type of hardware is your driver for?

     

    Best Wishes - Eric

    Thursday, January 26, 2012 1:09 AM
    Moderator
  • There is no actual hardware.The device is a pseudo device.From earlier discussion you mentioned this is not supported.

     

    My question is there any way to make it work.

    In build video or anywhere else no where it mentions actual device only.

     

    How the system determines that actual hardware is not present.


    Windows developer
    Thursday, January 26, 2012 8:10 AM
  • Rolling Stone,

     

    Are you wanting to write a software only driver and communicate to it from a Metro style app? 

     

    Best Wishes - Eric


    Hi Eric,

     

    Now I have this demand. How should I do within C++ Metro style app?

     

    Thanks.

    Tuesday, January 31, 2012 5:30 AM
  •  Rolling Stone,

     It is not possible to access software only drivers from Metro style apps. 

     

    With regards to your other question:

     

    Did you restart the machine and go to Devices and Printers (Control Panel\Hardware and Sound\Devices and Printers) and press F5 to refresh the container?  You may need to wait for the hardware to arrive from OSR...

    Hi Eric,

    >It is not possible to access software only drivers from Metro style apps. 

    Now I have a driver (.sys file), and it has been installed in my system with a INF file. Of course, I have registered a device interface with a GUID in the driver. Now I wanna open the device interface with the same GUID as that in my Metro style and send IOCTLs I defined to the driver. That's what I want to do.

     

    Per your information, I cannot reach my  hope for ever, right? If so, what should I do more?

     

    Thanks.

     

    Best wishes,


    • Edited by Carl Bao Tuesday, January 31, 2012 5:39 AM
    Tuesday, January 31, 2012 5:38 AM
  • AMSingh,

     

    What type of hardware is your driver for?

     

    Best Wishes - Eric


    Hi Eric,

     

    My driver is a HDD filter driver. And I think demand and me have the the same demand.

    > hr = pCreateDeviceAccessAsync->GetResult((void**) &m_pDeviceIoControl);  ---------------- Here it is system cannot find specified file.

    But in my Metro style, hr = pCreateDeviceAccessAsync->GetResult((void**) &m_pDeviceIoControl);  ------------Here returns access denied.

     

    Sorry for another question, Is there a sample code about Metro style app accessing a virtual device which is C++ version?

     

    Thanks.

     

    B.R.

    Tuesday, January 31, 2012 5:53 AM
  • No official microsoft documentation   denies or support it.

    It is not explained why this fail to work.

    Getting this answer we can think about  ways how to do it.


    Windows developer
    Tuesday, January 31, 2012 8:28 AM
  • Communicaton from Metro Style apps to drivers without hardware is not supported.  Additional information will become available sometime after the Consumer Preview timeframe with regards to this support.
    Tuesday, January 31, 2012 7:28 PM
    Moderator
  • Hi Eric,

    Could you provide some information regarding to the plan on this support (Communicaton from Metro Style apps to drivers without hardware)? Is it to be supported or not in the future? The Consumer Preview has one month to go. But we need the information to make our design decision now. Thanks.

    Wednesday, February 1, 2012 1:19 AM
  • Communicaton from Metro Style apps to drivers without hardware is not supported.  Additional information will become available sometime after the Consumer Preview timeframe with regards to this support.


    Hi Eric,

     

    It's so excited to receive your response, thanks very much.

     

    As everyone knows, there is one or more HDD in our computer. So the HDD is just the hardware you mentioned, ok?

    And now, I have a lower filter driver which is beneath the disk.sys. In my lower filter driver, I created a device object with device name setting to NULL and attached it to the device stack. Then I registered a device interface for the device object with a GUID. Although it is created by a filter driver, I think that device object is a functional device object, yes?

     

    Now, what I want to do is to open that device object and then send my IOCTLs to the device object in my metro style app. Per your information, that would not be supported. Yes?

     

    Thanks a lot.

     

    Best wishes.



    • Edited by Carl Bao Wednesday, February 1, 2012 1:39 AM
    Wednesday, February 1, 2012 1:37 AM
  • I have the same question as Carl Bob.
    • Edited by maomx Wednesday, February 1, 2012 6:01 AM
    Wednesday, February 1, 2012 6:00 AM
  • I have the same question as Carl Bob.


    Hi maomx,

     

    Maybe we can discuss that question with each other. My email address is

    "baoshanqiang at 163 dot com"

    Do you mind if I want to make friends with you?

     

    Best wishes.

    Wednesday, February 1, 2012 6:13 AM
  • I am glad to make friend with you ,my email is maomx@lenovo.com
    Wednesday, February 1, 2012 6:30 AM