Procedure Encoding and Decoding

When you use procedure encoding and decoding, a procedure, rather than a type, is labeled with the encode and/or decode attribute. Instead of generating the usual remote stub, the compiler generates a serialization stub for the routine.

Just as a remote procedure must use a binding handle to make a remote call, a serialization procedure must use an encoding handle to use encoding services. If an encoding handle is not specified, a default implicit encoding handle is used to direct the call. On the other hand, if the encoding handle is specified, either as an explicit handle_t argument of the routine or by using the explicit_handle attribute, the developer must pass a valid handle as an argument of the call. For additional information on how to create a valid serialization handle, see Serialization Handles, Examples of Fixed Buffer Encoding, and Examples of Incremental Encoding.

Microsoft RPC allows for remote and serialization procedures to be mixed in one interface. However, use caution when doing so. For implicit handles, the global implicit handle must be set to a valid binding handle before a remote call, and to a valid encoding or decoding handle before a serialization call.