context: #define MCG_WINRT_SUPPORTED
  using Mcg.System;
  using System;
  using System.Collections.Generic;
  using System.Reflection;
  using System.Runtime.CompilerServices;
  using System.Runtime.InteropServices;
  using System.Runtime.InteropServices.WindowsRuntime;
  
  
  // -----------------------------------------------------------------------------------------------------------
  // 
  // WARNING: THIS SOURCE FILE IS FOR 64-BIT BUILDS ONLY!
  // 
  // MCG GENERATED CODE
  // 
  // This C# source file is generated by MCG and is added into the application at compile time to support interop features.
  // 
  // It has three primary components:
  // 
  // 1. Public type definitions with interop implementation used by this application including WinRT & COM data structures and P/Invokes.
  // 
  // 2. The 'McgInterop' class containing marshaling code that acts as a bridge from managed code to native code.
  // 
  // 3. The 'McgNative' class containing marshaling code and native type definitions that call into native code and are called by native code.
  // 
  // -----------------------------------------------------------------------------------------------------------
  // 
  // warning CS0067: The event 'event' is never used
  #pragma warning disable 67
  // warning CS0169: The field 'field' is never used
  #pragma warning disable 169
  // warning CS0649: Field 'field' is never assigned to, and will always have its default value 0
  #pragma warning disable 649
  // warning CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
  #pragma warning disable 1591
  // warning CS0108 'member1' hides inherited member 'member2'. Use the new keyword if hiding was intended.
  #pragma warning disable 108
  // warning CS0114 'member1' hides inherited member 'member2'.  To make the current method override that implementation, add the override keyword. Otherwise add the new keyword.
  #pragma warning disable 114
  // warning CS0659 'type' overrides Object.Equals but does not override GetHashCode.
  #pragma warning disable 659
  // warning CS0465 Introducing a 'Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor?
  #pragma warning disable 465
  // warning CS0028 'function declaration' has the wrong signature to be an entry point
  #pragma warning disable 28
  // warning CS0162 Unreachable code Detected
  #pragma warning disable 162
  // warning CS0628 new protected member declared in sealed class
  #pragma warning disable 628
  
  namespace McgInterop
  {
  	/// <summary>
  	/// P/Invoke class for module '[MRT]'
  	/// </summary>
  	public unsafe static partial class _MRT_
  	{
  		// Signature, RhWaitForPendingFinalizers, [fwd] [return] [Mcg.CodeGen.VoidReturnMarshaller] void__void, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] int__int, 
  		[global::System.Runtime.InteropServices.McgGeneratedMarshallingCode]
  		[global::System.Runtime.InteropServices.McgPInvokeMarshalStub("System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Runtime.RuntimeImports", "RhWaitForPendingFinalizers")]
  		[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
  		public static void RhWaitForPendingFinalizers(int allowReentrantWait)
  		{
  			// Marshalling
  			// Call to native method
  			global::McgInterop._MRT__PInvokes.RhWaitForPendingFinalizers(allowReentrantWait);
  			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
  			// Return
  		}
  
  		// Signature, RhCompatibleReentrantWaitAny, [fwd] [return] [Mcg.CodeGen.BlittableValueMarshaller] int__int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] int__int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] int__int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] int__int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] System_IntPtr___ptr__w64 int *, 
  		[global::System.Runtime.InteropServices.McgGeneratedMarshallingCode]
  		[global::System.Runtime.InteropServices.McgPInvokeMarshalStub("System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Runtime.RuntimeImports", "RhCompatibleReentrantWaitAny")]
  		[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
  		public static int RhCompatibleReentrantWaitAny(
  					int alertable, 
  					int timeout, 
  					int count, 
  					global::System.IntPtr* handles)
  		{
  			// Setup
  			int unsafe___value;
  			// Marshalling
  			// Call to native method
  			unsafe___value = global::McgInterop._MRT__PInvokes.RhCompatibleReentrantWaitAny(
  								alertable, 
  								timeout, 
  								count, 
  								((global::System.IntPtr*)handles)
  							);
  			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
  			// Return
  			return unsafe___value;
  		}
  
  		// Signature, _ecvt_s, [fwd] [return] [Mcg.CodeGen.VoidReturnMarshaller] void__void, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] byte___ptrunsigned char *, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] int__int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] double__double, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] int__int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] int___ptrint *, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] int___ptrint *, 
  		[global::System.Runtime.InteropServices.McgGeneratedMarshallingCode]
  		[global::System.Runtime.InteropServices.McgPInvokeMarshalStub("System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Runtime.RuntimeImports", "_ecvt_s")]
  		[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
  		public static void _ecvt_s(
  					byte* buffer, 
  					int sizeInBytes, 
  					double value, 
  					int count, 
  					int* dec, 
  					int* sign)
  		{
  			// Marshalling
  			// Call to native method
  			global::McgInterop._MRT__PInvokes._ecvt_s(
  								((byte*)buffer), 
  								sizeInBytes, 
  								value, 
  								count, 
  								((int*)dec), 
  								((int*)sign)
  							);
  			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
  			// Return
  		}
  
  		// Signature, memmove, [fwd] [return] [Mcg.CodeGen.VoidReturnMarshaller] void__void, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] byte___ptrunsigned char *, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] byte___ptrunsigned char *, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] ulong__unsigned __int64, 
  		[global::System.Runtime.InteropServices.McgGeneratedMarshallingCode]
  		[global::System.Runtime.InteropServices.McgPInvokeMarshalStub("System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Runtime.RuntimeImports", "memmove")]
  		[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
  		public static void memmove(
  					byte* dmem, 
  					byte* smem, 
  					ulong size)
  		{
  			// Marshalling
  			// Call to native method
  			global::McgInterop._MRT__PInvokes.memmove(
  								((byte*)dmem), 
  								((byte*)smem), 
  								size
  							);
  			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
  			// Return
  		}
  	}
  
  	/// <summary>
  	/// P/Invoke class for module 'api-ms-win-core-winrt-l1-1-0.dll'
  	/// </summary>
  	public unsafe static partial class api_ms_win_core_winrt_l1_1_0_dll
  	{
  		// Signature, RoInitialize, [fwd] [return] [Mcg.CodeGen.BlittableValueMarshaller] int__int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] uint__unsigned int, 
  		[global::System.Runtime.InteropServices.McgGeneratedMarshallingCode]
  		[global::System.Runtime.InteropServices.McgPInvokeMarshalStub("System.Private.WinRTInterop.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", "mincore+mincore_PInvokes", "RoInitialize")]
  		[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
  		public static int RoInitialize(uint initType)
  		{
  			// Setup
  			int unsafe___value;
  			// Marshalling
  			// Call to native method
  			unsafe___value = global::McgInterop.api_ms_win_core_winrt_l1_1_0_dll_PInvokes.RoInitialize(initType);
  			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
  			// Return
  			return unsafe___value;
  		}
  	}
  
  	/// <summary>
  	/// P/Invoke class for module 'api-ms-win-core-localization-l1-2-0.dll'
  	/// </summary>
  	public unsafe static partial class api_ms_win_core_localization_l1_2_0_dll
  	{
  		// Signature, IsValidLocaleName, [fwd] [return] [Mcg.CodeGen.BlittableValueMarshaller] int__int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] char___ptrwchar_t *, 
  		[global::System.Runtime.InteropServices.McgGeneratedMarshallingCode]
  		[global::System.Runtime.InteropServices.McgPInvokeMarshalStub("System.Private.WinRTInterop.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", "mincore+mincore_PInvokes", "IsValidLocaleName")]
  		[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
  		public static int IsValidLocaleName(char* lpLocaleName)
  		{
  			// Setup
  			int unsafe___value;
  			// Marshalling
  			// Call to native method
  			unsafe___value = global::McgInterop.api_ms_win_core_localization_l1_2_0_dll_PInvokes.IsValidLocaleName(((ushort*)lpLocaleName));
  			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
  			// Return
  			return unsafe___value;
  		}
  
  		// Signature, ResolveLocaleName, [fwd] [return] [Mcg.CodeGen.BlittableValueMarshaller] int__int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] char___ptrwchar_t *, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] char___ptrwchar_t *, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] int__int, 
  		[global::System.Runtime.InteropServices.McgGeneratedMarshallingCode]
  		[global::System.Runtime.InteropServices.McgPInvokeMarshalStub("System.Private.WinRTInterop.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", "mincore+mincore_PInvokes", "ResolveLocaleName")]
  		[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
  		public static int ResolveLocaleName(
  					char* lpNameToResolve, 
  					char* lpLocaleName, 
  					int cchLocaleName)
  		{
  			// Setup
  			int unsafe___value;
  			// Marshalling
  			// Call to native method
  			unsafe___value = global::McgInterop.api_ms_win_core_localization_l1_2_0_dll_PInvokes.ResolveLocaleName(
  								((ushort*)lpNameToResolve), 
  								((ushort*)lpLocaleName), 
  								cchLocaleName
  							);
  			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
  			// Return
  			return unsafe___value;
  		}
  
  		// Signature, GetCPInfoExW, [fwd] [return] [Mcg.CodeGen.BlittableValueMarshaller] int__int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] uint__unsigned int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] uint__unsigned int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] Interop_mincore_CPINFOEXW__System_Text_Encoding_CodePages___ptrInterop_mincore__CPINFOEXW__System_Text_Encoding_CodePages *, 
  		[global::System.Runtime.InteropServices.McgGeneratedMarshallingCode]
  		[global::System.Runtime.InteropServices.McgPInvokeMarshalStub("System.Text.Encoding.CodePages, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "Interop+mincore", "GetCPInfoExW")]
  		[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
  		public static int GetCPInfoExW(
  					uint CodePage, 
  					uint dwFlags, 
  					global::Interop.mincore.CPINFOEXW__System_Text_Encoding_CodePages* lpCPInfoEx)
  		{
  			// Setup
  			int unsafe___value;
  			// Marshalling
  			// Call to native method
  			unsafe___value = global::McgInterop.api_ms_win_core_localization_l1_2_0_dll_PInvokes.GetCPInfoExW(
  								CodePage, 
  								dwFlags, 
  								((global::Interop.mincore.CPINFOEXW__System_Text_Encoding_CodePages*)lpCPInfoEx)
  							);
  			global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
  			// Return
  			return unsafe___value;
  		}
  	}
  
  	/// <summary>
  	/// P/Invoke class for module 'api-ms-win-core-com-l1-1-0.dll'
  	/// </summary>
  	public unsafe static partial class api_ms_win_core_com_l1_1_0_dll
  	{
  		// Signature, CoCreateInstance, [fwd] [return] [Mcg.CodeGen.BlittableValueMarshaller] int__int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] byte___ptrunsigned char *, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] System_IntPtr____w64 int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] int__int, [fwd] [in] [Mcg.CodeGen.BlittableValueMarshaller] byte___ptrunsigned char *, [fwd] [out] [managedbyref] [nativebyref] [Mcg.CodeGen.BlittableValueMarshaller] System_IntPtr____w64 int, 
  		[global::System.Runtime.InteropServices.McgGeneratedMarshallingCode]
  		[global::System.Runtime.InteropServices.McgPInvokeMarshalStub("System.Private.StackTraceGenerator, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "Internal.StackTraceGenerator.StackTraceGenerator", "CoCreateInstance")]
  		[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
  		public static int CoCreateInstance(
  					byte* rclsid, 
  					global::System.IntPtr pUnkOuter, 
  					int dwClsContext, 
  					byte* riid, 
  
gt: 					out global::System.IntPtr ppv)