[Pcsclite-cvs-commit] r4739 - in /trunk/PCSC/src: eventhandler.c ifdwrapper.c readerfactory.c readerfactory.h winscard.c
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Tue Feb 9 14:47:22 UTC 2010
Author: rousseau
Date: Tue Feb 9 14:47:21 2010
New Revision: 4739
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4739
Log:
In struct ReaderContext rename dwSlot to slot and change type from
DWORD to int
Modified:
trunk/PCSC/src/eventhandler.c
trunk/PCSC/src/ifdwrapper.c
trunk/PCSC/src/readerfactory.c
trunk/PCSC/src/readerfactory.h
trunk/PCSC/src/winscard.c
Modified: trunk/PCSC/src/eventhandler.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/eventhandler.c?rev=4739&op=diff
==============================================================================
--- trunk/PCSC/src/eventhandler.c (original)
+++ trunk/PCSC/src/eventhandler.c Tue Feb 9 14:47:21 2010
@@ -503,7 +503,7 @@
{
int ret;
- ret = rContext->pthCardEvent(rContext->dwSlot);
+ ret = rContext->pthCardEvent(rContext->slot);
if (IFD_NO_SUCH_DEVICE == ret)
(void)SYS_USleep(PCSCLITE_STATUS_POLL_RATE);
}
Modified: trunk/PCSC/src/ifdwrapper.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/ifdwrapper.c?rev=4739&op=diff
==============================================================================
--- trunk/PCSC/src/ifdwrapper.c (original)
+++ trunk/PCSC/src/ifdwrapper.c Tue Feb 9 14:47:21 2010
@@ -72,31 +72,31 @@
* Error returned by CCID driver is: CCID_Receive Procedure byte conflict
*/
- ucValue[0] = rContext->dwSlot;
-
-#ifndef PCSCLITE_STATIC_DRIVER
- if (rContext->version == IFD_HVERSION_1_0)
- {
- ucValue[0] = rContext->dwSlot;
+ ucValue[0] = rContext->slot;
+
+#ifndef PCSCLITE_STATIC_DRIVER
+ if (rContext->version == IFD_HVERSION_1_0)
+ {
+ ucValue[0] = rContext->slot;
(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
rv = (*IFD_set_protocol_parameters) (dwProtocol,
ucFlags, ucPTS1, ucPTS2, ucPTS3);
}
else
{
- rv = (*IFDH_set_protocol_parameters) (rContext->dwSlot,
+ rv = (*IFDH_set_protocol_parameters) (rContext->slot,
dwProtocol, ucFlags, ucPTS1, ucPTS2, ucPTS3);
}
#else
#ifdef IFDHANDLERv1
{
- ucValue[0] = rContext->dwSlot;
+ ucValue[0] = rContext->slot;
(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
rv = IFD_Set_Protocol_Parameters(dwProtocol, ucFlags, ucPTS1,
ucPTS2, ucPTS3);
}
#else
- rv = IFDHSetProtocolParameters(rContext->dwSlot, dwProtocol, ucFlags,
+ rv = IFDHSetProtocolParameters(rContext->slot, dwProtocol, ucFlags,
ucPTS1, ucPTS2, ucPTS3);
#endif
#endif
@@ -141,27 +141,27 @@
rv = (*IO_create_channel) (rContext->port);
} else if (rContext->version == IFD_HVERSION_2_0)
{
- rv = (*IFDH_create_channel) (rContext->dwSlot, rContext->port);
+ rv = (*IFDH_create_channel) (rContext->slot, rContext->port);
} else
{
/* use device name only if defined */
if (rContext->lpcDevice[0] != '\0')
- rv = (*IFDH_create_channel_by_name) (rContext->dwSlot, rContext->lpcDevice);
+ rv = (*IFDH_create_channel_by_name) (rContext->slot, rContext->lpcDevice);
else
- rv = (*IFDH_create_channel) (rContext->dwSlot, rContext->port);
+ rv = (*IFDH_create_channel) (rContext->slot, rContext->port);
}
#else
#ifdef IFDHANDLERv1
rv = IO_Create_Channel(rContext->port);
#elif IFDHANDLERv2
- rv = IFDHCreateChannel(rContext->dwSlot, rContext->port);
+ rv = IFDHCreateChannel(rContext->slot, rContext->port);
#else
{
/* Use device name only if defined */
if (rContext->lpcDevice[0] != '\0')
- rv = IFDHCreateChannelByName(rContext->dwSlot, rContext->lpcDevice);
+ rv = IFDHCreateChannelByName(rContext->slot, rContext->lpcDevice);
else
- rv = IFDHCreateChannel(rContext->dwSlot, rContext->port);
+ rv = IFDHCreateChannel(rContext->slot, rContext->port);
}
#endif
#endif
@@ -210,12 +210,12 @@
rv = (*IO_close_channel) ();
else
- rv = (*IFDH_close_channel) (rContext->dwSlot);
+ rv = (*IFDH_close_channel) (rContext->slot);
#else
#ifdef IFDHANDLERv1
rv = IO_Close_Channel();
#else
- rv = IFDHCloseChannel(rContext->dwSlot);
+ rv = IFDHCloseChannel(rContext->slot);
#endif
#endif
@@ -252,13 +252,13 @@
if (rContext->version == IFD_HVERSION_1_0)
rv = (*IFD_set_capabilities) (dwTag, pucValue);
else
- rv = (*IFDH_set_capabilities) (rContext->dwSlot, dwTag,
+ rv = (*IFDH_set_capabilities) (rContext->slot, dwTag,
dwLength, pucValue);
#else
#ifdef IFDHANDLERv1
rv = IFD_Set_Capabilities(dwTag, pucValue);
#else
- rv = IFDHSetCapabilities(rContext->dwSlot, dwTag, dwLength, pucValue);
+ rv = IFDHSetCapabilities(rContext->slot, dwTag, dwLength, pucValue);
#endif
#endif
@@ -294,13 +294,13 @@
if (rContext->version == IFD_HVERSION_1_0)
rv = (*IFD_get_capabilities) (dwTag, pucValue);
else
- rv = (*IFDH_get_capabilities) (rContext->dwSlot, dwTag,
+ rv = (*IFDH_get_capabilities) (rContext->slot, dwTag,
pdwLength, pucValue);
#else
#ifdef IFDHANDLERv1
rv = IFD_Get_Capabilities(dwTag, pucValue);
#else
- rv = IFDHGetCapabilities(rContext->dwSlot, dwTag, pdwLength, pucValue);
+ rv = IFDHGetCapabilities(rContext->slot, dwTag, pdwLength, pucValue);
#endif
#endif
@@ -356,13 +356,13 @@
#ifndef PCSCLITE_STATIC_DRIVER
if (rContext->version == IFD_HVERSION_1_0)
{
- ucValue[0] = rContext->dwSlot;
+ ucValue[0] = rContext->slot;
(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
rv = (*IFD_power_icc) (dwAction);
}
else
{
- rv = (*IFDH_power_icc) (rContext->dwSlot, dwAction,
+ rv = (*IFDH_power_icc) (rContext->slot, dwAction,
pucAtr, pdwAtrLen);
ret = ATRDecodeAtr(&sSmartCard, pucAtr, *pdwAtrLen);
@@ -370,12 +370,12 @@
#else
#ifdef IFDHANDLERv1
{
- ucValue[0] = rContext->dwSlot;
+ ucValue[0] = rContext->slot;
(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
rv = IFD_Power_ICC(dwAction);
}
#else
- rv = IFDHPowerICC(rContext->dwSlot, dwAction, pucAtr, pdwAtrLen);
+ rv = IFDHPowerICC(rContext->slot, dwAction, pucAtr, pdwAtrLen);
#endif
#endif
@@ -440,21 +440,21 @@
#ifndef PCSCLITE_STATIC_DRIVER
if (rContext->version == IFD_HVERSION_1_0)
{
- ucValue[0] = rContext->dwSlot;
+ ucValue[0] = rContext->slot;
(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
rv = (*IFD_is_icc_present) ();
}
else
- rv = (*IFDH_icc_presence) (rContext->dwSlot);
-#else
-#ifdef IFDHANDLERv1
- {
- ucValue[0] = rContext->dwSlot;
+ rv = (*IFDH_icc_presence) (rContext->slot);
+#else
+#ifdef IFDHANDLERv1
+ {
+ ucValue[0] = rContext->slot;
(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
rv = IFD_Is_ICC_Present();
}
#else
- rv = IFDHICCPresence(rContext->dwSlot);
+ rv = IFDHICCPresence(rContext->slot);
#endif
#endif
@@ -497,7 +497,7 @@
/* LOCK THIS CODE REGION */
(void)SYS_MutexLock(rContext->mMutex);
- ucValue[0] = rContext->dwSlot;
+ ucValue[0] = rContext->slot;
(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
#ifndef PCSCLITE_STATIC_DRIVER
@@ -574,10 +574,10 @@
(void)SYS_MutexLock(rContext->mMutex);
#ifndef PCSCLITE_STATIC_DRIVER
- rv = (*IFDH_control_v2) (rContext->dwSlot, TxBuffer, TxLength,
+ rv = (*IFDH_control_v2) (rContext->slot, TxBuffer, TxLength,
RxBuffer, RxLength);
#elif IFDHANDLERv2
- rv = IFDHControl(rContext->dwSlot, TxBuffer, TxLength,
+ rv = IFDHControl(rContext->slot, TxBuffer, TxLength,
RxBuffer, RxLength);
#endif
@@ -625,10 +625,10 @@
(void)SYS_MutexLock(rContext->mMutex);
#ifndef PCSCLITE_STATIC_DRIVER
- rv = (*IFDH_control) (rContext->dwSlot, ControlCode, TxBuffer,
+ rv = (*IFDH_control) (rContext->slot, ControlCode, TxBuffer,
TxLength, RxBuffer, RxLength, BytesReturned);
#elif IFDHANDLERv3
- rv = IFDHControl(rContext->dwSlot, ControlCode, TxBuffer,
+ rv = IFDHControl(rContext->slot, ControlCode, TxBuffer,
TxLength, RxBuffer, RxLength, BytesReturned);
#endif
@@ -697,13 +697,13 @@
{
UCHAR ucValue[1];
- ucValue[0] = rContext->dwSlot;
+ ucValue[0] = rContext->slot;
(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
rv = (*IFD_transmit_to_icc) (pioTxPci, (LPBYTE) pucTxBuffer,
dwTxLength, pucRxBuffer, pdwRxLength, pioRxPci);
}
else
- rv = (*IFDH_transmit_to_icc) (rContext->dwSlot, pioTxPci,
+ rv = (*IFDH_transmit_to_icc) (rContext->slot, pioTxPci,
(LPBYTE) pucTxBuffer, dwTxLength,
pucRxBuffer, pdwRxLength, pioRxPci);
#else
@@ -711,13 +711,13 @@
{
UCHAR ucValue[1];
- ucValue[0] = rContext->dwSlot;
+ ucValue[0] = rContext->slot;
(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
rv = IFD_Transmit_to_ICC(pioTxPci, (LPBYTE) pucTxBuffer,
dwTxLength, pucRxBuffer, pdwRxLength, pioRxPci);
}
#else
- rv = IFDHTransmitToICC(rContext->dwSlot, pioTxPci,
+ rv = IFDHTransmitToICC(rContext->slot, pioTxPci,
(LPBYTE) pucTxBuffer, dwTxLength,
pucRxBuffer, pdwRxLength, pioRxPci);
#endif
Modified: trunk/PCSC/src/readerfactory.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/readerfactory.c?rev=4739&op=diff
==============================================================================
--- trunk/PCSC/src/readerfactory.c (original)
+++ trunk/PCSC/src/readerfactory.c Tue Feb 9 14:47:21 2010
@@ -352,8 +352,8 @@
(sReadersContexts[dwContext])->mMutex;
(sReadersContexts[dwContextB])->pdwMutex =
(sReadersContexts[dwContext])->pdwMutex;
- sReadersContexts[dwContextB]->dwSlot =
- sReadersContexts[dwContext]->dwSlot + j;
+ sReadersContexts[dwContextB]->slot =
+ sReadersContexts[dwContext]->slot + j;
/*
* Added by Dave - slots did not have a pdwFeeds
@@ -500,7 +500,7 @@
sContext->mMutex = NULL;
sContext->dwBlockStatus = 0;
sContext->contexts = 0;
- sContext->dwSlot = 0;
+ sContext->slot = 0;
sContext->hLockId = 0;
sContext->LockCount = 0;
sContext->vHandle = NULL;
@@ -531,7 +531,7 @@
}
LONG RFSetReaderName(READER_CONTEXT * rContext, LPSTR readerName,
- LPSTR libraryName, int port, DWORD dwSlot)
+ LPSTR libraryName, int port, DWORD slot)
{
LONG parent = -1; /* reader number of the parent of the clone */
DWORD valueLength;
@@ -544,7 +544,7 @@
for (i = 0; i < PCSCLITE_MAX_READERS_CONTEXTS; i++)
usedDigits[i] = FALSE;
- if ((0 == dwSlot) && (dwNumReadersContexts != 0))
+ if ((0 == slot) && (dwNumReadersContexts != 0))
{
for (i = 0; i < PCSCLITE_MAX_READERS_CONTEXTS; i++)
{
@@ -630,10 +630,10 @@
}
snprintf(rContext->lpcReader, sizeof(rContext->lpcReader), "%s %02X %02lX",
- readerName, i, dwSlot);
+ readerName, i, slot);
/* Set the slot in 0xDDDDCCCC */
- rContext->dwSlot = (i << 16) + dwSlot;
+ rContext->slot = (i << 16) + slot;
return parent;
}
Modified: trunk/PCSC/src/readerfactory.h
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/readerfactory.h?rev=4739&op=diff
==============================================================================
--- trunk/PCSC/src/readerfactory.h (original)
+++ trunk/PCSC/src/readerfactory.h Tue Feb 9 14:47:21 2010
@@ -123,7 +123,7 @@
LPVOID vHandle; /**< Dlopen handle */
int version; /**< IFD Handler version number */
int port; /**< Port ID */
- DWORD dwSlot; /**< Current Reader Slot */
+ int slot; /**< Current Reader Slot */
DWORD dwBlockStatus; /**< Current blocking status */
SCARDHANDLE hLockId; /**< Lock Id */
DWORD dwIdentity; /**< Shared ID High Nibble */
Modified: trunk/PCSC/src/winscard.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard.c?rev=4739&op=diff
==============================================================================
--- trunk/PCSC/src/winscard.c (original)
+++ trunk/PCSC/src/winscard.c Tue Feb 9 14:47:21 2010
@@ -939,7 +939,7 @@
*/
controlBuffer[0] = 0x20;
controlBuffer[1] = 0x15;
- controlBuffer[2] = (rContext->dwSlot & 0x0000FFFF) + 1;
+ controlBuffer[2] = (rContext->slot & 0x0000FFFF) + 1;
controlBuffer[3] = 0x00;
controlBuffer[4] = 0x00;
receiveLength = 2;
@@ -1155,7 +1155,7 @@
*/
controlBuffer[0] = 0x20;
controlBuffer[1] = 0x15;
- controlBuffer[2] = (rContext->dwSlot & 0x0000FFFF) + 1;
+ controlBuffer[2] = (rContext->slot & 0x0000FFFF) + 1;
controlBuffer[3] = 0x00;
controlBuffer[4] = 0x00;
receiveLength = 2;
More information about the Pcsclite-cvs-commit
mailing list