From 6a78449bf5e3231f7652efb55ca5bf605bf7e079 Mon Sep 17 00:00:00 2001 From: David Hall Date: Fri, 1 Feb 2019 11:38:31 -0700 Subject: [PATCH] Added overload and updated docs for SHCreateShellItemArray. --- PInvoke/Shell32/ShObjIdl.cs | 72 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 8 deletions(-) diff --git a/PInvoke/Shell32/ShObjIdl.cs b/PInvoke/Shell32/ShObjIdl.cs index f45f2d57..c744c134 100644 --- a/PInvoke/Shell32/ShObjIdl.cs +++ b/PInvoke/Shell32/ShObjIdl.cs @@ -1621,24 +1621,80 @@ namespace Vanara.PInvoke /// Creates a Shell item array object. /// - /// The ID list of the parent folder of the items specified in ppidl. If psf is specified, this parameter can be NULL. If this + /// Type: PCIDLIST_ABSOLUTE + /// + /// The ID list of the parent folder of the items specified in ppidl. If psf is specified, this parameter can be NULL. If this /// pidlParent is not specified, it is computed from the psf parameter using IPersistFolder2. + /// /// /// + /// Type: IShellFolder* + /// /// The Shell data source object that is the parent of the child items specified in ppidl. If pidlParent is specified, this parameter - /// can be NULL. + /// can be NULL. + /// + /// + /// + /// Type: UINT + /// The number of elements in the array specified by ppidl. + /// + /// + /// Type: PCUITEMID_CHILD_ARRAY + /// The list of child item IDs for which the array is being created. This value can be NULL. /// - /// The number of elements in the array specified by ppidl. - /// The list of child item IDs for which the array is being created. This value can be NULL. /// - /// When this function returns, contains the address of an interface pointer. + /// Type: IShellItemArray** + /// When this function returns, contains the address of an IShellItemArray interface pointer. /// - [DllImport(Lib.Shell32, CharSet = CharSet.Unicode, ExactSpelling = true)] - [SecurityCritical, SuppressUnmanagedCodeSecurity] - [PInvokeData("Shobjidl.h", MSDNShortId = "bb762144")] + /// + /// Type: HRESULT + /// If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. + /// + // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-shcreateshellitemarray + // SHSTDAPI SHCreateShellItemArray( PCIDLIST_ABSOLUTE pidlParent, IShellFolder *psf, UINT cidl, PCUITEMID_CHILD_ARRAY ppidl, IShellItemArray **ppsiItemArray ); + [DllImport(Lib.Shell32, SetLastError = false, ExactSpelling = true)] + [PInvokeData("shobjidl_core.h", MSDNShortId = "024ccbc7-97f1-4cb5-8588-9c9b1f747336")] public static extern HRESULT SHCreateShellItemArray([In] PIDL pidlParent, [In, MarshalAs(UnmanagedType.Interface)] IShellFolder psf, uint cidl, [In] PIDL ppidl, out IShellItemArray ppsiItemArray); + /// Creates a Shell item array object. + /// + /// Type: PCIDLIST_ABSOLUTE + /// + /// The ID list of the parent folder of the items specified in ppidl. If psf is specified, this parameter can be NULL. If this + /// pidlParent is not specified, it is computed from the psf parameter using IPersistFolder2. + /// + /// + /// + /// Type: IShellFolder* + /// + /// The Shell data source object that is the parent of the child items specified in ppidl. If pidlParent is specified, this parameter + /// can be NULL. + /// + /// + /// + /// Type: UINT + /// The number of elements in the array specified by ppidl. + /// + /// + /// Type: PCUITEMID_CHILD_ARRAY + /// The list of child item IDs for which the array is being created. This value can be NULL. + /// + /// + /// Type: IShellItemArray** + /// When this function returns, contains the address of an IShellItemArray interface pointer. + /// + /// + /// Type: HRESULT + /// If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. + /// + // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-shcreateshellitemarray + // SHSTDAPI SHCreateShellItemArray( PCIDLIST_ABSOLUTE pidlParent, IShellFolder *psf, UINT cidl, PCUITEMID_CHILD_ARRAY ppidl, IShellItemArray **ppsiItemArray ); + [DllImport(Lib.Shell32, SetLastError = false, ExactSpelling = true)] + [PInvokeData("shobjidl_core.h", MSDNShortId = "024ccbc7-97f1-4cb5-8588-9c9b1f747336")] + public static extern HRESULT SHCreateShellItemArray([In, Optional] IntPtr pidlParent, [In, Optional, MarshalAs(UnmanagedType.Interface)] IShellFolder psf, + [In, Optional] uint cidl, [In, Optional] IntPtr ppidl, out IShellItemArray ppsiItemArray); + /// /// Creates a Shell item array object from a data object. ///