共用方式為


SeCreateClientSecurity 函式 (ntifs.h)

SeCreateClientSecurity 例程會使用呼叫 seImpersonateClientEx 所需的資訊,初始化安全性客戶端內容結構。

語法

NTSTATUS SeCreateClientSecurity(
  [in]  PETHREAD                     ClientThread,
  [in]  PSECURITY_QUALITY_OF_SERVICE ClientSecurityQos,
        BOOLEAN                      RemoteSession,
  [out] PSECURITY_CLIENT_CONTEXT     ClientContext
);

參數

[in] ClientThread

要模擬之用戶端線程的指標。

[in] ClientSecurityQos

呼叫端配置的SECURITY_QUALITY_OF_SERVICE結構的指標,指出要執行何種形式的模擬。

RemoteSession

如果用戶端要求的伺服器是遠端的,則設定為 TRUE。

[out] ClientContext

要初始化之呼叫端配置的SECURITY_CLIENT_CONTEXT結構的指標。

傳回值

傳回碼 描述
STATUS_SUCCESS 安全性客戶端內容已成功初始化。
STATUS_BAD_IMPERSONATION_LEVEL 要仿真的用戶端目前正在模擬自己的用戶端,下列其中一項為 true:(1) 用戶端的有效令牌無法傳遞給另一部伺服器使用,因為其模擬層級 SecurityAnonymousSecurityIdentification。 (2) ServerIsRemote 為 TRUE,且用戶端線程會模擬其用戶端,而不是 SecurityDelegation 層級。

言論

SeCreateClientSecurity 初始化用戶端安全性內容區塊,以表示客戶端的安全性內容。

如果 ClientSecurityQosContextTrackingMode 成員設定為 SECURITY_DYNAMIC_TRACKING,且 ServerIsRemote 設為 FALSE,SeCreateClientSecurity 會使用用戶端有效令牌的參考。 否則,SeCreateClientSecurity 會建立用戶端令牌的複本。

每次呼叫 SeCreateClientSecurity,都必須與後續呼叫 SeDeleteClientSecurity相符。

如需安全性和訪問控制的詳細資訊,請參閱 適用於驅動程式開發人員的 Windows 安全性模型,以及 Windows SDK 中這些主題的檔。

要求

要求 價值
目標平臺 普遍
標頭 ntifs.h (include Ntifs.h)
連結庫 NtosKrnl.lib
DLL NtosKrnl.exe
IRQL PASSIVE_LEVEL

另請參閱

SeDeleteClientSecurity

SeImpersonateClientEx