共用方式為


SeCreateClientSecurityFromSubjectContext 函式 (ntifs.h)

SeCreateClientSecurityFromSubjectContext 例程會擷取安全性主體內容的存取令牌,並使用結果來初始化安全性客戶端內容,其中包含呼叫 seImpersonateClientEx 所需的資訊。

語法

NTSTATUS SeCreateClientSecurityFromSubjectContext(
  [in]  PSECURITY_SUBJECT_CONTEXT    SubjectContext,
  [in]  PSECURITY_QUALITY_OF_SERVICE ClientSecurityQos,
  [in]  BOOLEAN                      ServerIsRemote,
  [out] PSECURITY_CLIENT_CONTEXT     ClientContext
);

參數

[in] SubjectContext

要模擬之用戶端之安全性主體內容的指標。

[in] ClientSecurityQos

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

[in] ServerIsRemote

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

[out] ClientContext

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

傳回值

SeCreateClientSecurityFromSubjectContext 成功初始化安全性用戶端內容時傳回STATUS_SUCCESS。

當要仿真的用戶端目前正在模擬自己的用戶端時,它會傳回STATUS_BAD_IMPERSONATION_LEVEL,下列其中一項為 true:

  • 用戶端的有效令牌無法傳遞給另一部伺服器使用,因為其模擬層級 SecurityAnonymousSecurityIdentification

  • ServerIsRemote 為 TRUE,且用戶端線程會模擬其用戶端,而不是 SecurityDelegation 層級。

言論

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

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

SeCreateClientSecurityFromSubjectContext 的每個呼叫都必須與後續呼叫 SeDeleteClientSecurity相符。

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

要求

要求 價值
最低支援的用戶端 Windows 2000
目標平臺 普遍
標頭 ntifs.h (include Ntifs.h)
連結庫 NtosKrnl.lib
DLL NtosKrnl.exe
IRQL PASSIVE_LEVEL

另請參閱

[SECURITY_SUBJECT_CONTEXT/(/windows-hardware/drivers/kernel/eprocess##security_subject_context)

[SeDeleteClientSecurity/(nf-ntifs-sedeleteclientsecurity.md)

[SeImpersonateClientEx/(nf-ntifs-seimpersonateclientex.md)