From 00e3e73cfd8a195758b8db469f4ef54bb95fac1d Mon Sep 17 00:00:00 2001 From: David Hall Date: Thu, 12 Dec 2019 19:48:07 -0700 Subject: [PATCH] Changed all instances of PIDL[] parameters to IntPtr[] to avoid marshaling error. --- PInvoke/Shell32/ShObjIdl.IFolderView.cs | 4 ++-- PInvoke/Shell32/ShObjIdl.cs | 2 +- PInvoke/Shell32/ShlObj.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PInvoke/Shell32/ShObjIdl.IFolderView.cs b/PInvoke/Shell32/ShObjIdl.IFolderView.cs index 034525be..f8de0e18 100644 --- a/PInvoke/Shell32/ShObjIdl.IFolderView.cs +++ b/PInvoke/Shell32/ShObjIdl.IFolderView.cs @@ -347,7 +347,7 @@ namespace Vanara.PInvoke /// name="apidl"/> should be positioned. /// /// One of the _SVSIF constants that specifies the type of selection to apply. - void SelectAndPositionItems([In] uint cidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] PIDL[] apidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Point[] apt, [In] SVSIF dwFlags); + void SelectAndPositionItems([In] uint cidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] IntPtr[] apidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Point[] apt, [In] SVSIF dwFlags); } /// @@ -442,7 +442,7 @@ namespace Vanara.PInvoke /// name="apidl"/> should be positioned. /// /// One of the _SVSIF constants that specifies the type of selection to apply. - new void SelectAndPositionItems([In] uint cidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] PIDL[] apidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Point[] apt, [In] SVSIF dwFlags); + new void SelectAndPositionItems([In] uint cidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] IntPtr[] apidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Point[] apt, [In] SVSIF dwFlags); /// Groups the view by the given property key and direction. /// diff --git a/PInvoke/Shell32/ShObjIdl.cs b/PInvoke/Shell32/ShObjIdl.cs index db8285bd..26c130b3 100644 --- a/PInvoke/Shell32/ShObjIdl.cs +++ b/PInvoke/Shell32/ShObjIdl.cs @@ -1790,7 +1790,7 @@ namespace Vanara.PInvoke [DllImport(Lib.Shell32, SetLastError = false, ExactSpelling = true)] [PInvokeData("shobjidl_core.h", MSDNShortId = "024ccbc7-97f1-4cb5-8588-9c9b1f747336")] public static extern HRESULT SHCreateShellItemArray([In, Optional] PIDL pidlParent, [In, MarshalAs(UnmanagedType.Interface), Optional] IShellFolder psf, - [In, Optional] uint cidl, [In, Optional] PIDL[] ppidl, out IShellItemArray ppsiItemArray); + [In, Optional] uint cidl, [In, Optional] IntPtr[] ppidl, out IShellItemArray ppsiItemArray); /// /// Creates a Shell item array object from a data object. diff --git a/PInvoke/Shell32/ShlObj.cs b/PInvoke/Shell32/ShlObj.cs index 896e878e..82bff2e0 100644 --- a/PInvoke/Shell32/ShlObj.cs +++ b/PInvoke/Shell32/ShlObj.cs @@ -4061,7 +4061,7 @@ namespace Vanara.PInvoke // PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IDataObject *pdtInner, REFIID riid, void **ppv ); [DllImport(Lib.Shell32, SetLastError = false, ExactSpelling = true)] [PInvokeData("shlobj_core.h", MSDNShortId = "d56cdafe-9463-43a5-8ef0-6cfaf0c524a8")] - public static extern HRESULT SHCreateDataObject(PIDL pidlFolder, uint cidl, [In, MarshalAs(UnmanagedType.LPArray)] PIDL[] apidl, IDataObject pdtInner, in Guid riid, out IDataObject ppv); + public static extern HRESULT SHCreateDataObject(PIDL pidlFolder, uint cidl, [In, MarshalAs(UnmanagedType.LPArray)] IntPtr[] apidl, IDataObject pdtInner, in Guid riid, out IDataObject ppv); /// /// Creates an object that represents the Shell's default context menu implementation.