Implementing ORPC in RPC

Since the implicit parameters are specified as IDL, the ORPC header received by RPC will contain many fields inserted by MIDL. Here are the definitions for the header on the wire.


/*
     An inbound header would be laid out as follows where the
extent array is optional and there may be zero of more extents.
An outbound header is laid out similarly.

      ORPCTHIS_WITHNOEXTENSIONS
      [
       ORPC_EXTENT_ARRAY
          [ORPC_EXTENT]*
         ]

*/
typedef struct
{
  COMVERSION     version;       // COM version number
  unsigned long  flags;         // INFO flags for presence of other data
  unsigned long  reserved1;     // set to zero
  LTID           ltid;          // logical thread id of caller
  unsigned long  unique;        // tag to indicate presence of extensions
} ORPCTHIS_WITHNOEXTENSION;

typedef struct
{
    unsigned long  rounded_size;   // Actual number of extents.
    uuid_t         id;             // Extension identifier.
    unsigned long  size;           // Extension size.
    byte           data[];         // Extension data.
} ORPC_EXTENT;


// Array of extensions.
typedef struct
{
  unsigned long  rounded_size;   // Actual number of extents
  unsigned long  size;           // Number of extents
  unsigned long  unique_flag[];  // Flags to indicate presense of ORPC_EXTENTs
} ORPC_EXTENT_ARRAY;

typedef struct
{
  unsigned long  flags;         // INFO flags for presence of other data
  unsigned long  unique;        // tag to indicate presence of extensions
} ORPCTHAT_WITH_NOEXTENSIONS;