ISCardCmd::put_Data method

[The put_Data method is available for use in the operating systems specified in the Requirements section. It is not available for use in Windows Server 2003 with Service Pack 1 (SP1) and later, Windows Vista, Windows Server 2008, and subsequent versions of the operating system. The Smart Card Modules provide similar functionality.]

The put_Data method sets the data field in the application protocol data unit (APDU).

Syntax

HRESULT put_Data(
  [in] LPBYTEBUFFER pData
);

Parameters

pData [in]

Pointer to the byte buffer object (IStream) to be copied into the APDU data field.

Return value

The method returns one of the following possible values.

Return code Description
S_OK
Operation completed successfully.
E_INVALIDARG
The pData parameter is not valid.
E_POINTER
A bad pointer was passed in pData.
E_OUTOFMEMORY
Out of memory.

 

Remarks

When you set a new data portion of the message, the length of the data field is calculated and stored in the P3 parameter of the APDU. To retrieve the length of the data field, call get_P3.

To retrieve the data field from the APDU, call get_Data.

Examples

The following example shows how to set the data field in the application protocol data unit (APDU). The example assumes that pIByteData is a valid pointer to an instance of the IByteBuffer interface, and that pISCardCmd is a valid pointer to an instance of the ISCardCmd interface.

HRESULT    hr;

// pIByteData is a pointer to an instance of IByteBuffer.
// Set the data.
hr = pISCardCmd->put_Data(pIByteData);
if (FAILED(hr)) 
{
    printf("Failed put_Data.\n");
    // Take other error handling action as needed.
}

Requirements

Requirement Value
Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
End of client support
Windows XP
End of server support
Windows Server 2003
Header
Scarddat.h
Type library
Scarddat.tlb
DLL
Scardssp.dll
IID
IID_ISCardCmd is defined as D5778AE3-43DE-11D0-9171-00AA00C18068

See also

get_Data

get_P3

ISCardCmd