大网数据广告活动
Windows 系统接口

Impersonation Level Constants (RpcDce.h)

· 52CE 我爱测

Specifies an impersonation level, which indicates the amount of authority given to the server when it is impersonating the client.

Specifies an impersonation level, which indicates the amount of authority given to the server when it is impersonating the client.

Constant/value Description
RPC_C_IMP_LEVEL_DEFAULT 0 DCOM can choose the impersonation level using its normal security blanket negotiation algorithm. For more information, see Security Blanket Negotiation.
RPC_C_IMP_LEVEL_ANONYMOUS 1 The client is anonymous to the server. The server process can impersonate the client, but the impersonation token will not contain any information and cannot be used.
RPC_C_IMP_LEVEL_IDENTIFY 2 The server can obtain the client's identity. The server can impersonate the client for ACL checking, but it cannot access system objects as the client.
RPC_C_IMP_LEVEL_IMPERSONATE 3 The server process can impersonate the client's security context while acting on behalf of the client. This level of impersonation can be used to access local resources such as files. When impersonating at this level, the impersonation token can only be passed across one machine boundary. The Schannel authentication service only supports this level of impersonation.
RPC_C_IMP_LEVEL_DELEGATE 4 The server process can impersonate the client's security context while acting on behalf of the client. The server process can also make outgoing calls to other servers while acting on behalf of the client, using cloaking. The server may use the client's security context on other machines to access local and remote resources as the client. When impersonating at this level, the impersonation token can be passed across any number of computer boundaries.

Remarks

GetUserName will fail while impersonating at identify level. The workaround is to impersonate, call OpenThreadToken, revert, call GetTokenInformation, and finally, call LookupAccountSid. Using CoSetProxyBlanket, the client sets the impersonation level

Using CoSetProxyBlanket, the client sets the impersonation level and proxy identity that will be available when a server calls CoImpersonateClient. The identity the server will see when impersonating takes place is described in Cloaking. Note that when making a call while impersonating, the callee will normally receive the caller's process token, not the caller's impersonation token. To receive the caller's impersonation token, the caller must enable cloaking.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header RpcDce.h

See also

Cloaking

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。