SCardControl
A version of this page is also available for
4/8/2010
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.
Syntax
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 Value
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
Header | winscard.h |
Library | winscard.lib |
Windows Embedded CE | Windows CE 3.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |