大网数据广告活动
网络与域名解析

Strict and Type Strict Context Handles

· 52CE 我爱测

Use the strict_context_handle attribute for all context handles.

Use the strict_context_handle attribute for all context handles. By default, a context handle is not associated with an interface, which means a context handle can be created on one interface, then passed to another. This is an easy attack, and many RPC servers fail to prevent it.

If two interfaces coexist in the same process, an attacker can open a context handle on one interface, and pass it to another, which may trip over the unexpected data. Many developers believe their software is the only interface in a process, but very often that is not the case, because both the system and many third-party components use RPC internally, and those interfaces can create context handles. When the strict_context_handle attribute is used, the RPC run time ensures that a context created on one interface can be passed as an argument only to methods of that interface.

In situations where an application is developed for Windows Vista, the use of type_strict_context_handle is available and recommended. Context handles are not associated with a specific type by default. When multiple types of context handles are used in the same process, it is possible for a malicious client to pass a context handle in place of another to produce undesirable results. The use of type_strict_context_handle allows applications to enforce context handle type consistency and prevent any mismatched context handle type usage.

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)

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

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