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

static LONG SCardAddContext ( SCARDCONTEXT  hContext,
DWORD  dwClientID 
) [static]

Adds an Application Context to the vector psContextMap.

Functions for managing instances of SCardEstablishContext These functions keep track of Context handles and associate the blocking variable contextBlockStatus to an hContext

[in] hContext Application Context ID.
[in] dwClientID Client connection ID.
Error code.
Return values:
SCARD_E_NO_MEMORY There is no free slot to store hContext.

Definition at line 2786 of file winscard_clnt.c.

References _psContextMap::contextBlockStatus, _psContextMap::dwClientID, _psContextMap::hContext, _psContextMap::mMutex, psContextMap, SYS_MutexInit(), and _psContextMap::TID.

Referenced by SCardEstablishContextTH().

      int i;

      for (i = 0; i < PCSCLITE_MAX_APPLICATION_CONTEXTS; i++)
            if (psContextMap[i].hContext == 0)
                  psContextMap[i].hContext = hContext;
                  psContextMap[i].TID = SYS_ThreadSelf();
                  psContextMap[i].dwClientID = dwClientID;
                  psContextMap[i].contextBlockStatus = BLOCK_STATUS_RESUME;
                  psContextMap[i].mMutex = (PCSCLITE_MUTEX_T) malloc(sizeof(PCSCLITE_MUTEX));
                  return SCARD_S_SUCCESS;

      return SCARD_E_NO_MEMORY;

Generated by  Doxygen 1.6.0   Back to index