using System; using System.Runtime.InteropServices; namespace Vanara.PInvoke { public static partial class Shell32 { /// Exposes methods to enumerate unknown objects. // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-ienumobjects [PInvokeData("shobjidl_core.h", MSDNShortId = "NN:shobjidl_core.IEnumObjects")] [ComImport, Guid("2c1c7e2e-2d0e-4059-831e-1e6f82335c2e"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IEnumObjects : Vanara.Collections.ICOMEnum { /// Gets the next specified number and type of objects. /// /// Type: ULONG /// The number of objects to retrieve. /// /// /// Type: REFIID /// Reference to the desired interface ID. /// /// /// Type: void** /// When this method returns, contains the interface pointer requested in riid. /// /// /// Type: ULONG* /// /// Pointer to a ULONG value that, when this method returns, states the actual number of objects retrieved. This value /// can be NULL. /// /// /// /// Type: HRESULT /// /// Returns S_OK if the method successfully retrieved the requested objects. This method only returns S_OK if the full count of /// requested items are successfully retrieved. /// /// S_FALSE indicates that more items were requested than remained in the enumeration. /// // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ienumobjects-next HRESULT Next( ULONG celt, // REFIID riid, void **rgelt, ULONG *pceltFetched ); [PreserveSig] HRESULT Next(uint celt, in Guid riid, [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.IUnknown, SizeParamIndex = 0)] object[] rgelt, out uint pceltFetched); /// Skips a specified number of objects. /// /// Type: ULONG /// The number of objects to skip. /// /// /// Type: HRESULT /// If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// /// Enumeration index is advanced by the number of items skipped. // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ienumobjects-skip HRESULT Skip( ULONG celt ); [PreserveSig] HRESULT Skip(uint celt); /// Resets the enumeration index to 0. // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ienumobjects-reset HRESULT Reset(); void Reset(); /// /// Not implemented. /// Not implemented. /// /// /// Type: IEnumObjects** /// Not used. /// // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ienumobjects-clone HRESULT Clone( // IEnumObjects **ppenum ); IEnumObjects Clone(); } } }