File: Windows.Win32.IVBFormat.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("9849FD60-3768-101B-8D72-AE6164FFE3CF")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IVBFormat
			:IVTable<IVBFormat,IVBFormat.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]<IVBFormat*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IVBFormat*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

			/// <inheritdoc cref="Format(winmdroot.System.Variant.VARIANT*, winmdroot.Foundation.BSTR, void*, ushort, int, short, ushort, ushort*)"/>
			internal unsafe void Format(ref winmdroot.System.Variant.VARIANT vData, winmdroot.Foundation.BSTR bstrFormat, void* lpBuffer, ushort cb, int lcid, short sFirstDayOfWeek, ushort sFirstWeekOfYear, ref ushort rcb)
			{
				fixed (ushort* rcbLocal = &rcb)
				{
					fixed (winmdroot.System.Variant.VARIANT* vDataLocal = &vData)
					{
						this.Format(vDataLocal, bstrFormat, lpBuffer, cb, lcid, sFirstDayOfWeek, sFirstWeekOfYear, rcbLocal);
					}
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Format(IVBFormat* pThis, winmdroot.System.Variant.VARIANT* vData, winmdroot.Foundation.BSTR bstrFormat, void* lpBuffer, ushort cb, int lcid, short sFirstDayOfWeek, ushort sFirstWeekOfYear, ushort* rcb)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.Format(vData, bstrFormat, lpBuffer, cb, lcid, sFirstDayOfWeek, sFirstWeekOfYear, rcb);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Formats a string according to a pattern.</summary>
			/// <param name="vData">Data to be formatted.</param>
			/// <param name="bstrFormat">Format string to be applied to the data.</param>
			/// <param name="lpBuffer">Pointer to result buffer.</param>
			/// <param name="cb">Length of result buffer.</param>
			/// <param name="lcid">Locale ID.</param>
			/// <param name="sFirstDayOfWeek">
			/// <para>Affects the 'w', FirstDayOfWeek, format result. </para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/vbinterf/nf-vbinterf-ivbformat-format#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <param name="sFirstWeekOfYear">
			/// <para>Affects the 'ww', FirstWeekOfYear, format result. </para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/vbinterf/nf-vbinterf-ivbformat-format#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <param name="rcb">Number of bytes copied to the result buffer.</param>
			/// <returns>
			/// <para>This method supports the standard return values <b>E_INVALIDARG</b>, <b>E_OUTOFMEMORY</b>, and <b>E_UNEXPECTED</b>, as well as the following:</para>
			/// </returns>
			/// <remarks>
			/// <para>When migrating a VBX control to an OLE control, <b>Format</b> replaces the Visual Basic <b>VBFormat</b>, which is no longer supported.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/vbinterf/nf-vbinterf-ivbformat-format#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void Format(winmdroot.System.Variant.VARIANT* vData, winmdroot.Foundation.BSTR bstrFormat, void* lpBuffer, ushort cb, int lcid, short sFirstDayOfWeek, ushort sFirstWeekOfYear, ushort* rcb)
			{
				((delegate *unmanaged [Stdcall]<IVBFormat*,winmdroot.System.Variant.VARIANT* ,winmdroot.Foundation.BSTR ,void* ,ushort ,int ,short ,ushort ,ushort* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IVBFormat*)Unsafe.AsPointer(ref this), vData, bstrFormat, lpBuffer, cb, lcid, sFirstDayOfWeek, sFirstWeekOfYear, rcb).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]<IVBFormat*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

				internal delegate *unmanaged [Stdcall]<IVBFormat*,winmdroot.System.Variant.VARIANT* ,winmdroot.Foundation.BSTR ,void* ,ushort ,int ,short ,ushort ,ushort* ,winmdroot.Foundation.HRESULT> Format_4;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->Format_4 = &Format;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{9849fd60-3768-101b-8d72-ae6164ffe3cf}</value>
			internal static readonly Guid IID_Guid = new Guid(0x9849FD60, 0x3768, 0x101B, 0x8D, 0x72, 0xAE, 0x61, 0x64, 0xFF, 0xE3, 0xCF);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0x60,0xFD,0x49,0x98,0x68,0x37,0x1B,0x10,0x8D,0x72,0xAE,0x61,0x64,0xFF,0xE3,0xCF					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("9849FD60-3768-101B-8D72-AE6164FFE3CF"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT Format(winmdroot.System.Variant.VARIANT* vData, winmdroot.Foundation.BSTR bstrFormat, void* lpBuffer, ushort cb, int lcid, short sFirstDayOfWeek, ushort sFirstWeekOfYear, ushort* rcb);
			}
		}
	}
}