Export (0) Print
Expand All
Expand Minimize

SCardSetCardTypeProviderName function

The SCardSetCardTypeProviderName function specifies the name of the module (dynamic link library) containing the provider for a given card name and provider type.

Syntax


LONG WINAPI SCardSetCardTypeProviderName(
  _In_  SCARDCONTEXT hContext,
  _In_  LPCTSTR szCardName,
  _In_  DWORD dwProviderId,
  _In_  LPCTSTR szProvider
);

Parameters

hContext [in]

Handle that identifies the resource manager context. The resource manager context can be set by a previous call to SCardEstablishContext. This value can be NULL if the call to SCardSetCardTypeProviderName is not directed to a specific context.

szCardName [in]

Name of the card type with which this provider name is associated.

dwProviderId [in]

Identifier for the provider associated with this card type.

ValueMeaning
SCARD_PROVIDER_PRIMARY
1

The function retrieves the name of the smart card's primary service provider as a GUID string.

SCARD_PROVIDER_CSP
2

The function retrieves the name of the cryptographic service provider (CSP).

SCARD_PROVIDER_KSP
3

The function retrieves the name of the smart card key storage provider (KSP).

SCARD_PROVIDER_CARD_MODULE
0x80000001

The function retrieves the name of the card module.

 

szProvider [in]

A string that contains the provider name that is representing the CSP.

Return value

This function returns different values depending on whether it succeeds or fails.

Return codeDescription
Success

SCARD_S_SUCCESS.

Failure

An error code. For more information, see Smart Card Return Values.

 

Remarks

This function is not redirected, but calling the function when inside a Remote Desktop session will not result in an error. It only means that the result will be from the remote computer instead of the local computer.

This function sets the provider name, while SCardGetCardTypeProviderName can be used to retrieve the provider name.

Examples

The following example shows how to specify the card type provider name.


LPTSTR            szNewProvName = _T("My Provider Name");
LPTSTR            szCardName = _T("WindowsCard");
LONG              lReturn = SCARD_S_SUCCESS;

// Set the card type provider name.
// hContext was set by SCardEstablishContext.
lReturn = SCardSetCardTypeProviderName(hContext,
                                      szCardName,
                                      SCARD_PROVIDER_CSP,
                                      szNewProvName);
if ( SCARD_S_SUCCESS != lReturn )
{
    printf("Failed SCardSetCardTypeProviderName - %x\n", lReturn);
    exit(1);
}


Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Winscard.h

Library

Winscard.lib

DLL

Winscard.dll

Unicode and ANSI names

SCardSetCardTypeProviderNameW (Unicode) and SCardSetCardTypeProviderNameA (ANSI)

See also

SCardGetCardTypeProviderName

 

 

Community Additions

ADD
Show:
© 2014 Microsoft