locked
A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A) RRS feed

  • Question

  • Hello all,

    I'm trying to use Windows store smart card sample. The PIN change is working correctly.

    Now, I try the verify response operation, an exception is thrown when I call

    provisioning.GetChallengeContextAsync().

    Exception details:

    A first chance exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll

    Additional information: A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A).

    When I load mscorlib.dll via dependencyWalker, I have missing libs: API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL, API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL, API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL, API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL

    Tuesday, October 1, 2013 2:00 PM

Answers

  • As a further follow up on this issue, CmSagYpsIDS3.x32.dll has a dependency on comctl32.dll that blocks the mini-driver from being loaded in the Windows Store app.

    Generally speaking, any mini-card driver that has a dependency on comctl32.dll will fail to load. These type of drivers (which have a dependency on comctl32.dll) are not supported in Windows Store apps.


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Tuesday, October 29, 2013 4:41 PM
    Moderator

All replies

  • I tried running the app on a machine with TPM enabled and it ran fine through scenarios 1, 2 and 5. For your issue:

    1. Is this happening on 8.1 Preview or 8.1 RTM build?

    2. Can you create a dump file and share it via SkyDrive? To create a dump file, use Visual Studio to debug the smart card sample, and then when you break on the exception, choose Debug--> Save Dump as option in Visual Studio.

    That might throw some light on what was not found.

    Alternately, you could try running Process Monitor and find files/registry which were not found. If you cannot figure this out, you can also share the Process Monitor trace via SkyDrive.


    Windows Store Developer Solutions #WSDevSol || Want more solutions? See our blog, http://aka.ms/t4vuvz

    Wednesday, October 2, 2013 12:52 AM
    Moderator
  • It's happening on 8.1 Preview. I use physical smart card instead of a TPM (TPM scenarios work fine).

    Here is the link to both dumpfile and Process Monitor:

    http://sdrv.ms/15IlN5f


    • Edited by Youssef A Wednesday, October 2, 2013 10:47 AM
    Wednesday, October 2, 2013 10:46 AM
  • I get the same exception with Windows 8.1 RTM and visual Studio 2013 RC.
    Thursday, October 3, 2013 9:00 AM
  • It seems that the DLL load of: C:\Windows\System32\CmSagYpsIDS3.x32.dll fails which is why you are getting this issue. Does this problem only happen with the SAGEM ypsID S3 v1 Identity Card provider or can you repro it with let's say TPM as well or other Smart card provider?

    Thanks,

    Prashant.


    Windows Store Developer Solutions #WSDevSol || Want more solutions? See our blog, http://aka.ms/t4vuvz

    Friday, October 4, 2013 1:31 AM
    Moderator
  • Thanks for this answer.

    C:\Windows\System32\CmSagYpsIDS3.x32.dll does exist and is correctly loaded in desktop environment via CSP (CryptAcquireContext, hash etc).

    All TPM scenarios in the sample pass successufully. I tried another card provider (CmSagIdeal.x32.dll) and I have the same problem as for CmSagYpsIDS3.x32.dll.

    For information, changePin in the sample works correctly.

    When I open the CmSagYpsIDS3.x32.dll with dependency Walker it misses the dll mentioned in my first post above.

    Thank you for your precious help.

    Friday, October 4, 2013 8:12 AM
  • I'm wondering if physical smart card readers are really supported in Windows 8.1. Does some succeded doing it?
    Tuesday, October 8, 2013 5:33 AM
  • Has someone succeded to use a physical smart card (not TPM) reader with a windows store app? If yes, I will be interested as I'm having problems to load my smart card mini driver.
    Tuesday, October 8, 2013 10:26 AM
  • Hi Youssef,

    I am still investigating whether this is a supported scenario with the feature team. I will respond back on this thread when I have more to share.

    Thanks,

    Prashant.


    Windows Store Developer Solutions #WSDevSol || Want more solutions? See our blog, http://aka.ms/t4vuvz

    Tuesday, October 8, 2013 4:57 PM
    Moderator
  • Thank you for the feedback.

    Best regards,

    Tuesday, October 8, 2013 5:00 PM
  • Hello Youssef,

    Using physical smart cards with smart card WinRT API is supported as long as the matching smart card mini-driver can be loaded. It looks like an issue with the mini-driver of the card. We were unable to load it into the AppContainer process.

    Can you check what are the dependencies of CmSagYpsIDS3.x32.dll? As well as try to check the System and Application event log and see whether there are any hints about failed binary loading.

    I also wanted to clarify your usage of the sample. The Windows 8.1 sample specifically targets a TPM scenario to create a Virtual Smart card, change Pin etc. Did you actually modify the sample to make it work with the Physical smart card?

    Also, can you let us know the Hardware ID of the Smart card you are trying out? You can find this information through Device Manager -> Smart Card - > Choose the problem Smart card -> Double Click it -> Click Details tab -> From the Properties list choose --> Hardware ID. When you see the hardware ID, right click, choose Copy and paste it here. The value will start with "scfilter"

    Thanks,

    Prashant.


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog


    Tuesday, October 22, 2013 10:23 PM
    Moderator
  • Thank you for this reply:

    The dependencies of CmSagYpsIDS3.x32.dll are contained in CmSagYpsIDS3.x32.dwi under http://sdrv.ms/15IlN5f.

    I see nothing under application ans system event logs.

    Yes I modified the sample (just iterating on my available smart cards and choosing the physical one).

    Hardware Id:

    SCFILTER\CID_00487970734944205333079000

    Best regards,

    Wednesday, October 23, 2013 9:05 AM
  • Hello Youssef,

    CmSagYpsIDS3.x32.dll has dependency on MORPHO_SDK.DLL and BSAPI.DLL. None of these two files are present in the process dump – could be because they cannot be loaded. Can you locate these two files, like where they are in the system and what they depend on?

    Thanks,

    Prashant.


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Tuesday, October 29, 2013 12:00 AM
    Moderator
  • As a further follow up on this issue, CmSagYpsIDS3.x32.dll has a dependency on comctl32.dll that blocks the mini-driver from being loaded in the Windows Store app.

    Generally speaking, any mini-card driver that has a dependency on comctl32.dll will fail to load. These type of drivers (which have a dependency on comctl32.dll) are not supported in Windows Store apps.


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Tuesday, October 29, 2013 4:41 PM
    Moderator
  • Thank you very mutch for your clear response and precious help
    Tuesday, October 29, 2013 4:46 PM