File: Windows.Win32.IDragSourceHelper2.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("83E07D0D-0C5F-4163-BF1A-60B274051E40")]
		[SupportedOSPlatform("windows6.0.6000")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IDragSourceHelper2
			:IVTable<IDragSourceHelper2,IDragSourceHelper2.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]<IDragSourceHelper2*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IDragSourceHelper2*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

			/// <inheritdoc cref="InitializeFromBitmap(winmdroot.UI.Shell.SHDRAGIMAGE*, winmdroot.System.Com.IDataObject*)"/>
			internal unsafe winmdroot.Foundation.HRESULT InitializeFromBitmap(in winmdroot.UI.Shell.SHDRAGIMAGE pshdi, winmdroot.System.Com.IDataObject* pDataObject)
			{
				fixed (winmdroot.UI.Shell.SHDRAGIMAGE* pshdiLocal = &pshdi)
				{
					winmdroot.Foundation.HRESULT __result = this.InitializeFromBitmap(pshdiLocal, pDataObject);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT InitializeFromBitmap(IDragSourceHelper2* pThis, winmdroot.UI.Shell.SHDRAGIMAGE* pshdi, winmdroot.System.Com.IDataObject* pDataObject)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.InitializeFromBitmap(pshdi, pDataObject);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			public unsafe winmdroot.Foundation.HRESULT InitializeFromBitmap(winmdroot.UI.Shell.SHDRAGIMAGE* pshdi, winmdroot.System.Com.IDataObject* pDataObject)
			{
				return ((delegate *unmanaged [Stdcall]<IDragSourceHelper2*,winmdroot.UI.Shell.SHDRAGIMAGE* ,winmdroot.System.Com.IDataObject* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IDragSourceHelper2*)Unsafe.AsPointer(ref this), pshdi, pDataObject);
			}

			/// <inheritdoc cref="InitializeFromWindow(winmdroot.Foundation.HWND, global::System.Drawing.Point*, winmdroot.System.Com.IDataObject*)"/>
			internal unsafe winmdroot.Foundation.HRESULT InitializeFromWindow(winmdroot.Foundation.HWND hwnd, global::System.Drawing.Point? ppt, winmdroot.System.Com.IDataObject* pDataObject)
			{
				global::System.Drawing.Point pptLocal = ppt ?? default(global::System.Drawing.Point);
				winmdroot.Foundation.HRESULT __result = this.InitializeFromWindow(hwnd, ppt.HasValue ? &pptLocal : null, pDataObject);
				return __result;
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT InitializeFromWindow(IDragSourceHelper2* pThis, winmdroot.Foundation.HWND hwnd, [Optional] global::System.Drawing.Point* ppt, winmdroot.System.Com.IDataObject* pDataObject)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.InitializeFromWindow(hwnd, ppt, pDataObject);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			public unsafe winmdroot.Foundation.HRESULT InitializeFromWindow(winmdroot.Foundation.HWND hwnd, [Optional] global::System.Drawing.Point* ppt, winmdroot.System.Com.IDataObject* pDataObject)
			{
				return ((delegate *unmanaged [Stdcall]<IDragSourceHelper2*,winmdroot.Foundation.HWND ,global::System.Drawing.Point* ,winmdroot.System.Com.IDataObject* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IDragSourceHelper2*)Unsafe.AsPointer(ref this), hwnd, ppt, pDataObject);
			}

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

			/// <summary>Sets the characteristics of a drag-and-drop operation over an IDragSourceHelper object.</summary>
			/// <param name="dwFlags">
			/// <para>Type: <b>DWORD</b> The flags that determine the characteristics of a drag-and-drop operation over an <a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-idragsourcehelper">IDragSourceHelper</a> object.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/shobjidl/nf-shobjidl-idragsourcehelper2-setflags#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/nf-shobjidl-idragsourcehelper2-setflags">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT SetFlags(uint dwFlags)
			{
				return ((delegate *unmanaged [Stdcall]<IDragSourceHelper2*,uint ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IDragSourceHelper2*)Unsafe.AsPointer(ref this), dwFlags);
			}

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

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

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

				internal delegate *unmanaged [Stdcall]<IDragSourceHelper2*,winmdroot.UI.Shell.SHDRAGIMAGE* ,winmdroot.System.Com.IDataObject* ,winmdroot.Foundation.HRESULT> InitializeFromBitmap_4;

				internal delegate *unmanaged [Stdcall]<IDragSourceHelper2*,winmdroot.Foundation.HWND ,global::System.Drawing.Point* ,winmdroot.System.Com.IDataObject* ,winmdroot.Foundation.HRESULT> InitializeFromWindow_5;

				internal delegate *unmanaged [Stdcall]<IDragSourceHelper2*,uint ,winmdroot.Foundation.HRESULT> SetFlags_6;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->InitializeFromBitmap_4 = &InitializeFromBitmap;
				vtable->InitializeFromWindow_5 = &InitializeFromWindow;
				vtable->SetFlags_6 = &SetFlags;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{83e07d0d-0c5f-4163-bf1a-60b274051e40}</value>
			internal static readonly Guid IID_Guid = new Guid(0x83E07D0D, 0x0C5F, 0x4163, 0xBF, 0x1A, 0x60, 0xB2, 0x74, 0x05, 0x1E, 0x40);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0x0D,0x7D,0xE0,0x83,0x5F,0x0C,0x63,0x41,0xBF,0x1A,0x60,0xB2,0x74,0x05,0x1E,0x40					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("83E07D0D-0C5F-4163-BF1A-60B274051E40"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows6.0.6000")]
			internal interface Interface
				:winmdroot.UI.Shell.IDragSourceHelper.Interface			{
				[PreserveSig()]
				unsafe new winmdroot.Foundation.HRESULT InitializeFromBitmap(winmdroot.UI.Shell.SHDRAGIMAGE* pshdi, winmdroot.System.Com.IDataObject* pDataObject);

				[PreserveSig()]
				unsafe new winmdroot.Foundation.HRESULT InitializeFromWindow(winmdroot.Foundation.HWND hwnd, [Optional] global::System.Drawing.Point* ppt, winmdroot.System.Com.IDataObject* pDataObject);

								[PreserveSig()]
winmdroot.Foundation.HRESULT SetFlags(uint dwFlags);
			}
		}
	}
}