ACM1252U-Y3
– Reference Manual
Version 1.03
www.acs.com.hk
Page 9 of 92
www.acs.com
.hk
#define
SCARD_SCOPE_USER 0
SCARDCONTEXT hContext;
int
retCode;
void main ()
{
// To establish the resource manager context and assign it to “hContext”
retCode = SCardEstablishContext(SCARD_SCOPE_USER,
NULL,
NULL,
&hContext);
if
(retCode != SCARD_S_SUCCESS)
{
// Establishing resource manager context failed
}
else
{
// Establishing resource manager context successful
// Further PCSC operation can be performed
}
}
5.0. Host Programming (PC-linked) API
5.1. PCSC API
This section will describe some of the PCSC API for application programming usage. For more
details, please refer to Microsoft MSDN Library or PCSC workgroup.
5.1.1.
SCardEstablishContext
The SCardEstablishContext function establishes the resource manager context within which database
operations are performed.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa379479%28v=vs.85%29.aspx
This function should be performed first before any other PCSC operation.
Example: