API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

IMEMASTREAM_SET()

Brew Release
Brew MP 1.0.2
See Also
IMemAStream IMEMASTREAM_Release IMEMASTREAM_SetEx
Description
This function allows you to set the memory chunk that needs to be read as a stream. An instance of the IMemAStream Interface object must already exist. The responsibility of freeing the buffer pBuff lies with the IMemAStream Interface. Do not free this buffer. It is freed when either of the following two actions occur:
- The IMemAStream Interface object is released using IMEMASTREAM_Release().
- Or
- A subsequent call to IMEMASTREAM_Set() is attempted with another buffer.

If a buffer has already been set into the stream using a previous call to this function, that buffer is freed before setting the new buffer.

Warning:

It is risky to attempt two consecutive calls to IMEMASTREAM_Set() with the same buffer.

Params
pIMemAStream
[]:
pointer to the IMemAStream interface object.
pBuff
[]:
pointer to the memory chunk that needs to be read as a stream.
dwSize
[]:
size of the memory chunk.
dwOffset
[]:
offset from the beginning of the memory chunk to be set as the start data for the memory stream.
bSysMem
[]:
flag to specify if the memory for the buffer pBuff belongs to the user area or the system memory. This flag indicates whether the routines FREE() or SYSFREE() must be used by the IMemAStream Interface object to free the buffer when this object is released or when another Set() is made. For example, if you perform a MALLOC() to allocate the buffer, bSysMem must be set to FALSE.
Interface
  • IMEMASTREAM
Prototype
  •   void IMEMASTREAM_Set
      (
         IMemAStream * pIMemAStream,
         byte * pBuff,
         uint32 dwSize,
         uint32 dwOffset,
         boolean bSysMem
      );
    
Return
  • None
Comments
None