none
Installing Smart Card subsystem without Platform Builder ? RRS feed

  • Question

  • It is possible to install the Smart Card subsystem without building a new image in Platform Builder ?

    I tried to add scard.dll (and the appropriate registry keys) / winscard.dll - but the resource manager is not working...

    My Registry Keys for the scard.dll:

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SmartCard]
       "Prefix"="SCA"
       "Dll"="FlashDrv\scard.dll"
       "Index"=dword:1
       "Order"=dword:1

    Friday, September 30, 2011 6:39 AM

All replies

  • I tried with 'ActivateDeviceEx' too, but no success ...
    Monday, October 3, 2011 6:05 AM
  • When ActivateDeviceEx fails, which error does GetLastError() return? Have you tried "Dll"="FlashDrv\\scard.dll" with a double backslash?

    Generally speaking, since Windows CE is a componentized OS, adding the registry entries and the DLL may not always be enough: when you include a specific feature during the development  process, the IDE takes care of the dependencies implicitely -if it's the case- adding other features/components.

    Apart this, a quick review of the %_WINCEROOT%\PUBLIC\CEBASE\OAK\MISC\winceos.bat file does not reveal other modules but scard.dll / winscard.dll involved in the smart card subsystem so you may be lucky


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    Monday, October 3, 2011 1:12 PM
  • GetLastError() returns 87 ...

    I tried "Dll"="FlashDrv\\scard.dll" with a double backslash too ...

    Tuesday, October 4, 2011 6:40 AM
  • The error, as you know, is ERROR_INVALID_PARAMETER. Check what you're passing to ActivateDeviceEx


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    Tuesday, October 4, 2011 7:28 AM
  • Hm, nothing special:

     

    ActivateDeviceEx("Drivers\\BuiltIn\\SmartCard", IntPtr.Zero, 0, IntPtr.Zero);
    

    Tuesday, October 4, 2011 7:50 AM
  • The first parameter must be a wide char string: L"Drivers\\BuiltIn\\SmartCard"
    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    Tuesday, October 4, 2011 7:55 AM
  • So i am calling ActivateDeviceEx from .net code - but how i convert "Drivers\\BuiltIn\\SmartCard" to L"Drivers\\BuiltIn\\SmartCard" ?
    Tuesday, October 4, 2011 8:01 AM
  • By putting the L in front of the string, you can also wrap it with TEXT() as in TEXT("Drivers\\BuiltIn\\SmartCard")
    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Tuesday, October 4, 2011 12:26 PM
    Moderator
  • But i am calling ActivateDeviceEx from .net code:

     

            [DllImport("Coredll.dll", EntryPoint = "ActivateDeviceEx", SetLastError = true, CharSet = CharSet.Unicode)]
            private static extern IntPtr ActivateDeviceEx(String lpszDevKey, IntPtr lpRegEnts, UInt32 cRegEnts, IntPtr lpvParam);
    

    Tuesday, October 4, 2011 12:39 PM
  • You stated "Hm, nothing special:", well that is very special.

    But let's ignore that for a while.

    Since the driver should be loading when the system boots (assuming that your registry settings are actually available when the device manager looks at it), maybe you should work on finding out why it isn't loading.    The first thing to verify is that your flash driver is loading and mounting the disk before device manager tries to load the driver from the disk.

    Next would be to review the debug output, and maybe add some debug output to the driver.

    The driver very well may not load becuase you are probably missing some functions in coredll and possibly other DLLs.


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Tuesday, October 4, 2011 3:17 PM
    Moderator
  • "The first thing to verify is that your flash driver is loading and mounting the disk before device manager tries to load the driver from the disk."

    I had already checked this, since a second driver loads from flash disk without problems.

    "The driver very well may not load becuase you are probably missing some functions in coredll and possibly other DLLs."

    So apart from scard.dll/winscard.dll also coredll must be adjusted for using with smartcard (i thinked scard.dll/winscard.dll are enough for handling smart card's) ?


    • Edited by judwei Wednesday, October 5, 2011 5:50 AM
    Wednesday, October 5, 2011 5:49 AM
  • Again Debug Output would help.
    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Wednesday, October 5, 2011 12:26 PM
    Moderator
  • The problem is, that i dont have a debug port and no bsp/driver sources (commercial product)
    Thursday, October 6, 2011 5:28 AM