rpcServerInqCallAttributesA 函式 (rpcasync.h)
RpcServerInqCallAttributes 函式是 RPC 伺服器呼叫,可取得用戶端安全性內容屬性。
語法
RPC_STATUS RpcServerInqCallAttributesA(
[in] RPC_BINDING_HANDLE ClientBinding,
[in, out] void *RpcCallAttributes
);
參數
[in] ClientBinding
選擇性。 針對伺服器例程內的明確系結, ClientBinding 是呼叫管理員例程的系結句柄。 請參閱<備註>。
[in, out] RpcCallAttributes
RPC_CALL_ATTRIBUTES_V2 接收呼叫屬性的結構。
傳回值
傳回成功時RPC_S_OK,並填入 RpcCallAttributes 。 如果傳回 ERROR_MORE_DATA,RpcCallAttributes 中的一或多個字段長度不足且無法填滿。 如需處理ERROR_MORE_DATA的詳細資訊,請參閱 RPC_CALL_ATTRIBUTES_V2 中的。
失敗時, RpcCallAttributes 的內容未定義,而且可由 RPC 部分修改。
備註
RpcServerInqCallAttributes 函式會使用版本設定配置來納入新功能,而不需要引進具有後綴標識碼的新函式。 例如,在標頭中使用簡單 #define 識別的第二個 RPC_CALL_ATTRIBUTES_V2版本,可以新增成員,以協助未來 RpcServerInqCallAttributes 函式版本中建置的新功能,而不需要釋放名為 RpcServerInqCallAttributesEx 的函式。
如果在伺服器例程之外呼叫 RpcServerInqCallAttributes 函式,而且如果函式呼叫會查詢異步 RPC 呼叫的安全性內容屬性,則可以從異步句柄呼叫 RpcAsyncGetCallHandle 函式來擷取 ClientBinding。
數據報通訊協定序列不支援 RpcServerInqCallAttributes 函式,例如 ncadg_*。 如果在數據報通訊協定序列上執行的呼叫上叫用,則會傳回RPC_S_CANNOT_SUPPORT。
RpcServerInqCallAttributes 函式是安全線程。
範例
RPC_CALL_ATTRIBUTES CallAttributes; // this maps to RPC_CALL_ATTRIBUTES_V1
memset(&CallAttributes, 0, sizeof(CallAttributes));
CallAttributes.Version = RPC_CALL_ATTRIBUTES_VERSION; // maps to 1
CallAttributes.Flags = ;//....
Status = RpcServerInqCallAttributes(0, &ClientContextAttributes);
注意
rpcasync.h 標頭會根據 UNICODE 預處理器常數的定義,將 RpcServerInqCallAttributes 定義為自動選取此函式的 ANSI 或 Unicode 版本。 混合使用編碼中性別名與非編碼中性的程序代碼,可能會導致編譯或運行時間錯誤不符。 如需詳細資訊,請參閱 函式原型的慣例。
規格需求
需求 | 值 |
---|---|
最低支援的用戶端 | Windows XP [僅限傳統型應用程式] |
最低支援的伺服器 | Windows Server 2003 [僅限桌面應用程式] |
目標平台 | Windows |
標頭 | rpcasync.h (包含 Rpc.h) |
程式庫 | Rpcrt4.lib |
Dll | Rpcrt4.dll |
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應