// ------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> // ------------------------------------------------------------------------------ #pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981,SYSLIB1092,CS3021,CS3019 using global::System; using global::System.Diagnostics; using global::System.Diagnostics.CodeAnalysis; using global::System.Runtime.CompilerServices; using global::System.Runtime.InteropServices; using global::System.Runtime.Versioning; using winmdroot = global::Windows.Win32; namespace Windows.Win32 { namespace UI.Shell { [Guid("43826D1E-E718-42EE-BC55-A1E261C37BFE")] [CLSCompliant(false)] [SupportedOSPlatform("windows5.1.2600")] [global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.287+85e3fa26dd.RR")] internal unsafe partial struct IShellItem :winmdroot.IVTable<IShellItem,IShellItem.Vtbl>,IComIID { /// <inheritdoc cref="QueryInterface(global::System.Guid*, void**)"/> [OverloadResolutionPriority(1)] internal unsafe winmdroot.Foundation.HRESULT QueryInterface(in global::System.Guid riid, out void* ppvObject) { fixed (void** ppvObjectLocal = &ppvObject) { fixed (global::System.Guid* riidLocal = &riid) { winmdroot.Foundation.HRESULT __result = this.QueryInterface(riidLocal, ppvObjectLocal); return __result; } } } public unsafe winmdroot.Foundation.HRESULT QueryInterface(global::System.Guid* riid, void** ppvObject) { return ((delegate *unmanaged [Stdcall]<IShellItem*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IShellItem*)Unsafe.AsPointer(ref this), riid, ppvObject); } public uint AddRef() { return ((delegate *unmanaged [Stdcall]<IShellItem*,uint>)lpVtbl[1])((IShellItem*)Unsafe.AsPointer(ref this)); } public uint Release() { return ((delegate *unmanaged [Stdcall]<IShellItem*,uint>)lpVtbl[2])((IShellItem*)Unsafe.AsPointer(ref this)); } /// <inheritdoc cref="BindToHandler(winmdroot.System.Com.IBindCtx*, global::System.Guid*, global::System.Guid*, void**)"/> [OverloadResolutionPriority(1)] internal unsafe void BindToHandler(winmdroot.System.Com.IBindCtx* pbc, in global::System.Guid bhid, in global::System.Guid riid, out void* ppv) { fixed (void** ppvLocal = &ppv) { fixed (global::System.Guid* riidLocal = &riid) { fixed (global::System.Guid* bhidLocal = &bhid) { this.BindToHandler(pbc, bhidLocal, riidLocal, ppvLocal); } } } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT BindToHandler(IShellItem* pThis, winmdroot.System.Com.IBindCtx* pbc, global::System.Guid* bhid, global::System.Guid* riid, void** ppv) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.BindToHandler(pbc, bhid, riid, ppv); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Binds to a handler for an item as specified by the handler ID value (BHID).</summary> /// <param name="pbc"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-ibindctx">IBindCtx</a>*</b> A pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-ibindctx">IBindCtx</a> interface on a bind context object. Used to pass optional parameters to the handler. The contents of the bind context are handler-specific. For example, when binding to <b>BHID_Stream</b>, the <a href="https://docs.microsoft.com/windows/desktop/Stg/stgm-constants">STGM</a> flags in the bind context indicate the mode of access desired (read or read/write).</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-bindtohandler#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="bhid">Type: <b>REFGUID</b></param> /// <param name="riid"> /// <para>Type: <b>REFIID</b> IID of the object type to retrieve.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-bindtohandler#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="ppv"> /// <para>Type: <b>void**</b> When this method returns, contains a pointer of type <i>riid</i> that is returned by the handler specified by <i>rbhid</i>.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-bindtohandler#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b>HRESULT</b> If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para> /// </returns> /// <remarks> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-bindtohandler">Learn more about this API from learn.microsoft.com</see>.</para> /// </remarks> public unsafe void BindToHandler(winmdroot.System.Com.IBindCtx* pbc, global::System.Guid* bhid, global::System.Guid* riid, void** ppv) { ((delegate *unmanaged [Stdcall]<IShellItem*,winmdroot.System.Com.IBindCtx* ,global::System.Guid* ,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IShellItem*)Unsafe.AsPointer(ref this), pbc, bhid, riid, ppv).ThrowOnFailure(); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetParent(IShellItem* pThis, winmdroot.UI.Shell.IShellItem** ppsi) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetParent(ppsi); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Gets the parent of an IShellItem object.</summary> /// <param name="ppsi"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitem">IShellItem</a>**</b> The address of a pointer to the parent of an <a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitem">IShellItem</a> interface.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-getparent#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b>HRESULT</b> Returns S_OK if successful, or an error value otherwise.</para> /// </returns> /// <remarks> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-getparent">Learn more about this API from learn.microsoft.com</see>.</para> /// </remarks> public unsafe void GetParent(winmdroot.UI.Shell.IShellItem** ppsi) { ((delegate *unmanaged [Stdcall]<IShellItem*,winmdroot.UI.Shell.IShellItem** ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IShellItem*)Unsafe.AsPointer(ref this), ppsi).ThrowOnFailure(); } /// <inheritdoc cref="GetDisplayName(winmdroot.UI.Shell.SIGDN, winmdroot.Foundation.PWSTR*)"/> [OverloadResolutionPriority(1)] internal unsafe void GetDisplayName(winmdroot.UI.Shell.SIGDN sigdnName, out winmdroot.Foundation.PWSTR ppszName) { fixed (winmdroot.Foundation.PWSTR* ppszNameLocal = &ppszName) { this.GetDisplayName(sigdnName, ppszNameLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetDisplayName(IShellItem* pThis, winmdroot.UI.Shell.SIGDN sigdnName, winmdroot.Foundation.PWSTR* ppszName) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetDisplayName(sigdnName, ppszName); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Gets the display name of the IShellItem object.</summary> /// <param name="sigdnName"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/ne-shobjidl_core-sigdn">SIGDN</a></b> One of the <a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/ne-shobjidl_core-sigdn">SIGDN</a> values that indicates how the name should look.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-getdisplayname#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="ppszName"> /// <para>Type: <b>LPWSTR*</b> A value that, when this function returns successfully, receives the address of a pointer to the retrieved display name.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-getdisplayname#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b>HRESULT</b> If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para> /// </returns> /// <remarks>It is the responsibility of the caller to free the string pointed to by <i>ppszName</i> when it is no longer needed. Call <a href="https://docs.microsoft.com/windows/desktop/api/combaseapi/nf-combaseapi-cotaskmemfree">CoTaskMemFree</a> on *<i>ppszName</i> to free the memory.</remarks> public unsafe void GetDisplayName(winmdroot.UI.Shell.SIGDN sigdnName, winmdroot.Foundation.PWSTR* ppszName) { ((delegate *unmanaged [Stdcall]<IShellItem*,winmdroot.UI.Shell.SIGDN ,winmdroot.Foundation.PWSTR* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IShellItem*)Unsafe.AsPointer(ref this), sigdnName, ppszName).ThrowOnFailure(); } /// <inheritdoc cref="GetAttributes(winmdroot.System.SystemServices.SFGAO_FLAGS, winmdroot.System.SystemServices.SFGAO_FLAGS*)"/> [OverloadResolutionPriority(1)] internal unsafe void GetAttributes(winmdroot.System.SystemServices.SFGAO_FLAGS sfgaoMask, out winmdroot.System.SystemServices.SFGAO_FLAGS psfgaoAttribs) { fixed (winmdroot.System.SystemServices.SFGAO_FLAGS* psfgaoAttribsLocal = &psfgaoAttribs) { this.GetAttributes(sfgaoMask, psfgaoAttribsLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetAttributes(IShellItem* pThis, winmdroot.System.SystemServices.SFGAO_FLAGS sfgaoMask, winmdroot.System.SystemServices.SFGAO_FLAGS* psfgaoAttribs) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetAttributes(sfgaoMask, psfgaoAttribs); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Gets a requested set of attributes of the IShellItem object.</summary> /// <param name="sfgaoMask"> /// <para>Type: <b>SFGAOF</b> Specifies the attributes to retrieve. One or more of the <a href="https://docs.microsoft.com/windows/desktop/shell/sfgao">SFGAO</a> values. Use a bitwise OR operator to determine the attributes to retrieve.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-getattributes#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="psfgaoAttribs"> /// <para>Type: <b>SFGAOF*</b> A pointer to a value that, when this method returns successfully, contains the requested attributes. One or more of the <a href="https://docs.microsoft.com/windows/desktop/shell/sfgao">SFGAO</a> values. Only those attributes specified by <i>sfgaoMask</i> are returned; other attribute values are undefined.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-getattributes#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b>HRESULT</b> Returns S_OK if the attributes returned exactly match those requested in <i>sfgaoMask</i>, S_FALSE if the attributes do not exactly match, or a standard COM error value otherwise.</para> /// </returns> /// <remarks> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-getattributes">Learn more about this API from learn.microsoft.com</see>.</para> /// </remarks> public unsafe void GetAttributes(winmdroot.System.SystemServices.SFGAO_FLAGS sfgaoMask, winmdroot.System.SystemServices.SFGAO_FLAGS* psfgaoAttribs) { ((delegate *unmanaged [Stdcall]<IShellItem*,winmdroot.System.SystemServices.SFGAO_FLAGS ,winmdroot.System.SystemServices.SFGAO_FLAGS* ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IShellItem*)Unsafe.AsPointer(ref this), sfgaoMask, psfgaoAttribs).ThrowOnFailure(); } /// <inheritdoc cref="Compare(winmdroot.UI.Shell.IShellItem*, uint, int*)"/> [OverloadResolutionPriority(1)] internal unsafe void Compare(winmdroot.UI.Shell.IShellItem* psi, uint hint, out int piOrder) { fixed (int* piOrderLocal = &piOrder) { this.Compare(psi, hint, piOrderLocal); } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT Compare(IShellItem* pThis, winmdroot.UI.Shell.IShellItem* psi, uint hint, int* piOrder) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.Compare(psi, hint, piOrder); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Compares two IShellItem objects.</summary> /// <param name="psi"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitem">IShellItem</a>*</b> A pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitem">IShellItem</a> object to compare with the existing <b>IShellItem</b> object.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-compare#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="hint"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/win32/api/shobjidl_core/ne-shobjidl_core-_sichintf">SICHINTF</a></b> One of the <a href="https://docs.microsoft.com/windows/win32/api/shobjidl_core/ne-shobjidl_core-_sichintf">SICHINTF</a> values that determines how to perform the comparison. See <b>SICHINTF</b> for the list of possible values for this parameter.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-compare#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="piOrder"> /// <para>Type: <b>int*</b> This parameter receives the result of the comparison. If the two items are the same this parameter equals zero; if they are different the parameter is nonzero.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-compare#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b>HRESULT</b> Returns S_OK if the items are the same, S_FALSE if they are different, or an error value otherwise.</para> /// </returns> /// <remarks> /// <para>The data type used in the second parameter, SICHINTF, is defined as:</para> /// <para></para> /// <para>This doc was truncated.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitem-compare#">Read more on learn.microsoft.com</see>.</para> /// </remarks> public unsafe void Compare(winmdroot.UI.Shell.IShellItem* psi, uint hint, int* piOrder) { ((delegate *unmanaged [Stdcall]<IShellItem*,winmdroot.UI.Shell.IShellItem* ,uint ,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IShellItem*)Unsafe.AsPointer(ref this), psi, hint, piOrder).ThrowOnFailure(); } internal unsafe global::Windows.Win32.Foundation.HRESULT QueryInterface<T>(out T* ppv) where T : unmanaged { Guid guid = typeof(T).GUID; void* pv; var hr = this.QueryInterface(&guid, &pv); if (hr.Succeeded) { ppv = (T*)pv; } else { ppv = null; } return hr; } internal struct Vtbl { internal delegate *unmanaged [Stdcall]<IShellItem*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1; internal delegate *unmanaged [Stdcall]<IShellItem*,uint> AddRef_2; internal delegate *unmanaged [Stdcall]<IShellItem*,uint> Release_3; internal delegate *unmanaged [Stdcall]<IShellItem*,winmdroot.System.Com.IBindCtx* ,global::System.Guid* ,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> BindToHandler_4; internal delegate *unmanaged [Stdcall]<IShellItem*,winmdroot.UI.Shell.IShellItem** ,winmdroot.Foundation.HRESULT> GetParent_5; internal delegate *unmanaged [Stdcall]<IShellItem*,winmdroot.UI.Shell.SIGDN ,winmdroot.Foundation.PWSTR* ,winmdroot.Foundation.HRESULT> GetDisplayName_6; internal delegate *unmanaged [Stdcall]<IShellItem*,winmdroot.System.SystemServices.SFGAO_FLAGS ,winmdroot.System.SystemServices.SFGAO_FLAGS* ,winmdroot.Foundation.HRESULT> GetAttributes_7; internal delegate *unmanaged [Stdcall]<IShellItem*,winmdroot.UI.Shell.IShellItem* ,uint ,int* ,winmdroot.Foundation.HRESULT> Compare_8; } public static void PopulateVTable(Vtbl* vtable) { vtable->BindToHandler_4 = &BindToHandler; vtable->GetParent_5 = &GetParent; vtable->GetDisplayName_6 = &GetDisplayName; vtable->GetAttributes_7 = &GetAttributes; vtable->Compare_8 = &Compare; } private void** lpVtbl; /// <summary>The IID guid for this interface.</summary> /// <value>{43826d1e-e718-42ee-bc55-a1e261c37bfe}</value> internal static readonly Guid IID_Guid = new Guid(0x43826D1E, 0xE718, 0x42EE, 0xBC, 0x55, 0xA1, 0xE2, 0x61, 0xC3, 0x7B, 0xFE); static ref readonly Guid IComIID.Guid { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { ReadOnlySpan<byte> data = new byte[] { 0x1E,0x6D,0x82,0x43,0x18,0xE7,0xEE,0x42,0xBC,0x55,0xA1,0xE2,0x61,0xC3,0x7B,0xFE }; return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data)); } } [Guid("43826D1E-E718-42EE-BC55-A1E261C37BFE"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()] [SupportedOSPlatform("windows5.1.2600")] internal interface Interface { [PreserveSig()] unsafe winmdroot.Foundation.HRESULT BindToHandler(winmdroot.System.Com.IBindCtx* pbc, global::System.Guid* bhid, global::System.Guid* riid, void** ppv); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT GetParent(winmdroot.UI.Shell.IShellItem** ppsi); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT GetDisplayName(winmdroot.UI.Shell.SIGDN sigdnName, winmdroot.Foundation.PWSTR* ppszName); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT GetAttributes(winmdroot.System.SystemServices.SFGAO_FLAGS sfgaoMask, winmdroot.System.SystemServices.SFGAO_FLAGS* psfgaoAttribs); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT Compare(winmdroot.UI.Shell.IShellItem* psi, uint hint, int* piOrder); } } } }