The SCardEstablishContext function establishes the resource manager context (the scope) within which database operations are performed.
LONG SCardEstablishContext(
IN DWORD dwScope,
IN LPCVOID pvReserved1,
IN LPCVOID pvReserved2,
OUT LPSCARDCONTEXT phContext
);
Value | Meaning |
---|---|
SCARD_SCOPE_USER | Database operations are performed within the domain of the user. |
SCARD_SCOPE_SYSTEM | Database operations are performed within the domain of the system. (The calling application must have appropriate access permissions for any database actions.) |
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). |
The context handle returned by SCardEstablishContext can be used by database query and management functions. For a description of these functions see, Smart Card Database Query Functions and Smart Card Database Management Functions.
To release an established resource manager context, see SCardReleaseContext.
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.