Bonjour,
Apres winscard.dll, c'est Gsc.dll qui me bloque...
je l'ai traduit comme ca:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 SCARDHANDLE m_hCard; Cstring m_csSATR; PUCHAR pOutBuffer = (PUCHAR)m_csSATR.GetBufferSetLength(10); // Length ATR size memset(pInBuffer, 0x00, 10); DWORD Length = 4; // expected ATR length in bytes m_Ret = GSCPowerUp(m_hCard, pOutBuffer, &Length); // Reset buffer length... m_csSATR.ReleaseBuffer( ); pOutBuffer = (PUCHAR)m_csSATR.GetBufferSetLength(Length); // The conversion of the sting to HEX should be done before releasing buffer, // Otherwise the reported string length can be not correct in case of zero byte in buffer ConvertStringToHex(m_csSATR); m_csSATR.ReleaseBuffer( ); if(m_Ret!=GEM_SUCCESS) // Display ("SC subsystem error!"); else // Display ("Success!"); }
la fonction me renvoie bien SCARD_s_SUCCES , ecrit "Power Up OK puis plante.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 ATRBUFF : string; ATRLEN : longint; .......... ATRLEN := 4; atrbuff := 'aaaa'; RetVar := GSCPowerUp (FCardHandle,@atrbuff,ATRLEN); if RetVar <> SCARD_S_SUCCESS then begin memo1.lines.add('PowerUp Echoué'); abort; end else memo1.lines.add('PowerUp OK');
Pouvez vous m'aider ??
La fonction marche bien en C y compris en plus simple :
Merci pour votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 unsigned char ATRBuf[4]; unsigned long ATRLen; ATRLen = 4; retvar = GSCPowerUp(m_hcard,ATRBuf, &ATRLen); ...//m_hcard c'est le handele..tout simple.
Oceane.
Partager