SCardControl

The SCardControl function gives you direct control of the reader. You can call it any time after a successful call to SCardConnect and before a successful call to SCardDisconnect. The effect on the state of the reader depends on the control code.

LONG SCardControl(
  IN SCARDHANDLE hCard,    
  IN DWORD dwControlCode,  
  IN LPCVOID lpInBuffer,   
  IN DWORD nInBufferSize,  
  OUT LPVOID lpOutBuffer,  
  IN DWORD nOutBufferSize,  
  OUT LPDWORD lpBytesReturned  
);
 

Parameters

hCard
This is the reference value returned from SCardConnect.
dwControlCode
Supplies the control code for the operation. This value identifies the specific operation to be performed.
lpInBuffer
Supplies a pointer to a buffer that contains the data required to perform the operation. This parameter can be NULL if the dwControlCode parameter specifies an operation that does not require input data.
nInBufferSize
Supplies the size, in bytes, of the buffer pointed to by lpInBuffer.
lpOutBuffer
Points to a buffer that receives the operation's output data. This parameter can be NULL if the dwControlCode parameter specifies an operation that does not produce output data.
nOutBufferSize
Supplies the size, in bytes, of the buffer pointed to by lpOutBuffer.
lpBytesReturned
Points to a DWORD that receives the size, in bytes, of the data stored into the buffer pointed to by lpOutBuffer.

Return Values

If the function… The return value is…
Succeeds SCARD_S_SUCCESS.
Fails An error code (see Error Codes for a list of all error codes).

Remarks

SCardControl is a direct card access function. For a description of other direct access functions, see Direct Card Access Functions.

QuickInfo

  Windows NT: Use version 4.0 SP3 and later.
  Windows: Use Windows 95 OSR2.1.
  Windows CE: Unsupported.
  Header: Declared in winscard.h.
  Import Library: Link with winscard.lib.

See Also

SCardConnect
SCardDisconnect