Procedure Header Descriptor

The header has been extended several times over the life of the NDR engine. The current compiler still generates different headers depending on the mode of the compiler. However, more recent headers are a superset of the older ones.

The Old –Oi Header

The header has the following format:

handle_type<1> 
Oi_flags<1>
[rpc_flags<4>]
proc_num<2>  
stack_size<2>
[explicit_handle_description<>]

Where handle_type<1> can be one of the values shown in the following table.

Hex Handle
31 FC_BIND_GENERIC
32 FC_BIND_PRIMITIVE
33 FC_AUTO_HANDLE
34 FC_CALLBACK_HANDLE
0 (explicit handle)

 

If the handle_type<1> field is nonzero, then the procedure uses an implicit handle of the indicated kind. See the Handles topic for a more information. If the handle_type<1> field is zero, the handle used for binding is one of the procedure's parameters.

Explicit handles can be primitive, generic, and context; the last one has the following FC token.

Hex Handle
30 FC_BIND_CONTEXT

 

By convention, the handle type for DCOM interfaces is FC_AUTO_HANDLE.

The Oi_flags<1> field is an 8-bit mask of the following flags.

Hex Flag Meaning
01 Oi_FULL_PTR_USED Uses the full pointer package.
02 Oi_RPCSS_ALLOC_USED Uses the RpcSs memory package.
04 Oi_OBJECT_PROC A procedure in an object interface.
08 Oi_HAS_RPCFLAGS The procedure has nonzero Rpc flags.
10 Oi_* Overloaded.
20 Oi_* Overloaded.
40 Oi_USE_NEW_INIT_ROUTINES Uses Windows NT3.5 Beta2+ init routines.
80 Unused.

 

The following flags are overloaded.

Hex Flag Meaning
10 ENCODE_IS_USED Used only in pickling.
20 DECODE_IS_USED Used only in pickling.
10 Oi_IGNORE_OBJECT_EXCEPTION_HANDLING Not used anymore (old OLE).
20 Oi_HAS_COMM_OR_FAULT In raw RPC only, [comm _, fault_status].
20 Oi_OBJ_USE_V2_INTERPRETER In DCOM only, use –Oif interpreter.

 

The rpc_flags<4> field describes how to set the RpcFlags field of the RPC_MESSAGE structure. This field is only present if the Oi_flags<1> field has Oi_HAD_RPCFLAGS set. If this field is not present, then the RPC flags for the remote procedure are zero.

Note

For performance, the async interpreters always have the rpc_flags<4> field present.

 

The proc_num<2> field provides the procedure's procedure number.

The stack_size<2> provides the total size of all parameters on the stack, including any this pointer and/or return value.

The explicit_handle_description<> field is described later in this document. This field is not present if the procedure uses an implicit handle.