When using the fixed buffer style, specify a buffer that is large enough to accommodate the encoding (marshalling) operations performed with the handle. When unmarshalling, you provide the buffer that contains all of the data to decode.
The fixed buffer style of serialization uses the following routines:
MesEncodeFixedBufferHandleCreate allocates the memory needed for the encoding handle and then initializes it. It has the following prototype:
RPC_STATUS RPC_ENTRY MesEncodeFixedBufferHandleCreate (
char * Buffer, /* user-supplied buffer */
unsigned long BufferSize, /* size of the user-supplied
/* buffer */
unsigned long *pEncodedSize, /* pointer to size of
/* encoding */
handle_t *pHandle); /* pointer to the new
/* handle */
The application can call the MesBufferHandleReset function to reinitialize the handle, or it can call the MesHandleFree function to free the handle's memory. To create a decoding handle corresponding to the fixed style encoding handle, you must use the MesDecodeBufferHandleCreate routine.
RPC_STATUS RPC_ENTRY MesDecodeBufferHandleCreate (
char * Buffer, /* buffer with data to
/* decode */
unsigned long BufferSize, /* number of bytes of
/* data to decode in buffer */
handle_t *pHandle); /* pointer to new handle */
The application calls MesHandleFree to free the encoding or decoding buffer handle.
RPC_STATUS RPC_ENTRY MesHandleFree (
handle_t Handle); /* handle to free */