Logo Search packages:      
Sourcecode: pcsc-lite version File versions  Download package

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

Creates an Application Context for a client.

This must be the first function called in a PC/SC application.

Parameters:
[in] dwScope Scope of the establishment. This can either be a local or remote connection.
  • SCARD_SCOPE_USER - Not used.
  • SCARD_SCOPE_TERMINAL - Not used.
  • SCARD_SCOPE_GLOBAL - Not used.
  • SCARD_SCOPE_SYSTEM - Services on the local machine.
[in] pvReserved1 Reserved for future use. Can be used for remote connection.
[in] pvReserved2 Reserved for future use.
[out] phContext Returned Application Context.
Returns:
Connection status.
Return values:
SCARD_S_SUCCESS Successful.
SCARD_E_INVALID_VALUE Invalid scope type passed.
SCARD_E_INVALID_PARAMETER phContext is null.
Creates an Application Context for a client.

This must be the first function called in a PC/SC application. This is a thread-safe wrapper to the function SCardEstablishContextTH().

Parameters:
[in] dwScope Scope of the establishment. This can either be a local or remote connection.
  • SCARD_SCOPE_USER - Not used.
  • SCARD_SCOPE_TERMINAL - Not used.
  • SCARD_SCOPE_GLOBAL - Not used.
  • SCARD_SCOPE_SYSTEM - Services on the local machine.
[in] pvReserved1 Reserved for future use. Can be used for remote connection.
[in] pvReserved2 Reserved for future use.
[out] phContext Returned Application Context.
Returns:
Connection status.
Return values:
SCARD_S_SUCCESS Successful.
SCARD_E_NO_SERVICE The server is not runing
SCARD_E_INVALID_VALUE Invalid scope type passed.
SCARD_E_INVALID_PARAMETER phContext is null.
Test:
 SCARDCONTEXT hContext;
 LONG rv;
 ...
 rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);

Definition at line 160 of file winscard_scf.c.

References SCardEstablishContextTH(), SCardLockThread(), and SCardUnlockThread().

Referenced by MSGFunctionDemarshall().

{
      long rv;

      SCardLockThread();
      rv = SCardEstablishContextTH(dwScope, pvReserved1,
            pvReserved2, phContext);
      SCardUnlockThread();

      return rv;
}


Generated by  Doxygen 1.6.0   Back to index