SCardGetProviderId

The SCardGetProviderId function returns the identifier (GUID) of the primary service provider for a given card.

The caller supplies the name of a smart card (previously introduced to the system) and receives the registered identifier of the primary service provider GUID, if one exists.

LONG SCardGetProviderId(
  IN SCARDCONTEXT hContext,
  IN LPCTSTR szCard,
  OUT LPGUID pguidProviderId
);
 

Parameters

hContext
Supplies the handle that identifies the resource manager context for the query. The resource manager context can be set by a previous call to SCardEstablishContext, or set to NULL if the query is not directed towards a specific context.
szCard
Supplies the name of the card defined to the system.
pguidInterfaces
Receives the identifier (GUID) of the primary service provider. This provider may be activated via COM, and will supply access to other services in the card.

Return Values

If the function… The return value is…
Succeeds SCARD_S_SUCCESS.
Fails An error code (see Error Codes for a list of all error codes).

Remarks

SCardGetProviderId is a database query function. For a description of other database query functions, see Smart Card Database Query Functions.

QuickInfo

  Windows NT: Use version 4.0 SP3 and later.
  Windows: Use Windows 95 OSR2.1.
  Windows CE: Unsupported.
  Header: Declared in winscard.h.
  Import Library: Link with winscard.lib.

See Also

SCardEstablishContext, SCardListCards, SCardListInterfaces, SCardListReaderGroups, SCardListReaders