Translate the response to control code 3400 as it contains embedded control

codes in the local encoding.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1598 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Pierre Ossman 2010-06-22 13:06:16 +00:00
parent 91af7ba5fc
commit b82d367a4b

19
scard.c
View File

@ -24,6 +24,7 @@
#include <strings.h>
#include <sys/types.h>
#include <time.h>
#include <arpa/inet.h>
#ifndef MAKE_PROTO
#ifdef __APPLE__
#include <PCSC/wintypes.h>
@ -2090,6 +2091,24 @@ TS_SCardControl(STREAM in, STREAM out)
DEBUG_SCARD(("SCARD: -> Success (out: %d bytes)\n", (int) nBytesReturned));
}
#ifdef PCSCLITE_VERSION_NUMBER
if (dwControlCode == SCARD_CTL_CODE(3400))
{
int i;
SERVER_DWORD cc;
for (i = 0; i < nBytesReturned / 6; i++)
{
memcpy(&cc, pOutBuffer + 2 + i * 6, 4);
cc = ntohl(cc);
cc = cc - 0x42000000;
cc = (49 << 16) | (cc << 2);
cc = htonl(cc);
memcpy(pOutBuffer + 2 + i * 6, &cc, 4);
}
}
#endif
out_uint32_le(out, nBytesReturned);
out_uint32_le(out, 0x00000004);
out_uint32_le(out, nBytesReturned);