IStorage definition problem lazarus / 67-Windows ---------------------------------------------------------------------- 440bx · 2025-06-28 00:32 Hello, In Activex.pp, the IStorage interface is defined as: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     IStorage = Interface (IUnknown)       ['{0000000b-0000-0000-C000-000000000046}']       Function CreateStream(pwcsname:POleStr;GrfMode,Reserved1,Reserved2 : DWord; Out stm : IStream):HResult; StdCall;       Function OpenStream(pwcsname:POleStr;Reserved1:Pointer;GrfMode,Reserved2 : DWord; Out stm : IStream):HResult; StdCall;//       Function RemouteOp enStream(pwcsname:POleStr;cbReserved1:ULong;reserved1:pbyte;GrfMode,Re served2 : DWord; Out stm : IStream):HResult; StdCall;       Function CreateStorage(pwcsname:POleStr;GrfMode,Reserved1,Reserved2 : DWord; Out stm : IStorage):HResult; StdCall;       Function OpenStorage(pwcsname:POleStr;Const stgPriority:IStorage;grfmode : DWord;Const SNBExclude :SNB;reserved:DWord;Out stm : IStorage):HResult; StdCall;       Function CopyTo(ciidExclude:DWord; rgiidexclude:piid; const snbexclude:SNB;const pstg : IStorage):HResult;StdCall;       Function MoveElementTo(wcsName:POleStr;Const pstgDest : IStorage;                              wcvsNewName:POleStr; GrfFlags:DWord):Hresult; StdCall;       Function Commit(grfCommitFlags:Dword):Hresult; StdCall;       Function Revert:HResult; StdCall;       Function EnumElements(Reserved1 :Dword;Reserved2:Pointer;Reserved3:DWord;Out penum:IEnumStatStg):HResult;StdCall;        { this method does NOT exist in IStorage }        Function RemoteEnumElements(Reserved1 :Dword;cbReserved2:ULong;Reserved2:pbyte;reserved3:DWord;Out penum:IEnumStatStg):HResult;StdCall;         { remainder cut away for brevity }        End;  The C definition: Code: C  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     MIDL_INTERFACE("0000000b-0000-0000-C000-000000000046")    IStorage : public IUnknown    {    public:        virtual HRESULT STDMETHODCALLTYPE CreateStream(            /* [string][in] */ __RPC__in_string const OLECHAR *pwcsName,            /* [in] */ DWORD grfMode,            /* [in] */ DWORD reserved1,            /* [in] */ DWORD reserved2,            /* [out] */ __RPC__deref_out_opt IStream **ppstm) = 0;         virtual /* [local] */ HRESULT STDMETHODCALLTYPE OpenStream(            /* [annotation][string][in] */            _In_z_  const OLECHAR *pwcsName,            /* [annotation][unique][in] */            _Reserved_  void *reserved1,          /* [in] */ DWORD grfMode,            /* [in] */ DWORD reserved2,            /* [annotation][out] */            _Outptr_  IStream **ppstm) = 0;         virtual HRESULT STDMETHODCALLTYPE CreateStorage(            /* [string][in] */ __RPC__in_string const OLECHAR *pwcsName,            /* [in] */ DWORD grfMode,            /* [in] */ DWORD reserved1,            /* [in] */ DWORD reserved2,          /* [out] */ __RPC__deref_out_opt IStorage **ppstg) = 0;         virtual HRESULT STDMETHODCALLTYPE OpenStorage(            /* [string][unique][in] */ __RPC__in_opt_string const OLECHAR *pwcsName,            /* [unique][in] */ __RPC__in_opt IStorage *pstgPriority,          /* [in] */ DWORD grfMode,            /* [unique][in] */ __RPC__deref_opt_in_opt SNB snbExclude,            /* [in] */ DWORD reserved,            /* [out] */ __RPC__deref_out_opt IStorage **ppstg) = 0;         virtual /* [local] */ HRESULT STDMETHODCALLTYPE CopyTo(            /* [in] */ DWORD ciidExclude,            /* [annotation][size_is][unique][in] */            _In_reads_opt_(ciidExclude)  const IID *rgiidExclude,            /* [annotation][unique][in] */            _In_opt_  SNB snbExclude,          /* [annotation][unique][in] */            _In_  IStorage *pstgDest) = 0;         virtual HRESULT STDMETHODCALLTYPE MoveElementTo(            /* [string][in] */ __RPC__in_string const OLECHAR *pwcsName,            /* [unique][in] */ __RPC__in_opt IStorage *pstgDest,            /* [string][in] */ __RPC__in_string const OLECHAR *pwcsNewName,            /* [in] */ DWORD grfFlags) = 0;         virtual HRESULT STDMETHODCALLTYPE Commit(            /* [in] */ DWORD grfCommitFlags) = 0;         virtual HRESULT STDMETHODCALLTYPE Revert( void) = 0;         virtual /* [local] */ HRESULT STDMETHODCALLTYPE EnumElements(            /* [annotation][in] */            _Reserved_  DWORD reserved1,            /* [annotation][size_is][unique][in] */            _Reserved_  void *reserved2,            /* [annotation][in] */            _Reserved_  DWORD reserved3,            /* [annotation][out] */            _Outptr_  IEnumSTATSTG **ppenum) = 0;         virtual HRESULT STDMETHODCALLTYPE DestroyElement(            /* [string][in] */ __RPC__in_string const OLECHAR *pwcsName) = 0;         virtual HRESULT STDMETHODCALLTYPE RenameElement(            /* [string][in] */ __RPC__in_string const OLECHAR *pwcsOldName,            /* [string][in] */ __RPC__in_string const OLECHAR *pwcsNewName) = 0;       virtual HRESULT STDMETHODCALLTYPE SetElementTimes(            /* [string][unique][in] */ __RPC__in_opt_string const OLECHAR *pwcsName,            /* [unique][in] */ __RPC__in_opt const FILETIME *pctime,          /* [unique][in] */ __RPC__in_opt const FILETIME *patime,          /* [unique][in] */ __RPC__in_opt const FILETIME *pmtime) = 0;       virtual HRESULT STDMETHODCALLTYPE SetClass(            /* [in] */ __RPC__in REFCLSID clsid) = 0;         virtual HRESULT STDMETHODCALLTYPE SetStateBits(            /* [in] */ DWORD grfStateBits,            /* [in] */ DWORD grfMask) = 0;         virtual HRESULT STDMETHODCALLTYPE Stat(            /* [out] */ __RPC__out STATSTG *pstatstg,            /* [in] */ DWORD grfStatFlag) = 0;     }; does not include a RemoteEnumElements method. At first sight, the IStorage definition found in JwaActivex.pas seems correct (no RemoteEnumElements method in it): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   IStorage = interface(IUnknown)    ['{0000000B-0000-0000-C000-000000000046}']  function CreateStream(pwcsName: POleStr; grfMode: Longint; reserved1: Longint;      reserved2: Longint; out stm: IStream): HRESULT; stdcall;    function OpenStream(pwcsName: POleStr; reserved1: Pointer; grfMode: Longint;      reserved2: Longint; out stm: IStream): HRESULT; stdcall;    function CreateStorage(pwcsName: POleStr; grfMode: Longint;      dwStgFmt: Longint; reserved2: Longint; out stg: IStorage): HRESULT; stdcall;    function OpenStorage(pwcsName: POleStr; const stgPriority: IStorage;      grfMode: Longint; snbExclude: TSNB; reserved: Longint; out stg: IStorage): HRESULT; stdcall;    function CopyTo(ciidExclude: Longint; rgiidExclude: PIID;      snbExclude: TSNB; const stgDest: IStorage): HRESULT; stdcall;    function MoveElementTo(pwcsName: POleStr; const stgDest: IStorage;    pwcsNewName: POleStr; grfFlags: Longint): HRESULT; stdcall;    function Commit(grfCommitFlags: Longint): HRESULT; stdcall;    function Revert: HRESULT; stdcall;    function EnumElements(reserved1: Longint; reserved2: Pointer; reserved3: Longint;      out enm: IEnumStatStg): HRESULT; stdcall;    function DestroyElement(pwcsName: POleStr): HRESULT; stdcall;    function RenameElement(pwcsOldName: POleStr; pwcsNewName: POleStr): HRESULT; stdcall;    function SetElementTimes(pwcsName: POleStr; const ctime: TFileTime;      const atime: TFileTime; const mtime: TFileTime): HRESULT; stdcall;    function SetClass(const clsid: TCLSID): HRESULT; stdcall;    function SetStateBits(grfStateBits: Longint; grfMask: Longint): HRESULT; stdcall;    function Stat(out statstg: TStatStg; grfStatFlag: Longint): HRESULT; stdcall;  end;  HTH. ---------------------------------------------------------------------- Thaddy · 2025-06-28 06:05 I believe that is part of DCOM/COM+, the remoting variants of COM. ---------------------------------------------------------------------- marcov · 2025-06-28 07:54 Seems it was removed in some later version of windows: https://learn.microsoft.com/en-us/previous- versions/windows/desktop/legacy/aa380026(v=vs.85) but ReactOS still supports it: https://doxygen.reactos.org/d6/d21/interfaceIStorage.html ---------------------------------------------------------------------- ASerge · 2025-06-28 08:19 From ObjIdl.ldl Code: C  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i interface IStorage : IUnknown{...    [local]    HRESULT OpenStream(        [in, string] const OLECHAR *pwcsName,        [in, unique] void *reserved1,        [in] DWORD grfMode,        [in] DWORD reserved2,        [out] IStream **ppstm);     [call_as(OpenStream)]    HRESULT RemoteOpenStream(        [in, string] const OLECHAR *pwcsName,        [in] unsigned long cbReserved1,        [in, unique, size_is(cbReserved1)] byte *reserved1,        [in] DWORD grfMode,      [in] DWORD reserved2,        [out] IStream **ppstm);...    [local]  HRESULT CopyTo(        [in] DWORD ciidExclude,        [in, unique, size_is(ciidExclude)] IID const *rgiidExclude,        [in, unique, annotation("__RPC__in_opt")] SNB snbExclude,        [in, unique] IStorage *pstgDest);     [call_as(CopyTo)]    HRESULT RemoteCopyTo(      [in] DWORD ciidExclude,        [in, unique, size_is(ciidExclude) DISABLE_CONSISTENCY_CHK] IID const *rgiidExclude,        [in, unique] SNB snbExclude,        [in, unique] IStorage *pstgDest);...    [local]    HRESULT EnumElements(        [in] DWORD reserved1,        [in, unique, size_is(1)] void *reserved2,        [in] DWORD reserved3,        [out] IEnumSTATSTG **ppenum);     [call_as(EnumElements)]    HRESULT RemoteEnumElements(        [in] DWORD reserved1,        [in] unsigned long cbReserved2,        [in, unique, size_is(cbReserved2)] byte *reserved2,        [in] DWORD reserved3,        [out] IEnumSTATSTG **ppenum);... See [local] and [call_as]. So RemoteEnumElements is a stub for EnumElements, and it needs to be removed. ---------------------------------------------------------------------- 440bx · 2025-06-28 08:30 Quote from: ASerge on June 28, 2025, 10:19:46 amSee [local] and [call_as]. So RemoteEnumElements is a stub for EnumElements, and it needs to be removed. Now it makes sense.  I looked at the "Call_as" in the Pascal definition and was really puzzled as to what it was there for.  Now it makes sense, it's a direct copy from the .idl file.   I didn't think about that. ---------------------------------------------------------------------- marcov · 2025-06-28 18:43 Done.