Skip to content

Latest commit

 

History

History
79 lines (51 loc) · 2.12 KB

File metadata and controls

79 lines (51 loc) · 2.12 KB

Home

Function name : SCardEstablishContext

Group: Authentication - Library: winscard


Note that this document contains some links to the old news2news website which does not work at the moment. This material will be available sometime in the future.

Establishes the resource manager context (the scope) within which database operations are performed.


Code examples:

Smart Card Database Query Functions

Declaration:

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

FoxPro declaration:

DECLARE LONG SCardEstablishContext IN Winscard;
	INTEGER dwScope,;
	INTEGER pvReserved1,;
	INTEGER pvReserved2,;
	INTEGER @phContext  

Parameters:

dwScope [in] Scope of the resource manager context.

pvReserved1 [in] Reserved for future use and must be NULL.

pvReserved2 [in] Reserved for future use and must be NULL.

phContext [out] A handle to the established resource manager context.


Return value:

If the function succeeds, the function returns SCARD_S_SUCCESS (0).


Comments:

Purchase complete VFP solution.
Download ACOS3 Class Library

Upon successful call the phContext handle can be supplied to other functions attempting to do work within this context.

The error code SCARD_E_NO_SERVICE (0x8010001D), "The smart card resource manager is not running", means that the SCardSvr service is not started. By default this service is stopped.

The error code SCARD_E_NO_READERS_AVAILABLE (0x8010002E) speaks for itself.

See also: SCardReleaseContext.