共用方式為


ISCard::get_Protocol 方法

[ get_Protocol 方法可用於需求一節中指定的作業系統。 它不適用於 Windows Server 2003 service Pack 1 (SP1) 及更新版本、Windows Vista、Windows Server 2008 和後續版本的作業系統。 智慧卡模組提供類似的功能。

get_Protocol方法會擷取智慧卡上目前使用的通訊協定識別碼。

語法

HRESULT get_Protocol(
  [out] SCARD_PROTOCOLS *pProtocol
);

參數

pProtocol [out]

通訊協定識別碼的指標。

傳回值

方法會傳回下列其中一個可能的值。

傳回碼 描述
S_OK
作業順利完成。
E_INVALIDARG
pProtocol參數無效。
E_POINTER
pProtocol中傳遞了不正確的指標。

 

備註

除了上述 COM 錯誤碼之外,如果呼叫智慧卡函式來完成要求,此介面可能會傳回智慧卡錯誤碼。 如需詳細資訊,請參閱 智慧卡傳回值

範例

下列範例顯示擷取智慧卡上目前使用的通訊協定識別碼。

SCARD_PROTOCOLS   scProtocol;
HRESULT           hr;

// Retrieve the protocol.
hr = pISCard->get_Protocol(&scProtocol);
if (FAILED(hr))
{
   printf("Failed get_Protocol\n");
   // Take other error handling action as needed.
}
// Use the retrieved protocol. (This example merely displays it.)
switch (scProtocol)
{
    case T0:
        printf("T0 protocol\n");
        break;
    case T1:
        printf("T1 protocol\n");
        break;
    default:
        printf("Other protocol\n");
        break;
}

規格需求

需求
最低支援的用戶端
Windows XP [僅限傳統型應用程式]
最低支援的伺服器
Windows Server 2003 [僅限傳統型應用程式]
用戶端支援結束
Windows XP
伺服器終止支援
Windows Server 2003
標頭
Scardmgr.h
類型程式庫
Scardmgr.tlb
DLL
Scardssp.dll
IID
IID_ISCard定義為 1461AAC3-6810-11D0-918F-00AA00C18068

另請參閱

get_Atr

get_CardHandle

get_CoNtext

get_Status

ISCard