Hello,
In activex.pp, IRpcChannelBuffer.FreeBuffer is defined as:
Function FreeBuffer(Const pMessage : RPCOLEMESSAGE):HResult; StdCall;
where "pMessage" is specified as "const".
The C/C++ definition is:
virtual HRESULT STDMETHODCALLTYPE FreeBuffer(
/* [annotation][out][in] */
_Inout_ RPCOLEMESSAGE *pMessage) = 0;
Notice that the parameter is "inout" indicating that the values in the structure are modified, IOW, they are NOT "const".
In addition to misleading, it is questionable to rely on "const" passing the parameter by reference given that it is explicitly documented that FPC may decide not to pass a const parameter by reference.
The parameter should be "var".