Recent

Author Topic: IMarshal.GetMarshalSizeMax definition problem  (Read 695 times)

440bx

  • Hero Member
  • *****
  • Posts: 6370
IMarshal.GetMarshalSizeMax definition problem
« on: June 30, 2025, 11:23:55 am »
Hello,

In activex.pp, the GetMarshalSizeMax method is defined as:
Code: Pascal  [Select][+][-]
  1.         Function GetMarshalSizeMax ( Const Riid: TIID; {in, unique} pv:Pointer; Const dwDestContext : DWord;
  2.                    {in, unique} pvDestContext:Pointer; Const mshlflags : DWord; out pSize : PDWord ): HResult;Stdcall;
  3.  
Note the last parameter is declared as "out pSize : PDWord" since it is "out", it should be declared as "out pSize : DWord" (no P in DWord).

HTH.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Zvoni

  • Hero Member
  • *****
  • Posts: 3361
Re: IMarshal.GetMarshalSizeMax definition problem
« Reply #1 on: June 30, 2025, 11:53:14 am »
Agreed.
https://learn.microsoft.com/en-us/windows/win32/api/objidl/nf-objidl-imarshal-getmarshalsizemax
Code: C  [Select][+][-]
  1. HRESULT GetMarshalSizeMax(
  2.   [in]  REFIID riid,
  3.   [in]  void   *pv,
  4.   [in]  DWORD  dwDestContext,
  5.   [in]  void   *pvDestContext,
  6.   [in]  DWORD  mshlflags,
  7.   [out] DWORD  *pSize
  8. );
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018