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 establishes the resource manager context (the scope) within which database operations are performed.

Syntax

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

Parameters

dwScope

[in] Specifies the scope of the resource manager context. The following table shows the possible values for dwScope.

Value Description

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.

SCARD_SCOPE_USER

Unsupported. If specified, Windows Embedded CE assumes the SCARD_SCOPE_SYSTEM value.

pvReserved1

[in] Void pointer reserved for future use; must be NULL. Reserved to enable a suitably privileged management application to act on behalf of another user.

pvReserved2

[in] Void pointer reserved for future use; must be NULL. Reserved to enable a suitably privileged management application to act on behalf of another terminal.

phContext

[out] Pointer to a handle to the established resource manager context. This handle can now be supplied to other functions attempting to do work within this context.

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

The context handle returned by SCardEstablishContextcan be used by database query and management functions.

To free an established resource manager context, see SCardReleaseContext.

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