File: Windows.Win32.IDataObjectAsyncCapability.g.cs
Project: src\src\System.Private.Windows.Core\src\System.Private.Windows.Core.csproj (System.Private.Windows.Core)
// ------------------------------------------------------------------------------
// <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("3D8B0590-F691-11D2-8EA9-006097DF5BD4")]
		[SupportedOSPlatform("windows8.0")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IDataObjectAsyncCapability
			:IVTable<IDataObjectAsyncCapability,IDataObjectAsyncCapability.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]<IDataObjectAsyncCapability*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IDataObjectAsyncCapability*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

			public uint AddRef()
			{
				return ((delegate *unmanaged [Stdcall]<IDataObjectAsyncCapability*,uint>)lpVtbl[1])((IDataObjectAsyncCapability*)Unsafe.AsPointer(ref this));
			}

			public uint Release()
			{
				return ((delegate *unmanaged [Stdcall]<IDataObjectAsyncCapability*,uint>)lpVtbl[2])((IDataObjectAsyncCapability*)Unsafe.AsPointer(ref this));
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT SetAsyncMode(IDataObjectAsyncCapability* pThis, winmdroot.Foundation.BOOL fDoOpAsync)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.SetAsyncMode(fDoOpAsync);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Called by a drop source to specify whether the data object supports asynchronous data extraction.</summary>
			/// <param name="fDoOpAsync">
			/// <para>Type: <b>BOOL</b> <b>VARIANT_TRUE</b> if an asynchronous operation is supported; otherwise, <b>VARIANT_FALSE</b>. The default value is <b>VARIANT_FALSE</b>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shldisp/nf-shldisp-idataobjectasynccapability-setasyncmode#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>This method is called by the drop source to indicate that the data object supports asynchronous data extraction. Store the <i>fDoOpAsync</i> for later use by <a href="https://docs.microsoft.com/windows/desktop/api/shldisp/nf-shldisp-idataobjectasynccapability-getasyncmode">IDataObjectAsyncCapability::GetAsyncMode</a>. The drop target determines whether asynchronous data extraction is supported by calling <b>IDataObjectAsyncCapability::GetAsyncMode</b> to retrieve the <i>fDoOpAsync</i> value. If <i>fDoOpAsync</i> is set to <b>VARIANT_TRUE</b>, <b>SetAsyncMode</b> must call <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">IDataObjectAsyncCapability::AddRef</a>, and store the interface pointer for use by <a href="https://docs.microsoft.com/windows/desktop/api/shldisp/nf-shldisp-idataobjectasynccapability-endoperation">IDataObjectAsyncCapability::EndOperation</a>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shldisp/nf-shldisp-idataobjectasynccapability-setasyncmode#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT SetAsyncMode(winmdroot.Foundation.BOOL fDoOpAsync)
			{
				return ((delegate *unmanaged [Stdcall]<IDataObjectAsyncCapability*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IDataObjectAsyncCapability*)Unsafe.AsPointer(ref this), fDoOpAsync);
			}

			/// <inheritdoc cref="GetAsyncMode(winmdroot.Foundation.BOOL*)"/>
			internal unsafe winmdroot.Foundation.HRESULT GetAsyncMode(out winmdroot.Foundation.BOOL pfIsOpAsync)
			{
				fixed (winmdroot.Foundation.BOOL* pfIsOpAsyncLocal = &pfIsOpAsync)
				{
					winmdroot.Foundation.HRESULT __result = this.GetAsyncMode(pfIsOpAsyncLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetAsyncMode(IDataObjectAsyncCapability* pThis, winmdroot.Foundation.BOOL* pfIsOpAsync)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetAsyncMode(pfIsOpAsync);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Called by a drop target to determine whether the data object supports asynchronous data extraction.</summary>
			/// <param name="pfIsOpAsync">
			/// <para>Type: <b>BOOL*</b> <b>VARIANT_TRUE</b> if an asynchronous operation is supported; otherwise, <b>VARIANT_FALSE</b>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shldisp/nf-shldisp-idataobjectasynccapability-getasyncmode#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 purpose of this method is to give the drop target the value of the <a href="https://docs.microsoft.com/windows/desktop/api/shldisp/nf-shldisp-idataobjectasynccapability-setasyncmode">IDataObjectAsyncCapability::SetAsyncMode</a> method's <i>fDoOpAsync</i> parameter. This parameter is set to <b>VARIANT_FALSE</b> by default. If the data object supports asynchronous data extraction, it must call <b>IDataObjectAsyncCapability::SetAsyncMode</b> and set <i>fDoOpAsync</i> to <b>VARIANT_TRUE</b>.</remarks>
			public unsafe winmdroot.Foundation.HRESULT GetAsyncMode(winmdroot.Foundation.BOOL* pfIsOpAsync)
			{
				return ((delegate *unmanaged [Stdcall]<IDataObjectAsyncCapability*,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IDataObjectAsyncCapability*)Unsafe.AsPointer(ref this), pfIsOpAsync);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT StartOperation(IDataObjectAsyncCapability* pThis, [Optional] winmdroot.System.Com.IBindCtx* pbcReserved)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.StartOperation(pbcReserved);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Called by a drop target to indicate that asynchronous data extraction is starting.</summary>
			/// <param name="pbcReserved">
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-ibindctx">IBindCtx</a>*</b> Reserved. Set this value to <b>nullptr</b>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shldisp/nf-shldisp-idataobjectasynccapability-startoperation#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 drop target calls this method to notify the data object that asynchronous data extraction is starting. The method should store this information so that it can be returned by <a href="https://docs.microsoft.com/windows/desktop/api/shldisp/nf-shldisp-idataobjectasynccapability-inoperation">IDataObjectAsyncCapability::InOperation</a>. Once <b>StartOperation</b> has been called, the drop target returns the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-idroptarget-drop">IDropTarget::Drop</a> call as it would for normal synchronous data extraction.</remarks>
			public unsafe winmdroot.Foundation.HRESULT StartOperation([Optional] winmdroot.System.Com.IBindCtx* pbcReserved)
			{
				return ((delegate *unmanaged [Stdcall]<IDataObjectAsyncCapability*,winmdroot.System.Com.IBindCtx* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IDataObjectAsyncCapability*)Unsafe.AsPointer(ref this), pbcReserved);
			}

			/// <inheritdoc cref="InOperation(winmdroot.Foundation.BOOL*)"/>
			internal unsafe winmdroot.Foundation.HRESULT InOperation(out winmdroot.Foundation.BOOL pfInAsyncOp)
			{
				fixed (winmdroot.Foundation.BOOL* pfInAsyncOpLocal = &pfInAsyncOp)
				{
					winmdroot.Foundation.HRESULT __result = this.InOperation(pfInAsyncOpLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT InOperation(IDataObjectAsyncCapability* pThis, winmdroot.Foundation.BOOL* pfInAsyncOp)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.InOperation(pfInAsyncOp);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Called by the drop source to determine whether the target is extracting data asynchronously.</summary>
			/// <param name="pfInAsyncOp">
			/// <para>Type: <b>BOOL*</b> <b>VARIANT_TRUE</b> if data extraction is being handled asynchronously; otherwise, <b>VARIANT_FALSE</b>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shldisp/nf-shldisp-idataobjectasynccapability-inoperation#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>This method is called by the drop source after <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-dodragdrop">DoDragDrop</a> returns. The <i>pfInAsyncOp</i> parameter should be set to <b>VARIANT_TRUE</b> only if the drop target has called <a href="https://docs.microsoft.com/windows/desktop/api/shldisp/nf-shldisp-idataobjectasynccapability-startoperation">IDataObjectAsyncCapability::StartOperation</a>.</remarks>
			public unsafe winmdroot.Foundation.HRESULT InOperation(winmdroot.Foundation.BOOL* pfInAsyncOp)
			{
				return ((delegate *unmanaged [Stdcall]<IDataObjectAsyncCapability*,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IDataObjectAsyncCapability*)Unsafe.AsPointer(ref this), pfInAsyncOp);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT EndOperation(IDataObjectAsyncCapability* pThis, winmdroot.Foundation.HRESULT hResult, winmdroot.System.Com.IBindCtx* pbcReserved, uint dwEffects)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.EndOperation(hResult, pbcReserved, dwEffects);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Notifies the data object that the asynchronous data extraction has ended.</summary>
			/// <param name="hResult">
			/// <para>Type: <b>HRESULT</b> Indicates the outcome of the data extraction. Set this value to S_OK if successful, or a COM error code otherwise.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shldisp/nf-shldisp-idataobjectasynccapability-endoperation#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <param name="pbcReserved">
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-ibindctx">IBindCtx</a>*</b> Reserved. Set to <b>nullptr</b>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shldisp/nf-shldisp-idataobjectasynccapability-endoperation#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <param name="dwEffects">
			/// <para>Type: <b>DWORD</b> A <a href="https://docs.microsoft.com/windows/desktop/com/dropeffect-constants">DROPEFFECT</a> value that indicates the result of an optimized move. This should be the same value that would be passed to the data object as a CFSTR_PERFORMEDDROPEFFECT format with a normal data extraction operation.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shldisp/nf-shldisp-idataobjectasynccapability-endoperation#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><b>EndOperation</b> retrieves the <a href="https://docs.microsoft.com/windows/desktop/api/shldisp/nn-shldisp-idataobjectasynccapability">IDataObjectAsyncCapability</a> pointer stored by <a href="https://docs.microsoft.com/windows/desktop/api/shldisp/nf-shldisp-idataobjectasynccapability-setasyncmode">IDataObjectAsyncCapability::SetAsyncMode</a> and passes its parameter values to that interface's <b>IDataObjectAsyncCapability::EndOperation</b> method. <b>EndOperation</b> then releases the <b>IDataObjectAsyncCapability</b> pointer. <b>EndOperation</b> is also responsible for any associated clean-up operations. When finished, <b>EndOperation</b> should notify the drop source through a private interface.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shldisp/nf-shldisp-idataobjectasynccapability-endoperation#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT EndOperation(winmdroot.Foundation.HRESULT hResult, winmdroot.System.Com.IBindCtx* pbcReserved, uint dwEffects)
			{
				return ((delegate *unmanaged [Stdcall]<IDataObjectAsyncCapability*,winmdroot.Foundation.HRESULT ,winmdroot.System.Com.IBindCtx* ,uint ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IDataObjectAsyncCapability*)Unsafe.AsPointer(ref this), hResult, pbcReserved, dwEffects);
			}

			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]<IDataObjectAsyncCapability*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

				internal delegate *unmanaged [Stdcall]<IDataObjectAsyncCapability*,uint> AddRef_2;

				internal delegate *unmanaged [Stdcall]<IDataObjectAsyncCapability*,uint> Release_3;

				internal delegate *unmanaged [Stdcall]<IDataObjectAsyncCapability*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> SetAsyncMode_4;

				internal delegate *unmanaged [Stdcall]<IDataObjectAsyncCapability*,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT> GetAsyncMode_5;

				internal delegate *unmanaged [Stdcall]<IDataObjectAsyncCapability*,winmdroot.System.Com.IBindCtx* ,winmdroot.Foundation.HRESULT> StartOperation_6;

				internal delegate *unmanaged [Stdcall]<IDataObjectAsyncCapability*,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT> InOperation_7;

				internal delegate *unmanaged [Stdcall]<IDataObjectAsyncCapability*,winmdroot.Foundation.HRESULT ,winmdroot.System.Com.IBindCtx* ,uint ,winmdroot.Foundation.HRESULT> EndOperation_8;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->SetAsyncMode_4 = &SetAsyncMode;
				vtable->GetAsyncMode_5 = &GetAsyncMode;
				vtable->StartOperation_6 = &StartOperation;
				vtable->InOperation_7 = &InOperation;
				vtable->EndOperation_8 = &EndOperation;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{3d8b0590-f691-11d2-8ea9-006097df5bd4}</value>
			internal static readonly Guid IID_Guid = new Guid(0x3D8B0590, 0xF691, 0x11D2, 0x8E, 0xA9, 0x00, 0x60, 0x97, 0xDF, 0x5B, 0xD4);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0x90,0x05,0x8B,0x3D,0x91,0xF6,0xD2,0x11,0x8E,0xA9,0x00,0x60,0x97,0xDF,0x5B,0xD4					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("3D8B0590-F691-11D2-8EA9-006097DF5BD4"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows8.0")]
			internal interface Interface
			{
								[PreserveSig()]
winmdroot.Foundation.HRESULT SetAsyncMode(winmdroot.Foundation.BOOL fDoOpAsync);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetAsyncMode(winmdroot.Foundation.BOOL* pfIsOpAsync);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT StartOperation([Optional] winmdroot.System.Com.IBindCtx* pbcReserved);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT InOperation(winmdroot.Foundation.BOOL* pfInAsyncOp);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT EndOperation(winmdroot.Foundation.HRESULT hResult, winmdroot.System.Com.IBindCtx* pbcReserved, uint dwEffects);
			}
		}
	}
}