File: Windows.Win32.IPerPropertyBrowsing.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 System.Ole
	{
		[Guid("376BD3AA-3845-101B-84ED-08002B2EC713")]
		[SupportedOSPlatform("windows5.0")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IPerPropertyBrowsing
			:IVTable<IPerPropertyBrowsing,IPerPropertyBrowsing.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]<IPerPropertyBrowsing*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IPerPropertyBrowsing*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetDisplayString(IPerPropertyBrowsing* pThis, int dispID, winmdroot.Foundation.BSTR* pBstr)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetDisplayString(dispID, pBstr);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves a text string describing the specified property.</summary>
			/// <param name="dispID">The dispatch identifier of the property whose display name is requested.</param>
			/// <param name="pBstr">A pointer to a variable that receives the display name for the property identified in <i>dispID</i>. The string is allocated by this method using <b>SysAllocString</b>. Upon return, the string is the responsibility of the caller, which must free it with <b>SysFreeString</b> when it is no longer needed.</param>
			/// <returns>
			/// <para>This method can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-iperpropertybrowsing-getdisplaystring">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetDisplayString(int dispID, winmdroot.Foundation.BSTR* pBstr)
			{
				return ((delegate *unmanaged [Stdcall]<IPerPropertyBrowsing*,int ,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IPerPropertyBrowsing*)Unsafe.AsPointer(ref this), dispID, pBstr);
			}

			/// <inheritdoc cref="MapPropertyToPage(int, global::System.Guid*)"/>
			internal unsafe winmdroot.Foundation.HRESULT MapPropertyToPage(int dispID, out global::System.Guid pClsid)
			{
				fixed (global::System.Guid* pClsidLocal = &pClsid)
				{
					winmdroot.Foundation.HRESULT __result = this.MapPropertyToPage(dispID, pClsidLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT MapPropertyToPage(IPerPropertyBrowsing* pThis, int dispID, global::System.Guid* pClsid)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.MapPropertyToPage(dispID, pClsid);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves the CLSID of the property page associated with the specified property.</summary>
			/// <param name="dispID">The dispatch identifier of the property.</param>
			/// <param name="pClsid">A pointer to the CLSID identifying the property page associated with the property specified by <i>dispID</i>. If this method fails, *<i>pClsid</i> is set to CLSID_NULL.</param>
			/// <returns>
			/// <para>This method can return the standard return values E_INVALIDARG and E_UNEXPECTED, as well as the following values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>The CLSID returned from this method can be passed to <a href="https://docs.microsoft.com/windows/desktop/api/olectl/nf-olectl-olecreatepropertyframeindirect">OleCreatePropertyFrameIndirect</a> to specify the initial page to display in the property sheet.</remarks>
			public unsafe winmdroot.Foundation.HRESULT MapPropertyToPage(int dispID, global::System.Guid* pClsid)
			{
				return ((delegate *unmanaged [Stdcall]<IPerPropertyBrowsing*,int ,global::System.Guid* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IPerPropertyBrowsing*)Unsafe.AsPointer(ref this), dispID, pClsid);
			}

			/// <inheritdoc cref="GetPredefinedStrings(int, winmdroot.System.Ole.CALPOLESTR*, winmdroot.System.Ole.CADWORD*)"/>
			internal unsafe winmdroot.Foundation.HRESULT GetPredefinedStrings(int dispID, out winmdroot.System.Ole.CALPOLESTR pCaStringsOut, out winmdroot.System.Ole.CADWORD pCaCookiesOut)
			{
				fixed (winmdroot.System.Ole.CADWORD* pCaCookiesOutLocal = &pCaCookiesOut)
				{
					fixed (winmdroot.System.Ole.CALPOLESTR* pCaStringsOutLocal = &pCaStringsOut)
					{
						winmdroot.Foundation.HRESULT __result = this.GetPredefinedStrings(dispID, pCaStringsOutLocal, pCaCookiesOutLocal);
						return __result;
					}
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetPredefinedStrings(IPerPropertyBrowsing* pThis, int dispID, winmdroot.System.Ole.CALPOLESTR* pCaStringsOut, winmdroot.System.Ole.CADWORD* pCaCookiesOut)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetPredefinedStrings(dispID, pCaStringsOut, pCaCookiesOut);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves an array description strings for the allowable values that the specified property can accept.</summary>
			/// <param name="dispID">The dispatch identifier of the property.</param>
			/// <param name="pCaStringsOut">A pointer to a caller-allocated, counted array structure that contains the element count and address of a method-allocated array of string pointers. This method also allocates memory for the string values containing the predefined names, and it stores the string pointers in the array. If the method fails, no memory is allocated, and the contents of the structure are undefined.</param>
			/// <param name="pCaCookiesOut">A pointer to the caller-allocated, counted array structure that contains the element count and address of a method-allocated array of <b>DWORD</b> values. The values in the array can be passed to <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-iperpropertybrowsing-getpredefinedvalue">IPerPropertyBrowsing::GetPredefinedValue</a> to retrieve the value associated with the name in the same array position inside <i>pCaStringsOut</i>. If the method fails, no memory is allocated, and the contents of the structure are undefined.</param>
			/// <returns>
			/// <para>This method can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>Each string returned in the array pointed to by <i>pCaStringsOut</i> has a matching token in the counted array pointed to by <i>pCaCookiesOut</i>, where the token can be passed to <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-iperpropertybrowsing-getpredefinedvalue">IPerPropertyBrowsing::GetPredefinedValue</a> to get the actual value (a <b>VARIANT</b>) corresponding to the string. Using the predefined strings, a caller can obtain a list of strings for populating user interface elements, such as a drop-down listbox. When the end user selects one of these strings as a value to assign to a property, the caller can then obtain the corresponding value through <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-iperpropertybrowsing-getpredefinedvalue">IPerPropertyBrowsing::GetPredefinedValue</a>. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> Both the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/ns-ocidl-calpolestr">CALPOLESTR</a> and <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/ns-ocidl-cadword">CADWORD</a> structures passed to this method are caller-allocated. The caller is responsible for freeing each string pointed to from the <b>CALPOLESTR</b> array as well as the <b>CALPOLESTR</b> structure. All memory is allocated with <a href="https://docs.microsoft.com/windows/desktop/api/combaseapi/nf-combaseapi-cotaskmemalloc">CoTaskMemAlloc</a>. The caller is responsible for freeing the strings and the array with <a href="https://docs.microsoft.com/windows/desktop/api/combaseapi/nf-combaseapi-cotaskmemfree">CoTaskMemFree</a>. Upon return from this method, the caller is responsible for all this memory and must free it when it is no longer needed. Code to achieve this appears as follows.</para>
			/// <para></para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-iperpropertybrowsing-getpredefinedstrings#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetPredefinedStrings(int dispID, winmdroot.System.Ole.CALPOLESTR* pCaStringsOut, winmdroot.System.Ole.CADWORD* pCaCookiesOut)
			{
				return ((delegate *unmanaged [Stdcall]<IPerPropertyBrowsing*,int ,winmdroot.System.Ole.CALPOLESTR* ,winmdroot.System.Ole.CADWORD* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IPerPropertyBrowsing*)Unsafe.AsPointer(ref this), dispID, pCaStringsOut, pCaCookiesOut);
			}

			/// <inheritdoc cref="GetPredefinedValue(int, uint, winmdroot.System.Variant.VARIANT*)"/>
			internal unsafe winmdroot.Foundation.HRESULT GetPredefinedValue(int dispID, uint dwCookie, out winmdroot.System.Variant.VARIANT pVarOut)
			{
				fixed (winmdroot.System.Variant.VARIANT* pVarOutLocal = &pVarOut)
				{
					winmdroot.Foundation.HRESULT __result = this.GetPredefinedValue(dispID, dwCookie, pVarOutLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetPredefinedValue(IPerPropertyBrowsing* pThis, int dispID, uint dwCookie, winmdroot.System.Variant.VARIANT* pVarOut)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetPredefinedValue(dispID, dwCookie, pVarOut);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves the value of the specified property that is associated with a predefined string name.</summary>
			/// <param name="dispID">The dispatch identifier of the property for which a predefined value is requested.</param>
			/// <param name="dwCookie">A token identifying which value to return. The token was previously returned in the <i>pCaCookiesOut</i> array filled by <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-iperpropertybrowsing-getpredefinedstrings">GetPredefinedStrings</a>.</param>
			/// <param name="pVarOut">A pointer to the <b>VARIANT</b> value for the property.</param>
			/// <returns>
			/// <para>This method can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following values. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> The caller is responsible for freeing any allocations contained in the <b>VARIANT</b>. Unless the <b>vt</b> member of <b>VARIANT</b> is VT_VARIANT, the caller can free memory using a single call to <b>VariantClear</b>. Otherwise, the caller must recursively free the contained <b>VARIANT</b> values before freeing the outer <b>VARIANT</b>. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> Support for predefined names and values is not required. If your object does not support these names, return E_NOTIMPL from this method. If this method is not implemented, <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-iperpropertybrowsing-getpredefinedstrings">IPerPropertyBrowsing::GetPredefinedStrings</a> must not be implemented either. This method allocates any memory needed inside the <b>VARIANT</b>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-iperpropertybrowsing-getpredefinedvalue#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetPredefinedValue(int dispID, uint dwCookie, winmdroot.System.Variant.VARIANT* pVarOut)
			{
				return ((delegate *unmanaged [Stdcall]<IPerPropertyBrowsing*,int ,uint ,winmdroot.System.Variant.VARIANT* ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IPerPropertyBrowsing*)Unsafe.AsPointer(ref this), dispID, dwCookie, pVarOut);
			}

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

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

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

				internal delegate *unmanaged [Stdcall]<IPerPropertyBrowsing*,int ,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT> GetDisplayString_4;

				internal delegate *unmanaged [Stdcall]<IPerPropertyBrowsing*,int ,global::System.Guid* ,winmdroot.Foundation.HRESULT> MapPropertyToPage_5;

				internal delegate *unmanaged [Stdcall]<IPerPropertyBrowsing*,int ,winmdroot.System.Ole.CALPOLESTR* ,winmdroot.System.Ole.CADWORD* ,winmdroot.Foundation.HRESULT> GetPredefinedStrings_6;

				internal delegate *unmanaged [Stdcall]<IPerPropertyBrowsing*,int ,uint ,winmdroot.System.Variant.VARIANT* ,winmdroot.Foundation.HRESULT> GetPredefinedValue_7;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->GetDisplayString_4 = &GetDisplayString;
				vtable->MapPropertyToPage_5 = &MapPropertyToPage;
				vtable->GetPredefinedStrings_6 = &GetPredefinedStrings;
				vtable->GetPredefinedValue_7 = &GetPredefinedValue;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{376bd3aa-3845-101b-84ed-08002b2ec713}</value>
			internal static readonly Guid IID_Guid = new Guid(0x376BD3AA, 0x3845, 0x101B, 0x84, 0xED, 0x08, 0x00, 0x2B, 0x2E, 0xC7, 0x13);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0xAA,0xD3,0x6B,0x37,0x45,0x38,0x1B,0x10,0x84,0xED,0x08,0x00,0x2B,0x2E,0xC7,0x13					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("376BD3AA-3845-101B-84ED-08002B2EC713"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.0")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetDisplayString(int dispID, winmdroot.Foundation.BSTR* pBstr);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT MapPropertyToPage(int dispID, global::System.Guid* pClsid);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetPredefinedStrings(int dispID, winmdroot.System.Ole.CALPOLESTR* pCaStringsOut, winmdroot.System.Ole.CADWORD* pCaCookiesOut);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetPredefinedValue(int dispID, uint dwCookie, winmdroot.System.Variant.VARIANT* pVarOut);
			}
		}
	}
}