summaryrefslogtreecommitdiffstats
path: root/sesman/chansrv/pcsc
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2013-12-11 03:47:52 -0800
committerJay Sorg <jay.sorg@gmail.com>2013-12-11 03:47:52 -0800
commite118463ebcc9fa71d0e5762b428e2f3a789a5b2b (patch)
tree2ee1f3622a7f6bfd4ed5d0c2ca2d20462b64d202 /sesman/chansrv/pcsc
parent306992250092b65dfcfa4964e0e75abc41967f1b (diff)
downloadxrdp-proprietary-e118463ebcc9fa71d0e5762b428e2f3a789a5b2b.tar.gz
xrdp-proprietary-e118463ebcc9fa71d0e5762b428e2f3a789a5b2b.zip
chansrv: winscard.dll wrapper, fix missing GetProcAddress and added some more logging
Diffstat (limited to 'sesman/chansrv/pcsc')
-rwxr-xr-xsesman/chansrv/pcsc/wrapper/winscard.c55
1 files changed, 45 insertions, 10 deletions
diff --git a/sesman/chansrv/pcsc/wrapper/winscard.c b/sesman/chansrv/pcsc/wrapper/winscard.c
index 09c8dfb8..34157f7c 100755
--- a/sesman/chansrv/pcsc/wrapper/winscard.c
+++ b/sesman/chansrv/pcsc/wrapper/winscard.c
@@ -69,7 +69,7 @@ static tSCardSetAttrib aSCardSetAttrib;
static int g_true = 1;
-#define LLOGLN(_level, _args) do { if ((_level < 1) && g_true) { writeln _args ; } } while (0)
+#define LLOGLN(_level, _args) do { if ((_level < 11) && g_true) { writeln _args ; } } while (0)
/*****************************************************************************/
static int
@@ -159,6 +159,7 @@ load_funsc(void)
LLOAD(aSCardStatusA, tSCardStatusA, "SCardStatusA");
LLOAD(aSCardStatusW, tSCardStatusW, "SCardStatusW");
LLOAD(aSCardTransmit, tSCardTransmit, "SCardTransmit");
+ LLOAD(aSCardControl, tSCardControl, "SCardControl");
LLOAD(aSCardGetAttrib, tSCardGetAttrib, "SCardGetAttrib");
LLOAD(aSCardSetAttrib, tSCardSetAttrib, "SCardSetAttrib");
@@ -674,9 +675,15 @@ SCardStatusW(SCARDHANDLE hCard, LPWSTR szReaderName, LPDWORD pcchReaderLen,
LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr,
LPDWORD pcbAtrLen)
{
+ LONG rv;
+
LLOGLN(0, ("SCardStatusW:"));
- return aSCardStatusW(hCard, szReaderName, pcchReaderLen,
- pdwState, pdwProtocol, pbAtr, pcbAtrLen);
+ LLOGLN(0, (" cchReaderLen %d", *pcchReaderLen));
+ LLOGLN(0, (" cbAtrLen %d", *pcbAtrLen));
+ rv = aSCardStatusW(hCard, szReaderName, pcchReaderLen,
+ pdwState, pdwProtocol, pbAtr, pcbAtrLen);
+ LLOGLN(0, (" rv %d cchReaderLen %d", rv, *pcchReaderLen));
+ return rv;
}
/*****************************************************************************/
@@ -686,9 +693,24 @@ SCardTransmit(SCARDHANDLE hCard, LPCSCARD_IO_REQUEST pioSendPci,
LPSCARD_IO_REQUEST pioRecvPci, LPBYTE pbRecvBuffer,
LPDWORD pcbRecvLength)
{
- LLOGLN(0, ("SCardTransmit:"));
- return aSCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength,
- pioRecvPci, pbRecvBuffer, pcbRecvLength);
+ LONG rv;
+
+ LLOGLN(10, ("SCardTransmit:"));
+ LLOGLN(10, (" hCard %p", hCard));
+ LLOGLN(10, (" cbSendLength %d", cbSendLength));
+ LLOGLN(10, (" cbRecvLength %d", *pcbRecvLength));
+ LLOGLN(10, (" pioSendPci->dwProtocol %d", pioSendPci->dwProtocol));
+ LLOGLN(10, (" pioSendPci->cbPciLength %d", pioSendPci->cbPciLength));
+ LLOGLN(10, (" pioRecvPci %p", pioRecvPci));
+ if (pioRecvPci != NULL)
+ {
+ LLOGLN(10, (" pioRecvPci->dwProtocol %d", pioRecvPci->dwProtocol));
+ LLOGLN(10, (" pioRecvPci->cbPciLength %d", pioRecvPci->cbPciLength));
+ }
+ rv = aSCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength,
+ pioRecvPci, pbRecvBuffer, pcbRecvLength);
+ LLOGLN(10, (" rv %d cbRecvLength %d", rv, *pcbRecvLength));
+ return rv;
}
/*****************************************************************************/
@@ -697,10 +719,23 @@ SCardControl(SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID lpInBuffer,
DWORD nInBufferSize, LPVOID lpOutBuffer,
DWORD nOutBufferSize, LPDWORD lpBytesReturned)
{
- LLOGLN(0, ("SCardControl:"));
- return aSCardControl(hCard, dwControlCode, lpInBuffer,
- nInBufferSize, lpOutBuffer, nOutBufferSize,
- lpBytesReturned);
+ LONG rv;
+ char text[8148];
+
+ LLOGLN(10, ("SCardControl:"));
+ LLOGLN(10, (" hCard %p", hCard));
+ LLOGLN(10, (" dwControlCode 0x%8.8x", dwControlCode));
+ LLOGLN(10, (" lpInBuffer %p", lpInBuffer));
+ LLOGLN(10, (" nInBufferSize %d", nInBufferSize));
+ LLOGLN(10, (" lpOutBuffer %p", lpOutBuffer));
+ LLOGLN(10, (" nOutBufferSize %d", nOutBufferSize));
+ LLOGLN(10, (" lpBytesReturned %p", lpBytesReturned));
+ rv = aSCardControl(hCard, dwControlCode,
+ lpInBuffer, nInBufferSize,
+ lpOutBuffer, nOutBufferSize,
+ lpBytesReturned);
+ LLOGLN(10, (" rv %d BytesReturned %d", rv, *lpBytesReturned));
+ return rv;
}
/*****************************************************************************/