|
// ------------------------------------------------------------------------------
// <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
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("2659B475-EEB8-48B7-8F07-B378810F48CF")]
[SupportedOSPlatform("windows6.0.6000")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IShellItemFilter
:IVTable<IShellItemFilter,IShellItemFilter.Vtbl>,IComIID {
/// <inheritdoc cref="QueryInterface(global::System.Guid*, void**)"/>
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]<IShellItemFilter*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IShellItemFilter*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IShellItemFilter*,uint>)lpVtbl[1])((IShellItemFilter*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IShellItemFilter*,uint>)lpVtbl[2])((IShellItemFilter*)Unsafe.AsPointer(ref this));
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT IncludeItem(IShellItemFilter* pThis, winmdroot.UI.Shell.IShellItem* psi)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.IncludeItem(psi);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Sets a given Shell item status to inclusion in the view.</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 the <a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitem">Shell item</a> that is to be included in the view.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitemfilter-includeitem#parameters">Read more on docs.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>The host calls this method for each item in the folder. Returns S_OK to have the item enumerated for inclusion in the view. Returns S_FALSE to prevent the item from being enumerated for inclusion in the view.</remarks>
public unsafe void IncludeItem(winmdroot.UI.Shell.IShellItem* psi)
{
((delegate *unmanaged [Stdcall]<IShellItemFilter*,winmdroot.UI.Shell.IShellItem* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IShellItemFilter*)Unsafe.AsPointer(ref this), psi).ThrowOnFailure();
}
/// <inheritdoc cref="GetEnumFlagsForItem(winmdroot.UI.Shell.IShellItem*, uint*)"/>
internal unsafe void GetEnumFlagsForItem(winmdroot.UI.Shell.IShellItem* psi, out uint pgrfFlags)
{
fixed (uint* pgrfFlagsLocal = &pgrfFlags)
{
this.GetEnumFlagsForItem(psi, pgrfFlagsLocal);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetEnumFlagsForItem(IShellItemFilter* pThis, winmdroot.UI.Shell.IShellItem* psi, uint* pgrfFlags)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetEnumFlagsForItem(psi, pgrfFlags);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Allows a client to specify which classes of objects in a Shell item should be enumerated for inclusion in the view.</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 the <a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitem">Shell item</a> for which the <a href="https://docs.microsoft.com/windows/win32/api/shobjidl_core/ne-shobjidl_core-_shcontf">SHCONTF</a> enum flags are to be retrieved.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitemfilter-getenumflagsforitem#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="pgrfFlags">
/// <para>Type: <b><a href="https://docs.microsoft.com/windows/win32/api/shobjidl_core/ne-shobjidl_core-_shcontf">SHCONTF</a>*</b> A pointer to the <a href="https://docs.microsoft.com/windows/win32/api/shobjidl_core/ne-shobjidl_core-_shcontf">SHCONTF</a> enum flags for the given <a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitem">Shell item</a> that specifies which classes of objects to enumerate for inclusion in the view.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellitemfilter-getenumflagsforitem#parameters">Read more on docs.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-ishellitemfilter-getenumflagsforitem">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void GetEnumFlagsForItem(winmdroot.UI.Shell.IShellItem* psi, uint* pgrfFlags)
{
((delegate *unmanaged [Stdcall]<IShellItemFilter*,winmdroot.UI.Shell.IShellItem* ,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IShellItemFilter*)Unsafe.AsPointer(ref this), psi, pgrfFlags).ThrowOnFailure();
}
internal unsafe global::Windows.Win32.Foundation.HRESULT QueryInterface<T>(out T* ppv)
where T : unmanaged
{
var hr = this.QueryInterface(typeof(T).GUID, out void* pv);
if (hr.Succeeded)
{
ppv = (T*)pv;
}
else
{
ppv = null;
}
return hr;
}
internal struct Vtbl
{
internal delegate *unmanaged [Stdcall]<IShellItemFilter*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IShellItemFilter*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IShellItemFilter*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IShellItemFilter*,winmdroot.UI.Shell.IShellItem* ,winmdroot.Foundation.HRESULT> IncludeItem_4;
internal delegate *unmanaged [Stdcall]<IShellItemFilter*,winmdroot.UI.Shell.IShellItem* ,uint* ,winmdroot.Foundation.HRESULT> GetEnumFlagsForItem_5;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->IncludeItem_4 = &IncludeItem;
vtable->GetEnumFlagsForItem_5 = &GetEnumFlagsForItem;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{2659b475-eeb8-48b7-8f07-b378810f48cf}</value>
internal static readonly Guid IID_Guid = new Guid(0x2659B475, 0xEEB8, 0x48B7, 0x8F, 0x07, 0xB3, 0x78, 0x81, 0x0F, 0x48, 0xCF);
static ref readonly Guid IComIID.Guid {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[] {
0x75,0xB4,0x59,0x26,0xB8,0xEE,0xB7,0x48,0x8F,0x07,0xB3,0x78,0x81,0x0F,0x48,0xCF };
return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
}
}
[Guid("2659B475-EEB8-48B7-8F07-B378810F48CF"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
[SupportedOSPlatform("windows6.0.6000")]
internal interface Interface
{
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT IncludeItem(winmdroot.UI.Shell.IShellItem* psi);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetEnumFlagsForItem(winmdroot.UI.Shell.IShellItem* psi, uint* pgrfFlags);
}
}
}
}
|