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

User-marshal

· 52CE 我爱测

User-marshal in Remote Procedure Call (RPC).

User marshal has a format string that is similar to transmit_as:

FC_USER_MARSHAL
flags<1>
quadruple_index<2>
user_type_memory_size<2>
transmitted_type_buffer size<2>
offset_to_the_transmitted_type<2>

The flags<1> byte consists of the upper flag nibble and the lower alignment nibble.

The upper 2 bits of the flag nibble are used to describe whether the wire type is defined as a unique pointer, reference pointer or no pointer (it cannot be a ptr). The following manifests have been defined to set/get the flags:

#define USER_MARSHAL_UNIQUE         0x80
#define USER_MARSHAL_REF            0x40
#define USER_MARSHAL_POINTER        0xc0  /* unique or ref */
#define USER_MARSHAL_IID            0x20  /* JIT compiler only */

The alignment nibble of the flag word keeps the wire alignment of the transmitted type.

The quadruple_index<2> is an index of the callback routine quadruple of the user marshal functions. The routine positions are as follow: sizing, marshaling, unmarshaling, and freeing routine.

The user_type_memory_size<2> provides a size for the user specific type, including unknown types.

The transmitted_type_buffer_size<2> is either zero when the size is varying, or the actual fixed size. This is an optimization that enables MIDL to skip callbacks when sizing the buffer, and also when freeing.

Range

The [range] checking provides additional means for argument validation at the NDR layer. The [range] descriptor has the following format:

FC_RANGE,   flags_type <1>
low value<4>
high value<4>

The flags take the upper nibble and the type the lower nibble of the second byte. The low and high values depend on the type of the variable to be checked.

The flags are meant as an expansion vehicle; the compiler has been setting the nibble to zero.

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)

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

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