Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function returns the globally unique identifier (GUID) of the primary service provider for a specified 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.

Syntax

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

Parameters

hContext

[in] Handle that identifies the resource manager context for the query. The resource manager context can be set by a previous call to SCardEstablishContextor set to NULL if the query is not directed toward a specific context.

szCard

[in] Null-terminated string that contains the name of the card defined to the system.

pguidProviderId

[out] Pointer to a globally unique identifier (GUID) of the primary service provider. This provider can be activated by means of COM and supplies access to other services in the card.

Return Value

The following table shows the possible return values.

Value Description

SCARD_S_SUCCESS

Succeeds

An error value (see Smart Card Error Valuesfor a list of all error values).

Fails

Remarks

SCardGetProviderIdis a database query function.

Requirements

Header winscard.h
Library winscard.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also