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,而下列其中一項成立:

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

  • ServerIsRemote 為 TRUE,且用戶端線程在 SecurityDelegation 層級以外的用戶端模擬其用戶端。

備註

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

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

每次呼叫 SeCreateClientSecurityFromSubjectContext 都必須與 後續對 SeDeleteClientSecurity 的呼叫進行比對。

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

規格需求

需求
最低支援的用戶端 Windows 2000
目標平台 Universal
標頭 ntifs.h (包含 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)