File: Windows.Win32.PInvokeCore.OLEAUT32.dll.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
{

	/// <content>
	/// Contains extern methods from "OLEAUT32.dll".
	/// </content>
	internal static partial class PInvokeCore
	{
		/// <summary>Deallocates a string allocated previously by SysAllocString, SysAllocStringByteLen, SysReAllocString, SysAllocStringLen, or SysReAllocStringLen.</summary>
		/// <param name="bstrString">The previously allocated string. If this parameter is <b>NULL</b>, the function simply returns.</param>
		/// <remarks>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleauto/nf-oleauto-sysfreestring">Learn more about this API from docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("OLEAUT32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		internal static extern void SysFreeString(winmdroot.Foundation.BSTR bstrString);

		/// <inheritdoc cref="LoadRegTypeLib(global::System.Guid*, ushort, ushort, uint, winmdroot.System.Com.ITypeLib**)"/>
		internal static unsafe winmdroot.Foundation.HRESULT LoadRegTypeLib(in global::System.Guid rguid, ushort wVerMajor, ushort wVerMinor, uint lcid, winmdroot.System.Com.ITypeLib** pptlib)
		{
			fixed (global::System.Guid* rguidLocal = &rguid)
			{
				winmdroot.Foundation.HRESULT __result = PInvokeCore.LoadRegTypeLib(rguidLocal, wVerMajor, wVerMinor, lcid, pptlib);
				return __result;
			}
		}

		/// <summary>Uses registry information to load a type library.</summary>
		/// <param name="rguid">The GUID of the library.</param>
		/// <param name="wVerMajor">The major version of the library.</param>
		/// <param name="wVerMinor">The minor version of the library.</param>
		/// <param name="lcid">The national language code of the library.</param>
		/// <param name="pptlib">The loaded type library.</param>
		/// <returns>
		/// <para>This function can return one of these values. </para>
		/// <para>This doc was truncated.</para>
		/// </returns>
		/// <remarks>
		/// <para>The function <b>LoadRegTypeLib</b> defers to <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-loadtypelib">LoadTypeLib</a> to load the file.</para>
		/// <para><b>LoadRegTypeLib</b> compares the requested version numbers against those found in the system registry, and takes one of the following actions:</para>
		/// <para></para>
		/// <para>This doc was truncated.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleauto/nf-oleauto-loadregtypelib#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("OLEAUT32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		internal static extern unsafe winmdroot.Foundation.HRESULT LoadRegTypeLib(global::System.Guid* rguid, ushort wVerMajor, ushort wVerMinor, uint lcid, winmdroot.System.Com.ITypeLib** pptlib);

		/// <inheritdoc cref="OleCreatePictureIndirect(winmdroot.System.Ole.PICTDESC*, global::System.Guid*, winmdroot.Foundation.BOOL, void**)"/>
		[SupportedOSPlatform("windows5.0")]
		internal static unsafe winmdroot.Foundation.HRESULT OleCreatePictureIndirect(in winmdroot.System.Ole.PICTDESC lpPictDesc, in global::System.Guid riid, winmdroot.Foundation.BOOL fOwn, out void* lplpvObj)
		{
			fixed (void** lplpvObjLocal = &lplpvObj)
			{
				fixed (global::System.Guid* riidLocal = &riid)
				{
					fixed (winmdroot.System.Ole.PICTDESC* lpPictDescLocal = &lpPictDesc)
					{
						winmdroot.Foundation.HRESULT __result = PInvokeCore.OleCreatePictureIndirect(lpPictDescLocal, riidLocal, fOwn, lplpvObjLocal);
						return __result;
					}
				}
			}
		}

		/// <summary>Creates a new picture object initialized according to a PICTDESC structure.</summary>
		/// <param name="lpPictDesc">Pointer to a caller-allocated structure containing the initial state of the picture. The specified structure can be <b>NULL</b> to create an uninitialized object, in the event the picture needs to initialize via <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-ipersiststream-load">IPersistStream::Load</a>.</param>
		/// <param name="riid">Reference to the identifier of the interface describing the type of interface pointer to return in <i>lplpvObj</i>.</param>
		/// <param name="fOwn">If <b>TRUE</b>, the picture object is to destroy its picture when the object is destroyed. If <b>FALSE</b>, the caller is responsible for destroying the picture.</param>
		/// <param name="lplpvObj">Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, this parameter contains the requested interface pointer on the newly created object. If the call is successful, the caller is responsible for calling <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">Release</a> through this interface pointer when the new object is no longer needed. If the call fails, the value is set to <b>NULL</b>.</param>
		/// <returns>
		/// <para>This function returns S_OK on success. Other possible values include the following. </para>
		/// <para>This doc was truncated.</para>
		/// </returns>
		/// <remarks>The <i>fOwn</i> parameter indicates whether the picture is to own the GDI picture handle for the picture it contains, so that the picture object will destroy its picture when the object itself is destroyed. The function returns an interface pointer to the new picture object specified by the caller in the <i>riid</i> parameter. A <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-queryinterface(q)">QueryInterface</a> is built into this call. The caller is responsible for calling <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">Release</a> through the interface pointer returned.</remarks>
		[DllImport("OLEAUT32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		[SupportedOSPlatform("windows5.0")]
		internal static extern unsafe winmdroot.Foundation.HRESULT OleCreatePictureIndirect(winmdroot.System.Ole.PICTDESC* lpPictDesc, global::System.Guid* riid, winmdroot.Foundation.BOOL fOwn, void** lplpvObj);

		/// <inheritdoc cref="SafeArrayCreate(winmdroot.System.Variant.VARENUM, uint, winmdroot.System.Com.SAFEARRAYBOUND*)"/>
		internal static unsafe winmdroot.System.Com.SAFEARRAY* SafeArrayCreate(winmdroot.System.Variant.VARENUM vt, uint cDims, in winmdroot.System.Com.SAFEARRAYBOUND rgsabound)
		{
			fixed (winmdroot.System.Com.SAFEARRAYBOUND* rgsaboundLocal = &rgsabound)
			{
				winmdroot.System.Com.SAFEARRAY* __result = PInvokeCore.SafeArrayCreate(vt, cDims, rgsaboundLocal);
				return __result;
			}
		}

		/// <summary>Creates a new array descriptor, allocates and initializes the data for the array, and returns a pointer to the new array descriptor.</summary>
		/// <param name="vt">The base type of the array (the VARTYPE of each element of the array). The VARTYPE is restricted to a subset of the variant types. Neither the VT_ARRAY nor the VT_BYREF flag can be set. VT_EMPTY and VT_NULL are not valid base types for the array. All other types are legal.</param>
		/// <param name="cDims">The number of dimensions in the array. The number cannot be changed after the array is created.</param>
		/// <param name="rgsabound">A vector of bounds (one for each dimension) to allocate for the array.</param>
		/// <returns>A safe array descriptor, or null if the array could not be created.</returns>
		/// <remarks>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleauto/nf-oleauto-safearraycreate">Learn more about this API from docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("OLEAUT32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		internal static extern unsafe winmdroot.System.Com.SAFEARRAY* SafeArrayCreate(winmdroot.System.Variant.VARENUM vt, uint cDims, winmdroot.System.Com.SAFEARRAYBOUND* rgsabound);

		/// <inheritdoc cref="SafeArrayCreateEx(winmdroot.System.Variant.VARENUM, uint, winmdroot.System.Com.SAFEARRAYBOUND*, void*)"/>
		internal static unsafe winmdroot.System.Com.SAFEARRAY* SafeArrayCreateEx(winmdroot.System.Variant.VARENUM vt, uint cDims, in winmdroot.System.Com.SAFEARRAYBOUND rgsabound, void* pvExtra)
		{
			fixed (winmdroot.System.Com.SAFEARRAYBOUND* rgsaboundLocal = &rgsabound)
			{
				winmdroot.System.Com.SAFEARRAY* __result = PInvokeCore.SafeArrayCreateEx(vt, cDims, rgsaboundLocal, pvExtra);
				return __result;
			}
		}

		/// <summary>Creates and returns a safe array descriptor from the specified VARTYPE, number of dimensions and bounds.</summary>
		/// <param name="vt">The base type or the VARTYPE of each element of the array. The FADF_RECORD flag can be set for a variant type VT_RECORD, The FADF_HAVEIID flag can be set for VT_DISPATCH or VT_UNKNOWN, and FADF_HAVEVARTYPE can be set for all other VARTYPEs.</param>
		/// <param name="cDims">The number of dimensions in the array.</param>
		/// <param name="rgsabound">A vector of bounds (one for each dimension) to allocate for the array.</param>
		/// <param name="pvExtra">the type information of the user-defined type, if you are creating a safe array of user-defined types. If the vt parameter is VT_RECORD, then <i>pvExtra</i> will be a pointer to an <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-irecordinfo">IRecordInfo</a> describing the record. If the <i>vt</i> parameter is VT_DISPATCH or VT_UNKNOWN, then <i>pvExtra</i> will contain a pointer to a GUID representing the type of interface being passed to the array.</param>
		/// <returns>A safe array descriptor, or null if the array could not be created.</returns>
		/// <remarks>If the VARTYPE is VT_RECORD then <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-safearraysetrecordinfo">SafeArraySetRecordInfo</a> is called. If the VARTYPE is VT_DISPATCH or VT_UNKNOWN then the elements of the array must contain interfaces of the same type. Part of the process of marshaling this array to other processes does include generating the proxy/stub code of the IID pointed to by the <i>pvExtra</i> parameter. To actually pass heterogeneous interfaces one will need to specify either IID_IUnknown or IID_IDispatch in <i>pvExtra</i> and provide some other means for the caller to identify how to query for the actual interface.</remarks>
		[DllImport("OLEAUT32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		internal static extern unsafe winmdroot.System.Com.SAFEARRAY* SafeArrayCreateEx(winmdroot.System.Variant.VARENUM vt, uint cDims, winmdroot.System.Com.SAFEARRAYBOUND* rgsabound, void* pvExtra);

		/// <summary>Destroys an existing array descriptor and all of the data in the array.</summary>
		/// <param name="psa">An array descriptor created by <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-safearraycreate">SafeArrayCreate</a>.</param>
		/// <returns>
		/// <para>This function can return one of these values. </para>
		/// <para>This doc was truncated.</para>
		/// </returns>
		/// <remarks>Safe arrays of variant will have the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-variantclear">VariantClear</a> function called on each member and safe arrays of BSTR will have the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-sysfreestring">SysFreeString</a> function called on each element. <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nf-oaidl-irecordinfo-recordclear">IRecordInfo::RecordClear</a> will be called to release object references and other values of a record without deallocating the record.</remarks>
		[DllImport("OLEAUT32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		internal static extern unsafe winmdroot.Foundation.HRESULT SafeArrayDestroy(winmdroot.System.Com.SAFEARRAY* psa);

		/// <inheritdoc cref="SafeArrayGetElement(winmdroot.System.Com.SAFEARRAY*, int*, void*)"/>
		internal static unsafe winmdroot.Foundation.HRESULT SafeArrayGetElement(winmdroot.System.Com.SAFEARRAY* psa, in int rgIndices, void* pv)
		{
			fixed (int* rgIndicesLocal = &rgIndices)
			{
				winmdroot.Foundation.HRESULT __result = PInvokeCore.SafeArrayGetElement(psa, rgIndicesLocal, pv);
				return __result;
			}
		}

		/// <summary>Retrieves a single element of the array.</summary>
		/// <param name="psa">An array descriptor created by <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-safearraycreate">SafeArrayCreate</a>.</param>
		/// <param name="rgIndices">A vector of indexes for each dimension of the array. The right-most (least significant) dimension is rgIndices[0]. The left-most dimension is stored at <c>rgIndices[psa-&gt;cDims – 1]</c>.</param>
		/// <param name="pv">The element of the array.</param>
		/// <returns>
		/// <para>This function can return one of these values. </para>
		/// <para>This doc was truncated.</para>
		/// </returns>
		/// <remarks>This function calls <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-safearraylock">SafeArrayLock</a> and <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-safearrayunlock">SafeArrayUnlock</a> automatically, before and after retrieving the element. The caller must provide a storage area of the correct size to receive the data. If the data element is a string, object, or variant, the function copies the element in the correct way.</remarks>
		[DllImport("OLEAUT32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		internal static extern unsafe winmdroot.Foundation.HRESULT SafeArrayGetElement(winmdroot.System.Com.SAFEARRAY* psa, int* rgIndices, void* pv);

		/// <summary>Retrieves the IRecordInfo interface of the UDT contained in the specified safe array.</summary>
		/// <param name="psa">An array descriptor created by <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-safearraycreate">SafeArrayCreate</a>.</param>
		/// <param name="prinfo">The <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oaidl/nn-oaidl-irecordinfo">IRecordInfo</a> interface.</param>
		/// <returns>
		/// <para>This function can return one of these values. </para>
		/// <para>This doc was truncated.</para>
		/// </returns>
		/// <remarks>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleauto/nf-oleauto-safearraygetrecordinfo">Learn more about this API from docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("OLEAUT32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		internal static extern unsafe winmdroot.Foundation.HRESULT SafeArrayGetRecordInfo(winmdroot.System.Com.SAFEARRAY* psa, winmdroot.System.Ole.IRecordInfo** prinfo);

		/// <inheritdoc cref="SafeArrayGetVartype(winmdroot.System.Com.SAFEARRAY*, winmdroot.System.Variant.VARENUM*)"/>
		internal static unsafe winmdroot.Foundation.HRESULT SafeArrayGetVartype(winmdroot.System.Com.SAFEARRAY* psa, out winmdroot.System.Variant.VARENUM pvt)
		{
			fixed (winmdroot.System.Variant.VARENUM* pvtLocal = &pvt)
			{
				winmdroot.Foundation.HRESULT __result = PInvokeCore.SafeArrayGetVartype(psa, pvtLocal);
				return __result;
			}
		}

		/// <summary>Gets the VARTYPE stored in the specified safe array.</summary>
		/// <param name="psa">An array descriptor created by <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-safearraycreate">SafeArrayCreate</a>.</param>
		/// <param name="pvt">The VARTYPE.</param>
		/// <returns>
		/// <para>This function can return one of these values. </para>
		/// <para>This doc was truncated.</para>
		/// </returns>
		/// <remarks>
		/// <para>If FADF_HAVEVARTYPE is set, <b>SafeArrayGetVartype</b> returns the VARTYPE stored in the array descriptor. If FADF_RECORD is set, it returns VT_RECORD; if FADF_DISPATCH is set, it returns VT_DISPATCH; and if FADF_UNKNOWN is set, it returns VT_UNKNOWN. <b>SafeArrayGetVartype</b> can fail to return VT_UNKNOWN for SAFEARRAY types that are based on <b>IUnknown</b>. Callers should additionally check whether the SAFEARRAY type's <b>fFeatures</b> field has the FADF_UNKNOWN flag set.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleauto/nf-oleauto-safearraygetvartype#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("OLEAUT32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		internal static extern unsafe winmdroot.Foundation.HRESULT SafeArrayGetVartype(winmdroot.System.Com.SAFEARRAY* psa, winmdroot.System.Variant.VARENUM* pvt);

		/// <summary>Increments the lock count of an array, and places a pointer to the array data in pvData of the array descriptor.</summary>
		/// <param name="psa">An array descriptor created by <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-safearraycreate">SafeArrayCreate</a>.</param>
		/// <returns>
		/// <para>This function can return one of these values. </para>
		/// <para>This doc was truncated.</para>
		/// </returns>
		/// <remarks>
		/// <para>The pointer in the array descriptor is valid until the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-safearrayunlock">SafeArrayUnlock</a> function is called. Calls to <b>SafeArrayLock</b> can be nested, in which case an equal number of calls to <b>SafeArrayUnlock</b> are required. An array cannot be deleted while it is locked.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleauto/nf-oleauto-safearraylock#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("OLEAUT32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		internal static extern unsafe winmdroot.Foundation.HRESULT SafeArrayLock(winmdroot.System.Com.SAFEARRAY* psa);

		/// <inheritdoc cref="SafeArrayPutElement(winmdroot.System.Com.SAFEARRAY*, int*, void*)"/>
		internal static unsafe winmdroot.Foundation.HRESULT SafeArrayPutElement(winmdroot.System.Com.SAFEARRAY* psa, in int rgIndices, void* pv)
		{
			fixed (int* rgIndicesLocal = &rgIndices)
			{
				winmdroot.Foundation.HRESULT __result = PInvokeCore.SafeArrayPutElement(psa, rgIndicesLocal, pv);
				return __result;
			}
		}

		/// <summary>Stores the data element at the specified location in the array.</summary>
		/// <param name="psa">An array descriptor created by <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-safearraycreate">SafeArrayCreate</a>.</param>
		/// <param name="rgIndices">A vector of indexes for each dimension of the array. The right-most (least significant) dimension is rgIndices[0]. The left-most dimension is stored at <c>rgIndices[psa-&gt;cDims – 1]</c>.</param>
		/// <param name="pv">The data to assign to the array. The variant types VT_DISPATCH, VT_UNKNOWN, and VT_BSTR are pointers, and do not require another level of indirection.</param>
		/// <returns>
		/// <para>This function can return one of these values. </para>
		/// <para>This doc was truncated.</para>
		/// </returns>
		/// <remarks>
		/// <para>This function automatically calls <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-safearraylock">SafeArrayLock</a> and <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-safearrayunlock">SafeArrayUnlock</a> before and after assigning the element. If the data element is a string, object, or variant, the function copies it correctly when the safe array is destroyed. If the existing element is a string, object, or variant, it is cleared correctly.  If the data element is a VT_DISPATCH or VT_UNKNOWN, <b>AddRef</b> is called to increment the object's reference count. <div class="alert"><b>Note</b>  Multiple locks can be on an array. Elements can be put into an array while the array is locked by other operations.</div> <div> </div> For an example that demonstrates calling <b>SafeArrayPutElement</b>, see the COM Fundamentals Lines sample (CLines::Add in Lines.cpp).</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleauto/nf-oleauto-safearrayputelement#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("OLEAUT32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		internal static extern unsafe winmdroot.Foundation.HRESULT SafeArrayPutElement(winmdroot.System.Com.SAFEARRAY* psa, int* rgIndices, void* pv);

		/// <summary>Decrements the lock count of an array so it can be freed or resized.</summary>
		/// <param name="psa">An array descriptor created by <a href="https://docs.microsoft.com/previous-versions/windows/desktop/api/oleauto/nf-oleauto-safearraycreate">SafeArrayCreate</a>.</param>
		/// <returns>
		/// <para>This function can return one of these values. </para>
		/// <para>This doc was truncated.</para>
		/// </returns>
		/// <remarks>This function is called after access to the data in an array is finished.</remarks>
		[DllImport("OLEAUT32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		internal static extern unsafe winmdroot.Foundation.HRESULT SafeArrayUnlock(winmdroot.System.Com.SAFEARRAY* psa);
	}
}