d-sky

Hi,

I have a working PC/SC Application for XP but doesnt work for Vista.

  • I plugged in the reader.
  • I called the API SCardListReaders() but returns an empty reader list.

I am not sure if..

  • there is a link failure between the Driver and the Smart Card Resource Manager

or

  • The PC/SC Application needs to be recompiled for Vista.

In the end, is there a new Smart Card Library for Vista



Re: Application Compatibility for Windows Vista Smart Card Application

Bruce N. Baker - MSFT

It looks like this is also in Vista so I suspect it's a driver issue.




Re: Application Compatibility for Windows Vista Smart Card Application

d-sky

Initially, I suspected it might be the driver too.
I managed to install the driver and could see the smart card reader listed on the Device Manager (PnP Manager). But when I ran the PC/SC app, SCardListsReaders() was empty with the return error code as 0x8010002E (No smart card readers are currently available). I suspected my driver could have failed linking to the Smart Card Resource Manager. (smclib.sys)

Then, I plugged in a TDK-based reader with CCID support. The OS detected the reader as a CCID reader and installed the system supplied CCID driver. This CCID Driver (usbccid.sys) is provided by Microsoft. When I ran the PC/SC application, I had the same error too - 0x8010200E.

I've checked on the Vista system, the Smart Card Service is started.
So..
1. Besides the Smart Card Service, are there any additional service we need to run
2. Do we need to recompile the PC/SC application for Vista - any new library / API function calls




Re: Application Compatibility for Windows Vista Smart Card Application

Bruce N. Baker - MSFT

Can you show me a code fragment of the actual call you are making Are the card readers installed Are you calling it with Null context What's your elevation level




Re: Application Compatibility for Windows Vista Smart Card Application

wmun

Hi Bruce,I am D-Sky's colleague. Here's the code fragment for SCardListReaders().

SCARDCONTEXT hContext;
CHAR mchReaders[1024];
DWORD cchReaders = 1024;

// Establish context to the Resource Manager

status = SCardEstablishContext(
SCARD_SCOPE_USER,
NULL,
NULL,
&hContext);

if(status != SCARD_S_SUCCESS) {
ShowError(status);
return -1;
}

// List available readers
status = SCardListReaders(
hContext,
NULL,
mchReaders,
&cchReaders);

if(status != SCARD_S_SUCCESS) {
ShowError(status); // It failed here with Error 0x8010002E
return -1;
}




Re: Application Compatibility for Windows Vista Smart Card Application

Taquilla

hi
I have the same problem but the error it's situated to the SCardEtablishContext(..,..,..,..)
The funtion returns 6 .
I cant etablish the communication with my reader (SC-Master Phoenix).


SCARDCONTEXT hContext=NULL;
DWORD dwReaders;
SCARDHANDLE hCardHandle=NULL;
LPCTSTR lpmszReaderGroups= NULL;
DWORD dwReaderLen=0;
DWORD dwState;
DWORD dwProtocol;

//Etablissement du context
lReturn=SCardEstablishContext(SCARD_SCOPE_SYSTEM,NULL,NULL,&hContext);
cout<<" lReturn "<<lReturn<<endl;
if(lReturn!=SCARD_S_SUCCESS)
cout<<"Impossible d'avoir les ressource !!!"<<endl;




Re: Application Compatibility for Windows Vista Smart Card Application

Bruce N. Baker - MSFT

Let's recap:

1. SCardListReaders is supported on Vista

2. No readers are found

3. Your's isn't the only program that's failing, since by statement above the SC program that came with the programmer failed.

Then we have to ask the following:

Is this device truely a USB CCID-compliant Device

Does it need an hardware update

Is it definately correctly installed (physically )

Also, I'm still curious if running as a admin would make a difference or no.

for reference:
http://msdn2.microsoft.com/en-us/library/aa379793.aspx

If you continue to have issues then we can create a case for you if you are a partner.






Re: Application Compatibility for Windows Vista Smart Card Application

Bruce N. Baker - MSFT

Also, make sure your smart card service is running on Vista






Re: Application Compatibility for Windows Vista Smart Card Application

FroggyCdc

I have the same problem with some readers SMC (Contact and contactless), Xiring XiPass, VASCO DP850 and Oberthur OCR 150. The smart card service is correctly started and there is no error event reportes. Perhaps the problem is due to Unicode/Non unicode dll version or program. Any other idea

Perhaps have you solved the problem.





Re: Application Compatibility for Windows Vista Smart Card Application

myrzilka75

SCardEstablishContext returns error 6 - the reason can be in Smart Card Service. By default it runs manually. You should run it.

SCardListReaders doesn't return the list of readers because smart card reader driver was not installed correctly. Driver has to add some info into registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Calais\Readers. Just from this place Resource Manager takes the list of readers. This works for WinXP, but I suppose the same for WinVista.





Re: Application Compatibility for Windows Vista Smart Card Application

FroggyCdc

Yes, the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Calais\Readers is empty. That is not normal because the Gemplus PinPad USB I use has been installed with windows update. The driver is VISTA compatible and is visible in the Device management window. When I disconnect the reader, the line disapears in the devices list. When I click on the properties button, Windows answers that the driver is working correctly.

I am surprised especially because this happens with 3 or 4 different readers from different constructors.

For my case, the SCardEstablishContext function returns 0, the SCardListReaderGroups returns 0 with an empty string and SCardListReaders returns 0x8010002e.

When I try to debug the program with Visual Studio2008, when the SCardEstablishContext is called the following message is displayed on stdout :

First-chance exception at 0x76b6b09e in ListReaders.exe: 0x000006BA: Le serveur RPC n'est pas disponible.

meaning that the RPC server is not available. Yet the RPC service is running !

and when the SCardListReaders function is called :

First-chance exception at 0x76b6b09e in ListReaders.exe: Microsoft C++ exception: unsigned long at memory location 0x0025fa38..

First-chance exception at 0x76b6b09e in ListReaders.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..

I have the same result on VISTA Premium and on VISTA enterprise.

Perhaps I must wait the SPn+1




Re: Application Compatibility for Windows Vista Smart Card Application

myrzilka75

Friends, I found out that HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Calais\Readers can be empty after driver instalation. You can add info to this registry key by SCardIntroduceReader function. But it does not help. SCardListReaders started to work only when I had changed key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Calais\Current = 1 manually. I could give the list of introduced readers, but I cannot use the reader.

I develop a USB PCSC driver and still cannot understand how to install it in the system correctly and how to connect it with Smart Card Resource Manager. Could somebody help me





Re: Application Compatibility for Windows Vista Smart Card Application

FroggyCdc

You have some information in the following document : http://download.microsoft.com/download/f/4/f/f4f3c957-057c-4acb-b10c-bb6087045025/WSCFDepl.doc

Normaly the driver installation creates the registry key and without additional operation, the smartCard reader must be operational. That is true on Windows NT, 2000 and XP. It seams be false on VISTA.





Re: Application Compatibility for Windows Vista Smart Card Application

myrzilka75

I found the reason of the problem. I used bulltlp3 sample from DDK. This sample contains the next code in the AddDevice function:

SmartcardExtension->ReaderCapabilities.CurrentState = SCARD_UNKNOWN;

Because my reader is USB reader I removed all serial port functionality where this sate is installed to SCARD_ABSENT or SCARD_PRESENT. It was the reason why reader driver was registred in registry, but was inactive. As I see Smart Card Resource Manager checks this state and it has to be at least SCARD_ABSENT.





Re: Application Compatibility for Windows Vista Smart Card Application

FroggyCdc

The truth comes from Belgique : I have found on a forum which give the solution :
The problem is in the registry permission for LOCAL_SERVICE :

I've had the same problem before after an upgrade from Windows 2000 to Windows xp.

To solve it, I had to correct the permissions on the registry key HKLM\SOFTWARE\Microsoft\Cryptography\Calais.

1. Right-click on the key HKLM\SOFTWARE\Microsoft\Cryptography\Calais and select Permissions...
2. Click Add.
3. Click Advanced.
4. Click Locations.
5. Click on the computername and click OK.
6. In the window 'Select user or groups', click on Find now.
7. Select LOCAL SERVICE.
8. Click OK.
9. In the window 'Select user or groups', click on OK.
10. In the window 'Permissions for Calais', click on LOCAL SERVICE and make sure 'Full control' , 'Read' and 'special permissions' is allowed.
11. In the window 'Advance Security Settings for Calais", deactivate the options 'Inherit from parent the permission entries that apply to child objects...'
12. When the window 'Security' appears, click Copy.
13. In the window 'Advance Security Settings for Calais", activate the option 'Replace permission entries on all child objects with entries shown here that apply to child objects' and click OK.
14. In the window 'Security' click Yes
15. In the window 'Permissions for Calais', click OK.

I don't now why the registry permissions have been reseted. But it seams to be a solution of the problem. I hope that Microsoft can give us a patch and an explanation of this fact !