locked
MoFxApp build to X86 Package on X64 platform access denied

    Question

  • Hi all,

    I installed MoFxApp on my X64 platform, and I already installed my device driver. On the X64 platform is ok.

    When I build to x86 on my X86 platform, it occur access denied at hr = access->GetResult(IID_PPV_ARGS(&deviceControl));

    How can I do?

    Thursday, March 22, 2012 1:45 AM

Answers

  • Use traceview from the WDK to view the error messages reported from deviceaccess.dll.  The output from that will tell you what part of the authentication process failed.  If you point traceview at the public symbol server, you should be able to add deviceaccess.dll to your trace session through the UI and get trace message decoding.

    If you don’t have test signing enabled on the system (and haven’t rebooted since enabling it) the device metadata system won’t set the properties that enable device access.  But it will set the other properties, so you may still see the fancy device icon.

    The instructions below will help you figure out if the device property is actually being set on their device.

    DRAFT instructions:

    Debug the device container properties by Using Ddodiag.exe If you debug a device metadata package problem or any device properties problem, we recommend that you use Ddodiag.exe.

    Beginning with Windows 7, the Ddodiag.exe supports listing all values of the device properties in device containers.

    Follow these steps to run Ddodiag.exe:

    1.    Launch command prompt.

    2.    Type “Start /wait ddodiag.exe –o <Filename.xml>” and hit enter key.

    3.    Type notepad.exe <Filename.xml>.

    Note:  The xml contains all properties of device containers in the system. If you are investigating given specific device problem, find the hardwareID or ModelID in the XML output file and see the properties of the device container. If you are investigating whether given property value is set or not, try to find the value in that XML output file.

    Here is how you can quickly tell if Device Metadata is installed properly:

    1.       For the relevant Hardware ID - look for the DDO element (the device container) and see all properties that belong to the container.   One of the properties is MetadataPath. 

    2.       If filename listed in MetadataPath does not match the target name, it isn’t installed properly and solution is to re-install the device metadata.


    If device metadata is installed properly, the values you set for Manufacturer Name or Package Name for that Hardware ID should be listed properly.  At this point, look for the relevant properties needed are properly declared in device metadata.

     Best Wishes - Eric

    • Marked as answer by BRN_H Monday, April 2, 2012 4:11 AM
    Saturday, March 24, 2012 6:25 PM
    Moderator

All replies

  • Add some information.

    driver : Visual studio 2011 C++ driver USB Kernel Mode Driver sample code . (just change Interface GUID)

    Metadata :

    App : MoFx2App

    String^
    Fx2Device::GetDeviceSelector()
    {
               OutputDebugStringW(L"GetDeviceSelector\n");

               return L"System.Devices.InterfaceClassGuid:=\"{331b0fc4-d37f-42ad-9483-7cdfb4f29a09}\" AND "
                         L"System.Devices.InterfaceEnabled:=System.StructuredQueryType.Boolean#True";
    }

    Thursday, March 22, 2012 8:03 AM
  • BRN_H,

    Could 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? 

    Best Wishes - Eric

    Thursday, March 22, 2012 4:28 PM
    Moderator
  • Eric,

    I tried, but it's not ok.

    Friday, March 23, 2012 1:37 AM
  • Have you enabled test signing on the system and then rebooted?

    Best Wishes - Eric

    Saturday, March 24, 2012 12:25 AM
    Moderator
  • Hi Eric,

    I have used Advanced Boot Option to select "disable driver signature Enforcement". And when I build this driver, it produced a .cat file.

    My driver is working ok.

    When i run the MoFx2App, traceview will show the driver closed message.

    Saturday, March 24, 2012 4:01 PM
  • Use traceview from the WDK to view the error messages reported from deviceaccess.dll.  The output from that will tell you what part of the authentication process failed.  If you point traceview at the public symbol server, you should be able to add deviceaccess.dll to your trace session through the UI and get trace message decoding.

    If you don’t have test signing enabled on the system (and haven’t rebooted since enabling it) the device metadata system won’t set the properties that enable device access.  But it will set the other properties, so you may still see the fancy device icon.

    The instructions below will help you figure out if the device property is actually being set on their device.

    DRAFT instructions:

    Debug the device container properties by Using Ddodiag.exe If you debug a device metadata package problem or any device properties problem, we recommend that you use Ddodiag.exe.

    Beginning with Windows 7, the Ddodiag.exe supports listing all values of the device properties in device containers.

    Follow these steps to run Ddodiag.exe:

    1.    Launch command prompt.

    2.    Type “Start /wait ddodiag.exe –o <Filename.xml>” and hit enter key.

    3.    Type notepad.exe <Filename.xml>.

    Note:  The xml contains all properties of device containers in the system. If you are investigating given specific device problem, find the hardwareID or ModelID in the XML output file and see the properties of the device container. If you are investigating whether given property value is set or not, try to find the value in that XML output file.

    Here is how you can quickly tell if Device Metadata is installed properly:

    1.       For the relevant Hardware ID - look for the DDO element (the device container) and see all properties that belong to the container.   One of the properties is MetadataPath. 

    2.       If filename listed in MetadataPath does not match the target name, it isn’t installed properly and solution is to re-install the device metadata.


    If device metadata is installed properly, the values you set for Manufacturer Name or Package Name for that Hardware ID should be listed properly.  At this point, look for the relevant properties needed are properly declared in device metadata.

     Best Wishes - Eric

    • Marked as answer by BRN_H Monday, April 2, 2012 4:11 AM
    Saturday, March 24, 2012 6:25 PM
    Moderator
  • Hi Eric,

    I already to sign my driver, and installed again. But it looks no change.

    I use Ddodiag.exe to dump some information.

          <Property key="PKEY_DeviceDisplay_MetadataPath" type="VT_LPWSTR">
            <Value>c:\programdata\microsoft\windows\devicemetadatacache\dmrccache\multiloc\2df4c873-5789-4a11-bf43-31032144b3c6</Value>
          </Property>

          <Property key="PKEY_DeviceDisplay_Manufacturer" type="VT_LPWSTR">
            <Value>Fabrikam, Inc.</Value>
          </Property>

    so my device metadata should be installed properly.

    Can you help me to confirm that the driver and app can run on x86 platform?

    thanks.

    Monday, March 26, 2012 4:24 AM
  • This means that the metadata was applied however it does not mean that test signing was on when it was applied.  When test signing isn’t on, the device metadata system still applies some (but not all) of the properties.  Look for Property entries like this:

          <Property key="78c34fc8-104a-4aca-9ea4-524d52996e57, 107" type="VT_VECTOR |VT_LPWSTR" vectorCount="3">

    Or

          <Property key="78c34fc8-104a-4aca-9ea4-524d52996e57, 106" type="VT_VECTOR | VT_LPWSTR" vectorCount="3">

    And then see hardware IDs are in the DFO element within that container below the container’s <PropertyStore>.  For example: 

       <DFO instanceId="DFO:USB\VID_0547&amp;PID_1002\5&amp;21f6dcd1&amp;0&amp;5"> 

    There are no issues that I’m aware of with 32-bit platforms and MDAs.  This is still most likely a case of incorrectly configured device metadata. 

    Best Wishes - Eric




    Monday, March 26, 2012 6:56 PM
    Moderator