SCardControl

This 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(
  SCARDHANDLE hCard, 
  DWORD dwControlCode, 
  LPCVOID lpInBuffer, 
  DWORD nInBufferSize, 
  LPVOID lpOutBuffer, 
  DWORD nOutBufferSize, 
  LPDWORD lpBytesReturned 
);

Parameters

  • hCard
    [in] Handle to a reference value returned from SCardConnect.
  • dwControlCode
    [in] Specifies the control code for the operation. This value identifies the specific operation to be performed.
  • lpInBuffer
    [in] Long 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
    [in] Integer that specifies the size, in bytes, of the buffer pointed to by lpInBuffer.
  • lpOutBuffer
    [out] Long pointer 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
    [in] Integer that specifies the size, in bytes, of the buffer pointed to by lpOutBuffer.
  • lpBytesReturned
    [out] Long pointer to a DWORD that receives the size, in bytes, of the data stored into the buffer pointed to by lpOutBuffer.

Return Values

The following table shows the possible return values.

Value Description
SCARD_S_SUCCESS Succeeds
An error value (see Smart Card Error Values for a list of all error values). Fails

Remarks

SCardControl is a direct card access function.

Requirements

OS Versions: Windows CE 3.0 and later.
Header: Winscard.h.
Link Library: Winscard.lib.

See Also

SCardConnect | SCardDisconnect

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.