From dd46a07422ffecca59cac2c94cd7cbfa3c7a2099 Mon Sep 17 00:00:00 2001 From: David Hall Date: Wed, 17 Jan 2018 12:29:09 -0700 Subject: [PATCH] Added ILFree method --- PInvoke/Shell32/ShObjIdl.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PInvoke/Shell32/ShObjIdl.cs b/PInvoke/Shell32/ShObjIdl.cs index 529bf5fc..a0ee40a0 100644 --- a/PInvoke/Shell32/ShObjIdl.cs +++ b/PInvoke/Shell32/ShObjIdl.cs @@ -861,7 +861,7 @@ namespace Vanara.PInvoke /// Reserved. /// When this method returns successfully, contains the interface pointer requested in riid. [return: MarshalAs(UnmanagedType.Interface)] - object GetUIObjectOf(IntPtr hwndOwner, uint cidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] IntPtr[] apidl, [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid, IntPtr rgfReserved); + object GetUIObjectOf(IntPtr hwndOwner, uint cidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] IntPtr[] apidl, [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid, IntPtr rgfReserved = default(IntPtr)); /// Retrieves the display name for the specified file object or subfolder. /// PIDL that uniquely identifies the file object or subfolder relative to the parent folder. @@ -1193,7 +1193,13 @@ namespace Vanara.PInvoke /// A pointer to the last SHITEMID structure in pidl. [DllImport(Lib.Shell32, ExactSpelling = true, SetLastError = false)] [PInvokeData("Shobjidl.h", MSDNShortId = "bb776440")] - public static extern PIDL ILFindLastID(IntPtr pidl); + public static extern IntPtr ILFindLastID(IntPtr pidl); + + /// Frees an ITEMIDLIST structure allocated by the Shell. + /// A pointer to the ITEMIDLIST structure to be freed. This parameter can be NULL. + [DllImport(Lib.Shell32, ExactSpelling = true, SetLastError = false)] + [PInvokeData("Shobjidl.h", MSDNShortId = "bb776441")] + public static extern void ILFree(IntPtr pidl); /// Returns the size, in bytes, of an SHITEMID structure. /// A pointer to an SHITEMID structure.