View | Details | Raw Unified | Return to bug 5846
Collapse All | Expand All

(-)client/pcsctun/src/hooks.c (-11 / +10 lines)
Lines 78-86 struct card Link Here
78
static GSList *ctxlist = NULL;
78
static GSList *ctxlist = NULL;
79
79
80
/* Protocol constants */
80
/* Protocol constants */
81
82
/* In pcsc-lite 1.7.3, g_rgSCard* was made constant.
83
   FEATURE_EXECUTE_PACE was defined in 1.8.0; close enough. */
84
#ifdef FEATURE_EXECUTE_PACE
85
const SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, sizeof(SCARD_IO_REQUEST) };
86
const SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, sizeof(SCARD_IO_REQUEST) };
87
const SCARD_IO_REQUEST g_rgSCardRawPci = { SCARD_PROTOCOL_RAW, sizeof(SCARD_IO_REQUEST) };
88
#else
81
SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, sizeof(SCARD_IO_REQUEST) };
89
SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, sizeof(SCARD_IO_REQUEST) };
82
SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, sizeof(SCARD_IO_REQUEST) };
90
SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, sizeof(SCARD_IO_REQUEST) };
83
SCARD_IO_REQUEST g_rgSCardRawPci = { SCARD_PROTOCOL_RAW, sizeof(SCARD_IO_REQUEST) };
91
SCARD_IO_REQUEST g_rgSCardRawPci = { SCARD_PROTOCOL_RAW, sizeof(SCARD_IO_REQUEST) };
92
#endif
84
93
85
static LONG SCardAllocMemory(SCARDCONTEXT hContext, void **ppvMem, DWORD cbLength);
94
static LONG SCardAllocMemory(SCARDCONTEXT hContext, void **ppvMem, DWORD cbLength);
86
95
Lines 736-742 SCardStatus(SCARDHANDLE hCard, LPTSTR mszReaderName, Link Here
736
745
737
LONG
746
LONG
738
SCardGetStatusChange(SCARDCONTEXT hContext, DWORD dwTimeout,
747
SCardGetStatusChange(SCARDCONTEXT hContext, DWORD dwTimeout,
739
		     LPSCARD_READERSTATE_A rgReaderStates, DWORD cReaders)
748
		     SCARD_READERSTATE *rgReaderStates, DWORD cReaders)
740
{
749
{
741
	struct session *s;
750
	struct session *s;
742
	int ret, i, size;
751
	int ret, i, size;
Lines 1418-1430 SCardSetAttrib(SCARDHANDLE hCard, DWORD dwAttrId, LPCBYTE pbAttr, DWORD cbAttrLe Link Here
1418
	return translate_errno(ret);
1427
	return translate_errno(ret);
1419
}
1428
}
1420
1429
1421
#ifdef __APPLE__
1422
char *
1423
pcsc_stringify_error(int32_t code)
1424
#else
1425
char *
1426
pcsc_stringify_error(long code)
1427
#endif
1428
{
1429
	return "(UNKNOWN ERROR)";
1430
}
(-)client/pcsctun/src/main.c (-4 / +4 lines)
Lines 143-149 struct async_params Link Here
143
	/* For SCardGetStatusChange */
143
	/* For SCardGetStatusChange */
144
	DWORD timeout;
144
	DWORD timeout;
145
	DWORD readers;
145
	DWORD readers;
146
	LPSCARD_READERSTATE_A states;
146
	SCARD_READERSTATE *states;
147
147
148
	/* For SCardDisconnect and SCardBeginTransaction */
148
	/* For SCardDisconnect and SCardBeginTransaction */
149
	struct card *card;
149
	struct card *card;
Lines 1051-1057 cb_SCardGetStatusChange(struct client *c, struct packet *p) Link Here
1051
	int ret, i, size;
1051
	int ret, i, size;
1052
	uint32_t timeout, readers, state, event;
1052
	uint32_t timeout, readers, state, event;
1053
	struct async_params *params;
1053
	struct async_params *params;
1054
	LPSCARD_READERSTATE_A states;
1054
	SCARD_READERSTATE *states;
1055
1055
1056
	ret = demarshall(p, "UU", &timeout, &readers);
1056
	ret = demarshall(p, "UU", &timeout, &readers);
1057
	if (ret)
1057
	if (ret)
Lines 1063-1075 cb_SCardGetStatusChange(struct client *c, struct packet *p) Link Here
1063
1063
1064
	memset(params, 0, sizeof(struct async_params));
1064
	memset(params, 0, sizeof(struct async_params));
1065
1065
1066
	states = malloc(sizeof(SCARD_READERSTATE_A) * readers);
1066
	states = malloc(sizeof(SCARD_READERSTATE) * readers);
1067
	if (!states) {
1067
	if (!states) {
1068
		free(params);
1068
		free(params);
1069
		return -ENOMEM;
1069
		return -ENOMEM;
1070
	}
1070
	}
1071
1071
1072
	memset(states, 0, sizeof(SCARD_READERSTATE_A) * readers);
1072
	memset(states, 0, sizeof(SCARD_READERSTATE) * readers);
1073
1073
1074
	params->readers = readers;
1074
	params->readers = readers;
1075
	params->states = states;
1075
	params->states = states;

Return to bug 5846