diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-12-30 13:41:38 -0800 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-12-30 13:41:38 -0800 |
commit | 9f8d3697472ce8dc6353172e9a471568d1aec45e (patch) | |
tree | 22bf5f7fb6bbb034761dcd55b264c7052333e80a /sesman/chansrv/pcsc/xrdp_pcsc.c | |
parent | 2aa92fd6a85a479343e6d2fb408bfc9a4e40fe18 (diff) | |
download | xrdp-proprietary-9f8d3697472ce8dc6353172e9a471568d1aec45e.tar.gz xrdp-proprietary-9f8d3697472ce8dc6353172e9a471568d1aec45e.zip |
chansrv: smartcard, fix for SCardControl, SCardTransmit
Diffstat (limited to 'sesman/chansrv/pcsc/xrdp_pcsc.c')
-rw-r--r-- | sesman/chansrv/pcsc/xrdp_pcsc.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/sesman/chansrv/pcsc/xrdp_pcsc.c b/sesman/chansrv/pcsc/xrdp_pcsc.c index 35c0b7b4..f4aaba14 100644 --- a/sesman/chansrv/pcsc/xrdp_pcsc.c +++ b/sesman/chansrv/pcsc/xrdp_pcsc.c @@ -461,9 +461,9 @@ SCardConnect(SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, int offset; LLOGLN(10, ("SCardConnect:")); - LLOGLN(10, ("SCardConnect: hContext %p szReader %s dwShareMode %d " + LLOGLN(10, ("SCardConnect: hContext 0x%8.8x szReader %s dwShareMode %d " "dwPreferredProtocols %d", - (void*)hContext, szReader, dwShareMode, dwPreferredProtocols)); + hContext, szReader, dwShareMode, dwPreferredProtocols)); if (g_sck == -1) { LLOGLN(0, ("SCardConnect: error, not connected")); @@ -505,8 +505,9 @@ SCardConnect(SCARDCONTEXT hContext, LPCSTR szReader, DWORD dwShareMode, *phCard = GET_UINT32(msg, 0); *pdwActiveProtocol = GET_UINT32(msg, 4); status = GET_UINT32(msg, 8); - LLOGLN(10, ("SCardConnect: got status 0x%8.8x hCard %d", - status, *phCard)); + LLOGLN(10, ("SCardConnect: got status 0x%8.8x hCard 0x%8.8x " + "dwActiveProtocol %d", + status, *phCard, *pdwActiveProtocol)); return status; } @@ -534,7 +535,7 @@ SCardDisconnect(SCARDHANDLE hCard, DWORD dwDisposition) int bytes; int status; - LLOGLN(10, ("SCardDisconnect: hCard %d dwDisposition %d", + LLOGLN(10, ("SCardDisconnect: hCard 0x%8.8x dwDisposition %d", hCard, dwDisposition)); if (g_sck == -1) { @@ -574,7 +575,7 @@ SCardBeginTransaction(SCARDHANDLE hCard) int bytes; int status; - LLOGLN(10, ("SCardBeginTransaction: hCard %d", hCard)); + LLOGLN(10, ("SCardBeginTransaction: hCard 0x%8.8x", hCard)); if (hCard == 0) { LLOGLN(0, ("SCardBeginTransaction: error, bad hCard")); @@ -967,6 +968,7 @@ SCardTransmit(SCARDHANDLE hCard, const SCARD_IO_REQUEST *pioSendPci, int offset; int status; int extra_len; + int got_recv_pci; LLOGLN(10, ("SCardTransmit:")); if (g_sck == -1) @@ -1002,8 +1004,10 @@ SCardTransmit(SCARDHANDLE hCard, const SCARD_IO_REQUEST *pioSendPci, offset += 4; memcpy(msg + offset, pbSendBuffer, cbSendLength); offset += cbSendLength; - if ((pioRecvPci == 0) || (pioRecvPci->cbPciLength < 8)) + // TODO figure out why recv pci does not work + if (1 || (pioRecvPci == 0) || (pioRecvPci->cbPciLength < 8)) { + got_recv_pci = 0; SET_UINT32(msg, offset, 0); /* dwProtocol */ offset += 4; SET_UINT32(msg, offset, 0); /* cbPciLength */ @@ -1013,6 +1017,7 @@ SCardTransmit(SCARDHANDLE hCard, const SCARD_IO_REQUEST *pioSendPci, } else { + got_recv_pci = 1; SET_UINT32(msg, offset, pioRecvPci->dwProtocol); offset += 4; SET_UINT32(msg, offset, pioRecvPci->cbPciLength); @@ -1046,7 +1051,7 @@ SCardTransmit(SCARDHANDLE hCard, const SCARD_IO_REQUEST *pioSendPci, return SCARD_F_INTERNAL_ERROR; } offset = 0; - if (pioRecvPci == 0) + if (got_recv_pci == 0) { offset += 8; extra_len = GET_UINT32(msg, offset); |