File: Windows.Win32.IUIAutomationPropertyChangedEventHandler.g.cs
Project: src\src\System.Windows.Forms.Primitives\src\System.Windows.Forms.Primitives.csproj (System.Windows.Forms.Primitives)
// ------------------------------------------------------------------------------
// <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.Accessibility
	{
		[Guid("40CD37D4-C756-4B0C-8C6F-BDDFEEB13B50")]
		[SupportedOSPlatform("windows6.1")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IUIAutomationPropertyChangedEventHandler
			:IVTable<IUIAutomationPropertyChangedEventHandler,IUIAutomationPropertyChangedEventHandler.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]<IUIAutomationPropertyChangedEventHandler*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IUIAutomationPropertyChangedEventHandler*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT HandlePropertyChangedEvent(IUIAutomationPropertyChangedEventHandler* pThis, winmdroot.UI.Accessibility.IUIAutomationElement* sender, winmdroot.UI.Accessibility.UIA_PROPERTY_ID propertyId, winmdroot.System.Variant.VARIANT newValue)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.HandlePropertyChangedEvent(sender, propertyId, newValue);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Handles a Microsoft UI Automation property-changed event.</summary>
			/// <param name="sender">
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement">IUIAutomationElement</a>*</b> A pointer to the element that raised the event.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationpropertychangedeventhandler-handlepropertychangedevent#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <param name="propertyId">
			/// <para>Type: <b>PROPERTYID</b> The identifier of the property whose value has changed. For a list of property IDs, see <a href="https://docs.microsoft.com/windows/desktop/WinAuto/uiauto-entry-propids">Property Identifiers</a>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationpropertychangedeventhandler-handlepropertychangedevent#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <param name="newValue">
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/oaidl/ns-oaidl-variant">VARIANT</a></b> The new property value.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationpropertychangedeventhandler-handlepropertychangedevent#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <returns>
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HRESULT</a></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 implemented by the application to handle events that it has subscribed to by using <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationclient/nf-uiautomationclient-iuiautomation-addpropertychangedeventhandler">AddPropertyChangedEventHandler</a>.</para>
			/// <para>Adjusting an event handler from within this method is not supported.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationpropertychangedeventhandler-handlepropertychangedevent#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void HandlePropertyChangedEvent(winmdroot.UI.Accessibility.IUIAutomationElement* sender, winmdroot.UI.Accessibility.UIA_PROPERTY_ID propertyId, winmdroot.System.Variant.VARIANT newValue)
			{
				((delegate *unmanaged [Stdcall]<IUIAutomationPropertyChangedEventHandler*,winmdroot.UI.Accessibility.IUIAutomationElement* ,winmdroot.UI.Accessibility.UIA_PROPERTY_ID ,winmdroot.System.Variant.VARIANT ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IUIAutomationPropertyChangedEventHandler*)Unsafe.AsPointer(ref this), sender, propertyId, newValue).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]<IUIAutomationPropertyChangedEventHandler*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

				internal delegate *unmanaged [Stdcall]<IUIAutomationPropertyChangedEventHandler*,winmdroot.UI.Accessibility.IUIAutomationElement* ,winmdroot.UI.Accessibility.UIA_PROPERTY_ID ,winmdroot.System.Variant.VARIANT ,winmdroot.Foundation.HRESULT> HandlePropertyChangedEvent_4;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->HandlePropertyChangedEvent_4 = &HandlePropertyChangedEvent;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{40cd37d4-c756-4b0c-8c6f-bddfeeb13b50}</value>
			internal static readonly Guid IID_Guid = new Guid(0x40CD37D4, 0xC756, 0x4B0C, 0x8C, 0x6F, 0xBD, 0xDF, 0xEE, 0xB1, 0x3B, 0x50);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0xD4,0x37,0xCD,0x40,0x56,0xC7,0x0C,0x4B,0x8C,0x6F,0xBD,0xDF,0xEE,0xB1,0x3B,0x50					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("40CD37D4-C756-4B0C-8C6F-BDDFEEB13B50"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows6.1")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT HandlePropertyChangedEvent(winmdroot.UI.Accessibility.IUIAutomationElement* sender, winmdroot.UI.Accessibility.UIA_PROPERTY_ID propertyId, winmdroot.System.Variant.VARIANT newValue);
			}
		}
	}
}