SCardEstablishContext (Compact 7)

3/12/2014

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 Compact assumes the SCARD_SCOPE_SYSTEM value.

  • pvReserved1
    [in] Reserved; set to NULL. Reserved to enable a suitably privileged management application to act on behalf of another user.
  • pvReserved2
    [in] Reserved; set to 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 Values for a list of all error values).

Fails

Remarks

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

To free an established resource manager context, see SCardReleaseContext.

Requirements

Header

winscard.h

Library

winscard.lib

See Also

Reference

Smart Card Functions
SCardReleaseContext