Stream_Read_UINT32(s, call->fpbRecvBufferIsNULL); /* fpbRecvBufferIsNULL (4 bytes) */
Stream_Read_UINT32(s, call->cbRecvLength); /* cbRecvLength (4 bytes) */
+ printf("Transmit_Call: ioSendPci.dwProtocol: %d ioSendPci.cbExtraBytes: %d pbExtraBytesPtr: %d cbSendLength: %d pbSendBufferNdrPtr: %d pioRecvPciNdrPtr: %d fpbRecvBufferIsNULL: %d cbRecvLength: %d\n",
+ ioSendPci.dwProtocol, ioSendPci.cbExtraBytes, pbExtraBytesNdrPtr, call->cbSendLength, pbSendBufferNdrPtr, pioRecvPciNdrPtr, call->fpbRecvBufferIsNULL, call->cbRecvLength);
+
status = smartcard_unpack_redir_scard_handle_ref(smartcard, s, &(call->hCard));
if (status)
}
else
{
- call->pioSendPci = (LPSCARD_IO_REQUEST) malloc(sizeof(SCARD_IO_REQUEST));
+ call->pioSendPci = (LPSCARD_IO_REQUEST) calloc(1, sizeof(SCARD_IO_REQUEST));
if (!call->pioSendPci)
{
if (pioRecvPciNdrPtr)
{
- if (Stream_GetRemainingLength(s) < 16)
+ if (Stream_GetRemainingLength(s) < 8)
{
WLog_Print(smartcard->log, WLOG_WARN, "Transmit_Call is too short: Actual: %d, Expected: %d",
(int) Stream_GetRemainingLength(s), 16);
Stream_Read_UINT32(s, length); /* Length (4 bytes) */
- Stream_Read_UINT32(s, ioRecvPci.dwProtocol); /* dwProtocol (4 bytes) */
- Stream_Read_UINT32(s, ioRecvPci.cbExtraBytes); /* cbExtraBytes (4 bytes) */
- Stream_Read_UINT32(s, pbExtraBytesNdrPtr); /* pbExtraBytesNdrPtr (4 bytes) */
+ Stream_Read_UINT16(s, ioRecvPci.dwProtocol); /* dwProtocol (2 bytes) */
+ Stream_Read_UINT16(s, ioRecvPci.cbExtraBytes); /* cbExtraBytes (2 bytes) */
if (length < ioRecvPci.cbExtraBytes)
{
Stream_Write_UINT32(s, 0); /* pioRecvPciNdrPtr (4 bytes) */
+ printf("Transmit_Return: pioRecvPci: %p pbRecvBuffer: %p cbRecvLength: %d\n",
+ ret->pioRecvPci, ret->pbRecvBuffer, ret->cbRecvLength);
+
if (ret->pbRecvBuffer)
{
Stream_Write_UINT32(s, ret->cbRecvLength); /* cbRecvLength (4 bytes) */