OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: SCARD_E_COMM_DATA_LOST by ScardTransmit

From: Thirumarban Madhavaraman (thirumarban_mYAHOO.COM.SG)
Date: Thu Apr 10 2003 - 23:31:42 CDT


Hi,
You are correct,The Ins should be 0xC0..Thank you very
much.

M.Thiru
 --- Eric Perlin <ericperlWINDOWS.MICROSOFT.COM>
wrote: > Note that Get response is typically 0xC0 and
not
> 0xE0.
> Also, it's not clear that your code tests that
> SelectDF succeeded from
> the card's point of view (2 bytes returned in
> SCardTransmit for SELECT).
>
> In any case, it doesn't make sense that it ends up
> as a communication
> failure.
> Do you mind sharing the type of card and reader
> you're using?
>
> Eric Perlin [MS]
>
>
> -----Original Message-----
> From: SUSCRIBE SmartCardSDK M.Thiru
> [mailto:thirumarban_mYAHOO.COM.SG]
> Sent: Wednesday, April 09, 2003 9:11 PM
> To: SmartCardSDKDISCUSS.MICROSOFT.COM
> Subject: SCARD_E_COMM_DATA_LOST by ScardTransmit
>
>
> Hi,
> after succesfully executing Select file ,when I try
> to get
> response,ScardTransmit give this error,
> SCARD_E_COMM_DATA_LOST
> ((DWORD)0x8010002FL). But when I try use the same
> command before
> selcting
> file,no error is returned . Can anyone help me to
> fix this problem.
>
> The code is as below.
> main()
> {
> //After establish context and connect, I tied
> to select file and
> get
> //its response
>
> //Select DF 0200
> FileID[0] = 0x03;
> FileID[1] = 0x00;
> lReturn = SelectDF(hCardHandle,FileID);
>
> //Get Response from Card
> Len = 14;
> GetResp(hCardHandle,RespBuff,Len);
>
>
> }
>
>
> LONG GetResp(SCARDHANDLE hCardHandle,char
> *RespBuff,int Len)
> {
> unsigned char SendData[5];
> int SendLen;
> unsigned char RespData[40];
> unsigned long RespLen;
> LONG lReturn;
> SCARD_IO_REQUEST PioRecvPci;
>
> SendData[0] = 0x00;
> SendData[1] = 0xE0;
> SendData[2] = 0x00;
> SendData[3] = 0x00;
> SendData[4] = Len;
>
> RespLen = sizeof(RespData);
> PioRecvPci.dwProtocol = SCARD_PROTOCOL_T0;
>
> lReturn= SCardTransmit( hCardHandle, SCARD_PCI_T0 ,
> SendData, sizeof(SendData), NULL,
> RespData,
> &RespLen );
>
> memcpy(RespBuff,RespData,Len);
>
> return lReturn;
>
>
>
> }
>
>
> Thanks
> M.Thiru

__________________________________________________
Do You Yahoo!?
Promote your business from just $5 a month!
http://sg.biztools.yahoo.com