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