ISCardCmd::put_AlternateClassId method

[The put_AlternateClassId 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_AlternateClassId method specifies a new alternate class identifier in the application protocol data unit (APDU).

Syntax

HRESULT put_AlternateClassId(
  [in] BYTE byClass
);

Parameters

byClass [in]

Alternate class identifier. The default value is zero.

Return value

The method returns one of the following possible values.

Return code Description
S_OK
Operation completed successfully.
E_INVALIDARG
The byClass parameter is not valid.

 

Remarks

With communications using the T=0 protocol, additional card commands can be automatically generated by the APDU and sent to the transmission protocol data unit (TPDU). The additional commands typically use the same class ID as the original command; specifying a new class ID by means of this method allows automatically generated commands to use the new class ID.

Examples

The following example shows how to set a new alternate class identifier in the application protocol data unit (APDU). The example assumes that pISCardCmd is a valid pointer to an instance of the ISCardCmd interface.

HRESULT  hr;

// Set the class ID.
hr = pISCardCmd->put_AlternateClassId(0xC0);
if (FAILED(hr))
{
  printf("Failed put_AlternateClassId\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

ISCardCmd

get_AlternateClassId