Subsections

SCardEstablishContext

Synopsis:

#include <winscard.h>

LONG SCardEstablishContext(DWORD dwScope,
    LPCVOID pvReserved1,
    LPCVOID pvReserved2,
    LPSCARDCONTEXT phContext);

Parameters:

dwScope IN Scope of the establishment
    This can either be a local or remote connection
pvReserved1 IN Reserved for future use. Can be used for remote connection
pvReserved2 IN Reserved for future use
phContext OUT Returned reference to this connection

Description:

This function creates a communication context to the PC/SC Resource Manager. This must be the first function called in a PC/SC application.

Value of dwScope Meaning
SCARD_SCOPE_USER Not used
SCARD_SCOPE_TERMINAL Not used
SCARD_SCOPE_GLOBAL Not used
SCARD_SCOPE_SYSTEM Services on the local machine

Example:

SCARDCONTEXT hContext;
LONG rv;

rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);

Returns:

SCARD_S_SUCCESS Successful
SCARD_E_INVALID_VALUE Invalid scope type passed



2007-06-17