Hi
typedef long (__stdcall *Transmit)(SCARDHANDLE ,const SCARD_IO_REQUEST *,LPCBYTE,DWORD ,SCARD_IO_REQUEST *,LPBYTE,LPDWORD );
Transmit com=0;
hinDLL = LoadLibrary( L"C:\\WINDOWS\\system32\\WinSCard.dll");
if (hinDLL != 0 ){
com=(Transmit) GetProcAddress(hinDLL,"SCardTransmit");
}
BYTE sendCommand[]={0x00,0x0A4,0x00,0x00,0x02,0x3F,0x00};
BYTE recvCommand[10];
long result,lngres,sendlen=sizeof(sendCommand);
DWORD recvlen;
SCARD_IO_REQUEST pioSendPci;
pioSendPci.dwProtocol=SCARD_PROTOCOL_T0;
pioSendPci.cbPciLength= sizeof(pioSendPci);
result= com(phCard,&pioSendPci,sendCommand,sendlen,NULL,recvCommand, &recvlen);
if(result!=SCARD_S_SUCCESS){
printf("command not transmitted\n");
}
getch();
The output of com is 22. It should be 0 and as msdn says error 22 is for bad command but i m unable to find any bad command in my code.... Please tell the problem with my code...