I am writing a C++ code using winscard. I noticed that, if I send a command with Scardtransmit where only data is sent or only data received, there is no problem. I can send data or get correct response. However, when the command both sends data and expects a response then I always get 61xx. I know the error code 61xx means there is an xx bytes response where Le is not correct, and checked every possible Le, including the returned value xx, but nothing changes. For example let the Apdu be in the form CLA INS P1 P2 Lc Data Le, and I get 61XX, then I send CLA INS P1 P2 Lc Data XX, again I get 61XX.
I checked the card using java and other tools and verified that there is nothing with the card.
As far as I understand, there is a single byte P3 allocated for Lc and Le. Is there a way to get responses (apart from the SW1SW2) from the DATADATA commands?