File: Windows.Win32.SAFEARRAY.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 System.Com
	{
		/// <summary>Represents a safe array.</summary>
		/// <remarks>
		/// <para>The array <b>rgsabound</b> is stored with the left-most dimension in rgsabound[0] and the right-most dimension in <c>rgsabound[cDims - 1]</c>. If an array was specified in a C-like syntax as a [2][5], it would have two elements in the <b>rgsabound</b> vector. Element 0 has an <b>lLbound</b> of 0 and a <b>cElements</b> of 2. Element 1 has an <b>lLbound</b> of 0 and a <b>cElements</b> of 5.</para>
		/// <para>The <b>fFeatures</b> flags describe attributes of an array that can affect how the array is released. The <b>fFeatures</b> field describes what type of data is stored in the <b>SAFEARRAY</b> and how the array is allocated. This allows freeing the array without referencing its containing variant.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/oaidl/ns-oaidl-safearray#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal partial struct SAFEARRAY
		{
			/// <summary>The number of dimensions.</summary>
			internal ushort cDims;

			/// <summary>
			/// <para>Flags. </para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oaidl/ns-oaidl-safearray#members">Read more on docs.microsoft.com</see>.</para>
			/// </summary>
			internal winmdroot.System.Com.ADVANCED_FEATURE_FLAGS fFeatures;

			/// <summary>The size of an array element.</summary>
			internal uint cbElements;

			/// <summary>The number of times the array has been locked without a corresponding unlock.</summary>
			internal uint cLocks;

			/// <summary>The data.</summary>
			internal unsafe void* pvData;

			/// <summary>One bound for each dimension.</summary>
			internal global::Windows.Win32.VariableLengthInlineArray<winmdroot.System.Com.SAFEARRAYBOUND> rgsabound;

			/// <summary>Computes the amount of memory that must be allocated to store this struct, including the specified number of elements in the variable length inline array at the end.</summary>
			internal static unsafe int SizeOf(int count)
			{
				int v = sizeof(SAFEARRAY);
				if (count > 1)
					v +=checked((count - 1) * sizeof(winmdroot.System.Com.SAFEARRAYBOUND));
					else
						if (count < 0)
							throw new ArgumentOutOfRangeException();
				return v;
			}
		}
	}
}