Logo Search packages:      
Sourcecode: pcsc-lite version File versions  Download package

LONG SCardControl ( SCARDHANDLE  hCard,
DWORD  dwControlCode,
LPCVOID  pbSendBuffer,
DWORD  cbSendLength,
LPVOID  pbRecvBuffer,
DWORD  cbRecvLength,
LPDWORD  lpBytesReturned 
)

This function sends a command directly to the IFD Handler to be processed by the reader.

This is useful for creating client side reader drivers for functions like PIN pads, biometrics, or other extensions to the normal smart card reader that are not normally handled by PC/SC.

Note:
the API of this function changed. In pcsc-lite 1.2.0 and before the API was not Windows(R) PC/SC compatible. This has been corrected.
Parameters:
[in] hCard Connection made from SCardConnect.
[in] dwControlCode Control code for the operation.
Click here for a list of supported commands by some drivers.
[in] pbSendBuffer Command to send to the reader.
[in] cbSendLength Length of the command.
[out] pbRecvBuffer Response from the reader.
[in] cbRecvLength Length of the response buffer.
[out] lpBytesReturned Length of the response.
Returns:
Error code.
Return values:
SCARD_S_SUCCESS Successful.
SCARD_E_NOT_TRANSACTED Data exchange not successful.
SCARD_E_INVALID_HANDLE Invalid hCard handle.
SCARD_E_INVALID_VALUE Invalid value was presented.
SCARD_E_READER_UNAVAILABLE The reader has been removed.
SCARD_W_RESET_CARD The card has been reset by another application.
SCARD_W_REMOVED_CARD The card has been removed from the reader.
Test:
 LONG rv;
 SCARDCONTEXT hContext;
 SCARDHANDLE hCard;
 DWORD dwActiveProtocol, dwSendLength, dwRecvLength;
 BYTE pbRecvBuffer[10];
 BYTE pbSendBuffer[] = { 0x06, 0x00, 0x0A, 0x01, 0x01, 0x10 0x00 };
 ...
 rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
 rv = SCardConnect(hContext, "Reader X", SCARD_SHARE_SHARED, SCARD_PROTOCOL_RAW &hCard, &dwActiveProtocol);
 dwSendLength = sizeof(pbSendBuffer);
 dwRecvLength = sizeof(pbRecvBuffer);
 rv = SCardControl(hCard, 0x42000001, pbSendBuffer, dwSendLength, pbRecvBuffer, sizeof(pbRecvBuffer), &dwRecvLength);

Definition at line 1013 of file winscard_scf.c.

References MAX_BUFFER_SIZE.

Referenced by MSGFunctionDemarshall().

{
      /* TODO */
      return SCARD_S_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index