File: Windows.Win32.PInvoke.KERNEL32.dll.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
{

	/// <content>
	/// Contains extern methods from "KERNEL32.dll".
	/// </content>
	[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
	internal static partial class PInvoke
	{
		/// <inheritdoc cref="ActivateActCtx(winmdroot.Foundation.HANDLE, nuint*)"/>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe winmdroot.Foundation.BOOL ActivateActCtx(winmdroot.Foundation.HANDLE hActCtx, out nuint lpCookie)
		{
			fixed (nuint* lpCookieLocal = &lpCookie)
			{
				winmdroot.Foundation.BOOL __result = PInvoke.ActivateActCtx(hActCtx, lpCookieLocal);
				return __result;
			}
		}

		/// <summary>The ActivateActCtx function activates the specified activation context.</summary>
		/// <param name="hActCtx">
		/// <para>Handle to an <a href="https://docs.microsoft.com/windows/desktop/api/winbase/ns-winbase-actctxa">ACTCTX</a> structure that contains information on the activation context that is to be made active.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-activateactctx#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="lpCookie">Pointer to a <b>ULONG_PTR</b> that functions as a cookie, uniquely identifying a specific, activated activation context.</param>
		/// <returns>
		/// <para>If the function succeeds, it returns <b>TRUE</b>. Otherwise, it returns <b>FALSE</b>. This function sets errors that can be retrieved by calling <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>. For an example, see <a href="https://docs.microsoft.com/windows/desktop/Debug/retrieving-the-last-error-code">Retrieving the Last-Error Code</a>. For a complete list of error codes, see <a href="https://docs.microsoft.com/windows/desktop/Debug/system-error-codes">System Error Codes</a>.</para>
		/// </returns>
		/// <remarks>
		/// <para>The <i>lpCookie</i> parameter is later passed to <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-deactivateactctx">DeactivateActCtx</a>, which verifies the pairing of calls to <b>ActivateActCtx</b> and <b>DeactivateActCtx</b> and ensures that the appropriate activation context is being deactivated. This is done because the deactivation of activation contexts must occur in the reverse order of activation. The activation of activation contexts can be understood as pushing an activation context onto a stack of activation contexts. The activation context you activate through this function  redirects any binding to DLLs, window classes, COM servers, type libraries, and mutexes for any side-by-side APIs you call. The top item of an activation context stack is the active, default-activation context of the current thread. If a null activation context handle is pushed onto the stack, thereby activating it, the default settings in the original manifest override all activation contexts that are lower on the stack.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-activateactctx#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe winmdroot.Foundation.BOOL ActivateActCtx(winmdroot.Foundation.HANDLE hActCtx, nuint* lpCookie)
		{
			Marshal.SetLastSystemError(0);
			winmdroot.Foundation.BOOL __retVal = LocalExternFunction(hActCtx, lpCookie);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "ActivateActCtx"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern unsafe winmdroot.Foundation.BOOL LocalExternFunction(winmdroot.Foundation.HANDLE hActCtx, nuint* lpCookie);
		}

		/// <summary>Closes an open object handle.</summary>
		/// <param name="hObject">A valid handle to an open object.</param>
		/// <returns>
		/// <para>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>. If the application is running under a debugger,  the function will throw an exception if it receives either a  handle value that is not valid  or a pseudo-handle value. This can happen if you close a handle twice, or if you  call <b>CloseHandle</b> on a handle returned by the <a href="https://docs.microsoft.com/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea">FindFirstFile</a> function instead of calling the <a href="https://docs.microsoft.com/windows/desktop/api/fileapi/nf-fileapi-findclose">FindClose</a> function.</para>
		/// </returns>
		/// <remarks>
		/// <para>The <b>CloseHandle</b> function closes handles to the following objects: </para>
		/// <para>This doc was truncated.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/handleapi/nf-handleapi-closehandle#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[SupportedOSPlatform("windows5.0")]
		internal static winmdroot.Foundation.BOOL CloseHandle(winmdroot.Foundation.HANDLE hObject)
		{
			Marshal.SetLastSystemError(0);
			winmdroot.Foundation.BOOL __retVal = LocalExternFunction(hObject);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "CloseHandle"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern winmdroot.Foundation.BOOL LocalExternFunction(winmdroot.Foundation.HANDLE hObject);
		}

		/// <inheritdoc cref="CreateActCtx(winmdroot.System.ApplicationInstallationAndServicing.ACTCTXW*)"/>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe winmdroot.Foundation.HANDLE CreateActCtx(in winmdroot.System.ApplicationInstallationAndServicing.ACTCTXW pActCtx)
		{
			fixed (winmdroot.System.ApplicationInstallationAndServicing.ACTCTXW* pActCtxLocal = &pActCtx)
			{
				winmdroot.Foundation.HANDLE __result = PInvoke.CreateActCtx(pActCtxLocal);
				return __result;
			}
		}

		/// <summary>The CreateActCtx function creates an activation context. (Unicode)</summary>
		/// <param name="pActCtx">
		/// <para>Pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/winbase/ns-winbase-actctxa">ACTCTX</a> structure that contains information about the activation context to be created.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-createactctxw#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <returns>
		/// <para>If the function succeeds, it returns a handle to the returned activation context. Otherwise, it returns INVALID_HANDLE_VALUE. This function sets errors that can be retrieved by calling <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>. For an example, see <a href="https://docs.microsoft.com/windows/desktop/Debug/retrieving-the-last-error-code">Retrieving the Last-Error Code</a>. For a complete list of error codes, see <a href="https://docs.microsoft.com/windows/desktop/Debug/system-error-codes">System Error Codes</a>.</para>
		/// </returns>
		/// <remarks>
		/// <para>Set any undefined bits in <b>dwFlags</b> of <a href="https://docs.microsoft.com/windows/desktop/api/winbase/ns-winbase-actctxa">ACTCTX</a> to 0. If any undefined bits are not set to 0, the call to <b>CreateActCtx</b> that creates the activation context fails and returns an invalid parameter error code. The handle returned from <b>CreateActCtx</b> is passed in a call to <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-activateactctx">ActivateActCtx</a> to activate the context for the current thread.</para>
		/// <para>> [!NOTE] > The winbase.h header defines CreateActCtx as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see [Conventions for Function Prototypes](/windows/win32/intl/conventions-for-function-prototypes).</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-createactctxw#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe winmdroot.Foundation.HANDLE CreateActCtx(winmdroot.System.ApplicationInstallationAndServicing.ACTCTXW* pActCtx)
		{
			Marshal.SetLastSystemError(0);
			winmdroot.Foundation.HANDLE __retVal = LocalExternFunction(pActCtx);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "CreateActCtxW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern unsafe winmdroot.Foundation.HANDLE LocalExternFunction(winmdroot.System.ApplicationInstallationAndServicing.ACTCTXW* pActCtx);
		}

		/// <summary>The DeactivateActCtx function deactivates the activation context corresponding to the specified cookie.</summary>
		/// <param name="dwFlags">
		/// <para>Flags that indicate how the deactivation is to occur.</para>
		/// <para></para>
		/// <para>This doc was truncated.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-deactivateactctx#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="ulCookie">
		/// <para>The ULONG_PTR that was passed into the call to <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-activateactctx">ActivateActCtx</a>. This value is used as a cookie to identify a specific activated activation context.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-deactivateactctx#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <returns>
		/// <para>If the function succeeds, it returns <b>TRUE</b>. Otherwise, it returns <b>FALSE</b>. This function sets errors that can be retrieved by calling <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>. For an example, see <a href="https://docs.microsoft.com/windows/desktop/Debug/retrieving-the-last-error-code">Retrieving the Last-Error Code</a>. For a complete list of error codes, see <a href="https://docs.microsoft.com/windows/desktop/Debug/system-error-codes">System Error Codes</a>.</para>
		/// </returns>
		/// <remarks>The deactivation of activation contexts must occur in the reverse order of activation. It can be understood as popping an activation context from a stack.</remarks>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static winmdroot.Foundation.BOOL DeactivateActCtx(uint dwFlags, nuint ulCookie)
		{
			Marshal.SetLastSystemError(0);
			winmdroot.Foundation.BOOL __retVal = LocalExternFunction(dwFlags, ulCookie);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "DeactivateActCtx"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern winmdroot.Foundation.BOOL LocalExternFunction(uint dwFlags, nuint ulCookie);
		}

		/// <summary>Duplicates an object handle.</summary>
		/// <param name="hSourceProcessHandle">
		/// <para>A handle to the process with the handle to be duplicated.</para>
		/// <para>The handle must have the PROCESS_DUP_HANDLE access right. For more information, see <a href="https://docs.microsoft.com/windows/desktop/ProcThread/process-security-and-access-rights">Process Security and Access Rights</a>.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/handleapi/nf-handleapi-duplicatehandle#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="hSourceHandle">The handle to be duplicated. This is an open object handle that is valid in the context of the source process. For a list of objects whose handles can be duplicated, see the following Remarks section.</param>
		/// <param name="hTargetProcessHandle">
		/// <para>A handle to the process that is to receive the duplicated handle. The handle must have the PROCESS_DUP_HANDLE access right. This parameter is optional and can be specified as NULL if the **DUPLICATE_CLOSE_SOURCE** flag is set in _Options_.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/handleapi/nf-handleapi-duplicatehandle#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="lpTargetHandle">
		/// <para>A pointer to a variable that receives the duplicate handle. This handle value is valid in the context of the target process. If <i>hSourceHandle</i> is a pseudo handle returned by <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-getcurrentprocess">GetCurrentProcess</a> or <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-getcurrentthread">GetCurrentThread</a>, <b>DuplicateHandle</b> converts it to a real handle to a process or thread, respectively. If <i>lpTargetHandle</i> is <b>NULL</b>, the function duplicates the handle, but does not return the duplicate handle value to the caller. This behavior exists only for backward compatibility with previous versions of this function. You should not use this feature, as you will lose system resources until the target process terminates. This parameter is ignored if _hTargetProcessHandle_ is **NULL**.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/handleapi/nf-handleapi-duplicatehandle#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="dwDesiredAccess">
		/// <para>The access requested for the new handle. For the flags that can be specified for each object type, see the following Remarks section. This parameter is ignored if the <i>dwOptions</i> parameter specifies the DUPLICATE_SAME_ACCESS flag. Otherwise, the flags that can be specified depend on the type of object whose handle is to be duplicated. This parameter is ignored if _hTargetProcessHandle_ is **NULL**.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/handleapi/nf-handleapi-duplicatehandle#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="bInheritHandle">
		/// <para>A variable that indicates whether the handle is inheritable. If <b>TRUE</b>, the duplicate handle can be inherited by new processes created by the target process. If <b>FALSE</b>, the new handle cannot be inherited. This parameter is ignored if _hTargetProcessHandle_ is **NULL**.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/handleapi/nf-handleapi-duplicatehandle#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="dwOptions"></param>
		/// <returns>
		/// <para>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
		/// </returns>
		/// <remarks>
		/// <para>The duplicate handle refers to the same object as the original handle. Therefore, any changes to the object are reflected through both handles. For example, if you duplicate a file handle, the current file position is always the same for both handles. For  file handles to have different file positions, use the <a href="https://docs.microsoft.com/windows/desktop/api/fileapi/nf-fileapi-createfilea">CreateFile</a> function to create file handles that share access to the same file. <b>DuplicateHandle</b> can be called by either the source process or the target process (or a process that is both the source and target process). For example, a process can use <b>DuplicateHandle</b> to create a noninheritable duplicate of an inheritable handle, or a handle with different access than the original handle. The source process uses the <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-getcurrentprocess">GetCurrentProcess</a> function to get a handle to itself. This handle is a pseudo handle, but <b>DuplicateHandle</b> converts it to a real process handle. To get the target process handle, it may be necessary to use some form of interprocess communication (for example, a named pipe or shared memory) to communicate the process identifier to the source process. The source process can use this identifier in the <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-openprocess">OpenProcess</a> function to obtain a handle to the target process. If the process that calls <b>DuplicateHandle</b> is not also the target process, the source process must use interprocess communication to pass the value of the duplicate handle to the target process. <b>DuplicateHandle</b> can be used to duplicate a handle between a 32-bit process and a 64-bit process. The resulting handle is appropriately sized to work in the target process. For more information, see <a href="https://docs.microsoft.com/windows/desktop/WinProg64/process-interoperability">Process Interoperability</a>. <b>DuplicateHandle</b> can duplicate handles to the following types of objects. </para>
		/// <para>This doc was truncated.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/handleapi/nf-handleapi-duplicatehandle#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[SupportedOSPlatform("windows5.0")]
		internal static unsafe winmdroot.Foundation.BOOL DuplicateHandle(winmdroot.Foundation.HANDLE hSourceProcessHandle, winmdroot.Foundation.HANDLE hSourceHandle, winmdroot.Foundation.HANDLE hTargetProcessHandle, winmdroot.Foundation.HANDLE* lpTargetHandle, uint dwDesiredAccess, winmdroot.Foundation.BOOL bInheritHandle, winmdroot.Foundation.DUPLICATE_HANDLE_OPTIONS dwOptions)
		{
			Marshal.SetLastSystemError(0);
			winmdroot.Foundation.BOOL __retVal = LocalExternFunction(hSourceProcessHandle, hSourceHandle, hTargetProcessHandle, lpTargetHandle, dwDesiredAccess, bInheritHandle, dwOptions);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "DuplicateHandle"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern unsafe winmdroot.Foundation.BOOL LocalExternFunction(winmdroot.Foundation.HANDLE hSourceProcessHandle, winmdroot.Foundation.HANDLE hSourceHandle, winmdroot.Foundation.HANDLE hTargetProcessHandle, winmdroot.Foundation.HANDLE* lpTargetHandle, uint dwDesiredAccess, winmdroot.Foundation.BOOL bInheritHandle, winmdroot.Foundation.DUPLICATE_HANDLE_OPTIONS dwOptions);
		}

		/// <summary>The FormatMessageW (Unicode) function (winbase.h) formats a message string.</summary>
		/// <param name="dwFlags">
		/// <para>The formatting options, and how to interpret the <i>lpSource</i> parameter. The low-order byte of <i>dwFlags</i> specifies how the function handles line breaks in the output buffer. The low-order byte can also specify the maximum width of a formatted output line.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-formatmessagew#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="lpSource">
		/// <para>The location of the message definition. The type of this parameter depends upon the settings in the <i>dwFlags</i> parameter. </para>
		/// <para>This doc was truncated.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-formatmessagew#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="dwMessageId">
		/// <para>The message identifier for the requested message. This parameter is ignored if <i>dwFlags</i> includes <b>FORMAT_MESSAGE_FROM_STRING</b>.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-formatmessagew#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="dwLanguageId">
		/// <para>The <a href="https://docs.microsoft.com/windows/desktop/Intl/language-identifiers">language identifier</a> for the requested message. This parameter is ignored if <i>dwFlags</i> includes <b>FORMAT_MESSAGE_FROM_STRING</b>. If you pass a specific <b>LANGID</b> in this parameter, <b>FormatMessage</b> will return a message for that <b>LANGID</b> only. If the function cannot find a message for that <b>LANGID</b>, it sets Last-Error to <b>ERROR_RESOURCE_LANG_NOT_FOUND</b>. If you pass in zero, <b>FormatMessage</b> looks for a message for <b>LANGIDs</b> in the following order: </para>
		/// <para>This doc was truncated.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-formatmessagew#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="lpBuffer">
		/// <para>A pointer to a buffer that receives the null-terminated string that specifies the formatted message. If <i>dwFlags</i> includes <b>FORMAT_MESSAGE_ALLOCATE_BUFFER</b>, the function allocates a buffer using the <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-localalloc">LocalAlloc</a> function, and places the pointer to the buffer at the address specified in <i>lpBuffer</i>. This buffer cannot be larger than 64K bytes.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-formatmessagew#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="nSize">
		/// <para>If the <b>FORMAT_MESSAGE_ALLOCATE_BUFFER</b> flag is not set, this parameter specifies the size of the output buffer, in <b>TCHARs</b>. If <b>FORMAT_MESSAGE_ALLOCATE_BUFFER</b> is set, this parameter specifies the minimum number of <b>TCHARs</b> to allocate for an output buffer. The output buffer cannot be larger than 64K bytes.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-formatmessagew#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="Arguments">
		/// <para>An array of values that are used as insert values in the formatted message. A %1 in the format string indicates the first value in the <i>Arguments</i> array; a %2 indicates the second argument; and so on. The interpretation of each value depends on the formatting information associated with the insert in the message definition. The default is to treat each value as a pointer to a null-terminated string. By default, the <i>Arguments</i> parameter is of type <b>va_list*</b>, which is a language- and implementation-specific data type for describing a variable number of arguments. The state of the <b>va_list</b> argument is undefined upon return from the function. To use the <b>va_list</b> again, destroy the variable argument list pointer using <b>va_end</b> and reinitialize it with <b>va_start</b>. If you do not have a pointer of type <b>va_list*</b>, then specify the <b>FORMAT_MESSAGE_ARGUMENT_ARRAY</b> flag and pass a pointer to an array of <b>DWORD_PTR</b> values; those values are input to the message formatted as the insert values. Each insert must have a corresponding element in the array.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-formatmessagew#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <returns>
		/// <para>If the function succeeds, the return value is the number of <b>TCHARs</b> stored in the output buffer, excluding the terminating null character. If the function fails, the return value is zero. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
		/// </returns>
		/// <remarks>
		/// <para>Within the message text, several escape sequences are supported for dynamically formatting the message. These escape sequences and their meanings are shown in the following tables. All escape sequences start with the percent character (%). </para>
		/// <para>This doc was truncated.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-formatmessagew#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe uint FormatMessage(winmdroot.System.Diagnostics.Debug.FORMAT_MESSAGE_OPTIONS dwFlags, [Optional] void* lpSource, uint dwMessageId, uint dwLanguageId, winmdroot.Foundation.PWSTR lpBuffer, uint nSize, [Optional] sbyte** Arguments)
		{
			Marshal.SetLastSystemError(0);
			uint __retVal = LocalExternFunction(dwFlags, lpSource, dwMessageId, dwLanguageId, lpBuffer, nSize, Arguments);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "FormatMessageW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern unsafe uint LocalExternFunction(winmdroot.System.Diagnostics.Debug.FORMAT_MESSAGE_OPTIONS dwFlags, [Optional] void* lpSource, uint dwMessageId, uint dwLanguageId, winmdroot.Foundation.PWSTR lpBuffer, uint nSize, [Optional] sbyte** Arguments);
		}

		/// <summary>The GetCurrentActCtx function returns the handle to the active activation context of the calling thread.</summary>
		/// <param name="lphActCtx">
		/// <para>Pointer to the returned <a href="https://docs.microsoft.com/windows/desktop/api/winbase/ns-winbase-actctxa">ACTCTX</a> structure that contains information on the active activation context.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-getcurrentactctx#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <returns>
		/// <para>If the function succeeds, it returns <b>TRUE</b>. Otherwise, it returns <b>FALSE</b>. This function sets errors that can be retrieved by calling <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>. For an example, see <a href="https://docs.microsoft.com/windows/desktop/Debug/retrieving-the-last-error-code">Retrieving the Last-Error Code</a>. For a complete list of error codes, see <a href="https://docs.microsoft.com/windows/desktop/Debug/system-error-codes">System Error Codes</a>.</para>
		/// </returns>
		/// <remarks>The calling thread is responsible for releasing the handle of the returned activation context. This function can return a null handle if no activation contexts have been activated by this thread. This is not an error.</remarks>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe winmdroot.Foundation.BOOL GetCurrentActCtx(winmdroot.Foundation.HANDLE* lphActCtx)
		{
			Marshal.SetLastSystemError(0);
			winmdroot.Foundation.BOOL __retVal = LocalExternFunction(lphActCtx);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "GetCurrentActCtx"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern unsafe winmdroot.Foundation.BOOL LocalExternFunction(winmdroot.Foundation.HANDLE* lphActCtx);
		}

		/// <summary>Retrieves a pseudo handle for the current process.</summary>
		/// <returns>The return value is a pseudo handle to the current process.</returns>
		/// <remarks>
		/// <para>A pseudo handle is a special constant, currently (<b>HANDLE</b>)-1, that is interpreted as the current process handle. For compatibility with future operating systems, it is best to call <b>GetCurrentProcess</b> instead of hard-coding this constant value. The calling process can use a pseudo handle to specify its own process whenever a process handle is required. Pseudo handles are not inherited by child processes. This handle has the <b>PROCESS_ALL_ACCESS</b> access right to the process object. For more information, see <a href="https://docs.microsoft.com/windows/desktop/ProcThread/process-security-and-access-rights">Process Security and Access Rights</a>. <b>Windows Server 2003 and Windows XP:  </b>This handle has the maximum access allowed by the security descriptor of the process to the primary token of the process. A process can create a "real" handle to itself that is valid in the context of other processes, or that can be inherited by other processes, by specifying the pseudo handle as the source handle in a call to the <a href="https://docs.microsoft.com/windows/desktop/api/handleapi/nf-handleapi-duplicatehandle">DuplicateHandle</a> function. A process can also use the <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/nf-processthreadsapi-openprocess">OpenProcess</a> function to open a real handle to itself. The pseudo handle need not be closed when it is no longer needed. Calling the <a href="https://docs.microsoft.com/windows/desktop/api/handleapi/nf-handleapi-closehandle">CloseHandle</a> function with a pseudo handle has no effect. If the pseudo handle is duplicated by <a href="https://docs.microsoft.com/windows/desktop/api/handleapi/nf-handleapi-duplicatehandle">DuplicateHandle</a>, the duplicate handle must be closed.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentprocess#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("KERNEL32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		[SupportedOSPlatform("windows5.1.2600")]
		internal static extern winmdroot.Foundation.HANDLE GetCurrentProcess();

		/// <summary>Retrieves the process identifier of the calling process.</summary>
		/// <returns>The return value is the process identifier of the calling process.</returns>
		/// <remarks>Until the process terminates, the process identifier uniquely identifies the process throughout the system.</remarks>
		[DllImport("KERNEL32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		[SupportedOSPlatform("windows5.1.2600")]
		internal static extern uint GetCurrentProcessId();

		/// <summary>Retrieves a pseudo handle for the calling thread.</summary>
		/// <returns>The return value is a pseudo handle for the current thread.</returns>
		/// <remarks>
		/// <para>A pseudo handle is a special constant that is interpreted as the current thread handle. The calling thread can use this handle to specify itself whenever a thread handle is required. Pseudo handles are not inherited by child processes. This handle has the <b>THREAD_ALL_ACCESS</b> access right to the thread object. For more information, see <a href="https://docs.microsoft.com/windows/desktop/ProcThread/thread-security-and-access-rights">Thread Security and Access Rights</a>. <b>Windows Server 2003 and Windows XP:  </b>This handle has the maximum access allowed by the security descriptor of the thread to the primary token of the process. The function cannot be used by one thread to create a handle that can be used by other threads to refer to the first thread. The handle is always interpreted as referring to the thread that is using it. A thread can create a "real" handle to itself that can be used by other threads, or inherited by other processes, by specifying the pseudo handle as the source handle in a call to the <a href="https://docs.microsoft.com/windows/desktop/api/handleapi/nf-handleapi-duplicatehandle">DuplicateHandle</a> function. The pseudo handle need not be closed when it is no longer needed. Calling the <a href="https://docs.microsoft.com/windows/desktop/api/handleapi/nf-handleapi-closehandle">CloseHandle</a> function with this handle has no effect. If the pseudo handle is duplicated by <a href="https://docs.microsoft.com/windows/desktop/api/handleapi/nf-handleapi-duplicatehandle">DuplicateHandle</a>, the duplicate handle must be closed. Do not create a thread while impersonating a security context. The call will succeed, however the newly created thread will have reduced access rights to itself when calling <b>GetCurrentThread</b>. The access rights granted this thread will  be derived from the access rights the impersonated user has to the process.  Some access rights including <b>THREAD_SET_THREAD_TOKEN</b> and <b>THREAD_GET_CONTEXT</b> may not be present, leading to unexpected failures.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentthread#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("KERNEL32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		[SupportedOSPlatform("windows5.1.2600")]
		internal static extern winmdroot.Foundation.HANDLE GetCurrentThread();

		/// <inheritdoc cref="GetExitCodeThread(winmdroot.Foundation.HANDLE, uint*)"/>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe winmdroot.Foundation.BOOL GetExitCodeThread(winmdroot.Foundation.HANDLE hThread, out uint lpExitCode)
		{
			fixed (uint* lpExitCodeLocal = &lpExitCode)
			{
				winmdroot.Foundation.BOOL __result = PInvoke.GetExitCodeThread(hThread, lpExitCodeLocal);
				return __result;
			}
		}

		/// <summary>Retrieves the termination status of the specified thread.</summary>
		/// <param name="hThread">
		/// <para>A handle to the thread. The handle must have the <b>THREAD_QUERY_INFORMATION</b> or <b>THREAD_QUERY_LIMITED_INFORMATION</b> access right. For more information, see <a href="https://docs.microsoft.com/windows/desktop/ProcThread/thread-security-and-access-rights">Thread Security and Access Rights</a>. <b>Windows Server 2003 and Windows XP:  </b>The handle must have the <b>THREAD_QUERY_INFORMATION</b> access right.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodethread#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="lpExitCode">A pointer to a variable to receive the thread termination status. For more information, see Remarks.</param>
		/// <returns>
		/// <para>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
		/// </returns>
		/// <remarks>
		/// <para>This function returns immediately. If the specified thread has not terminated and the function succeeds, the status returned is <b>STILL_ACTIVE</b>. If the thread has terminated and the function succeeds, the status returned is one of the following values: </para>
		/// <para>This doc was truncated.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodethread#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe winmdroot.Foundation.BOOL GetExitCodeThread(winmdroot.Foundation.HANDLE hThread, uint* lpExitCode)
		{
			Marshal.SetLastSystemError(0);
			winmdroot.Foundation.BOOL __retVal = LocalExternFunction(hThread, lpExitCode);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "GetExitCodeThread"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern unsafe winmdroot.Foundation.BOOL LocalExternFunction(winmdroot.Foundation.HANDLE hThread, uint* lpExitCode);
		}

		/// <inheritdoc cref="GetLocaleInfoEx(winmdroot.Foundation.PCWSTR, uint, winmdroot.Foundation.PWSTR, int)"/>
		[SupportedOSPlatform("windows6.0.6000")]
		internal static unsafe int GetLocaleInfoEx(string lpLocaleName, uint LCType, winmdroot.Foundation.PWSTR lpLCData, int cchData)
		{
			fixed (char* lpLocaleNameLocal = lpLocaleName)
			{
				int __result = PInvoke.GetLocaleInfoEx(lpLocaleNameLocal, LCType, lpLCData, cchData);
				return __result;
			}
		}

		/// <summary>Retrieves information about a locale specified by name.Note  The application should call this function in preference to GetLocaleInfo if designed to run only on Windows Vista and later. Note  This function can retrieve data that changes between releases, for example, due to a custom locale. If your application must persist or transmit data, see Using Persistent Locale Data.</summary>
		/// <param name="lpLocaleName">
		/// <para>Pointer to a <a href="https://docs.microsoft.com/windows/desktop/Intl/locale-names">locale name</a>, or one of the following predefined values. </para>
		/// <para>This doc was truncated.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-getlocaleinfoex#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="LCType">
		/// <para>The locale information to retrieve. For possible values, see the "Constants Used in the LCType Parameter of GetLocaleInfo, GetLocaleInfoEx, and SetLocaleInfo" section in <a href="https://docs.microsoft.com/windows/desktop/Intl/locale-information-constants">Locale Information Constants</a>. Note that only one piece of locale information can be specified per call. The application can use the binary OR operator to combine <a href="https://docs.microsoft.com/windows/desktop/Intl/locale-return-constants">LOCALE_RETURN_NUMBER</a> with any other allowed constant. In this case, the function retrieves the value as a number instead of a string. The buffer that receives the value must be at least the length of a DWORD value, which is 2. <div class="alert"><b>Caution</b>  It is also possible to combine <a href="https://docs.microsoft.com/windows/desktop/Intl/locale-nouseroverride">LOCALE_NOUSEROVERRIDE</a> with any other constant. However, use of this constant is strongly discouraged. (Even without using the current user override, the data can differ from computer to computer, and custom locales can change the data. For example, even month or day names are subject to spelling reforms.)</div> <div> </div> If <i>LCType</i> is set to <a href="https://docs.microsoft.com/windows/desktop/Intl/locale-ioptionalcalendar">LOCALE_IOPTIONALCALENDAR</a>, the function retrieves only the first alternate calendar. <div class="alert"><b>Note</b>  To get all alternate calendars, the application should use <a href="https://docs.microsoft.com/windows/desktop/api/winnls/nf-winnls-enumcalendarinfoexa">EnumCalendarInfoEx</a>.</div> <div> </div> Starting with Windows Vista, your applications should not use <a href="https://docs.microsoft.com/windows/desktop/Intl/locale-ilanguage">LOCALE_ILANGUAGE</a> in the <i>LCType</i> parameter to avoid failure or retrieval of unexpected data. Instead, it is recommended for your applications to call <b>GetLocaleInfoEx</b>.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-getlocaleinfoex#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="lpLCData">Pointer to a buffer in which this function retrieves the requested locale information. This pointer is not used if <i>cchData</i> is set to 0.</param>
		/// <param name="cchData">Size, in characters, of the data buffer indicated by <i>lpLCData</i>. Alternatively, the application can set this parameter to 0. In this case, the function does not use the <i>lpLCData</i> parameter and returns the required buffer size, including the terminating null character.</param>
		/// <returns>
		/// <para>Returns the number of characters retrieved in the locale data buffer if successful and <i>cchData</i> is a nonzero value. If the function succeeds, <i>cchData</i> is nonzero, and <a href="https://docs.microsoft.com/windows/desktop/Intl/locale-return-constants">LOCALE_RETURN_NUMBER</a> is specified, the return value is the size of the integer retrieved in the data buffer, that is, 2. If the function succeeds and the value of <i>cchData</i> is 0, the return value is the required size, in characters including a null character, for the locale data buffer. The function returns 0 if it does not succeed. To get extended error information, the application can call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>, which can return one of the following error codes: </para>
		/// <para>This doc was truncated.</para>
		/// </returns>
		/// <remarks>
		/// <para>This function normally retrieves information in text format. If the information is a numeric value and the value of <i>LCType</i> is <a href="https://docs.microsoft.com/windows/desktop/Intl/locale-ilanguage">LOCALE_ILANGUAGE</a> or <a href="https://docs.microsoft.com/windows/desktop/Intl/locale-idefault-constants">LOCALE_IDEFAULTLANGUAGE</a>, this function retrieves strings containing hexadecimal numbers. Otherwise, the retrieved text for numeric information is a decimal number. There are two exceptions to this rule. First, the application can retrieve numeric values as integers by specifying <a href="https://docs.microsoft.com/windows/desktop/Intl/locale-return-constants">LOCALE_RETURN_NUMBER</a> in the <i>LCType</i> parameter. The second exception is that <a href="https://docs.microsoft.com/windows/desktop/Intl/locale-fontsignature">LOCALE_FONTSIGNATURE</a> behaves differently from all other locale information constants. The application must provide a data buffer of at least sizeof(LOCALESIGNATURE) bytes. On successful return from the function, the buffer is filled in as a <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/ns-wingdi-localesignature">LOCALESIGNATURE</a> structure. <div class="alert"><b>Note</b>  Even when the <i>LCType</i> parameter is specified as LOCALE_FONTSIGNATURE, <i>cchData</i> and the function return are still character counts. When an application calls <b>GetLocaleInfoEx</b> with <i>LCType</i> specified as LOCALE_FONTSIGNATURE, <i>cchData</i> can be safely specified as sizeof(LOCALESIGNATURE) / sizeof(WCHAR).</div> <div> </div> The following examples deal correctly with the buffer size for non-text values:</para>
		/// <para></para>
		/// <para>This doc was truncated.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winnls/nf-winnls-getlocaleinfoex#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[SupportedOSPlatform("windows6.0.6000")]
		internal static int GetLocaleInfoEx(winmdroot.Foundation.PCWSTR lpLocaleName, uint LCType, winmdroot.Foundation.PWSTR lpLCData, int cchData)
		{
			Marshal.SetLastSystemError(0);
			int __retVal = LocalExternFunction(lpLocaleName, LCType, lpLCData, cchData);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "GetLocaleInfoEx"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern int LocalExternFunction(winmdroot.Foundation.PCWSTR lpLocaleName, uint LCType, winmdroot.Foundation.PWSTR lpLCData, int cchData);
		}

		/// <summary>Retrieves the fully qualified path for the file that contains the specified module. The module must have been loaded by the current process. (Unicode)</summary>
		/// <param name="hModule">
		/// <para>A handle to the loaded module whose path is being requested. If this parameter is <b>NULL</b>, <b>GetModuleFileName</b> retrieves the path of the executable file of the current process. The <b>GetModuleFileName</b> function does not retrieve the path for modules  that were loaded using the <b>LOAD_LIBRARY_AS_DATAFILE</b> flag. For more information, see <a href="https://docs.microsoft.com/windows/desktop/api/libloaderapi/nf-libloaderapi-loadlibraryexa">LoadLibraryEx</a>.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="lpFilename">
		/// <para>A pointer to a buffer that receives the fully qualified path of the module. If the length of the path is less than the size that the <i>nSize</i> parameter specifies, the function succeeds and the path is returned as a null-terminated string. If the length of the path exceeds the size that  the <i>nSize</i> parameter specifies, the function succeeds and the string is truncated to <i>nSize</i>  characters including the terminating null character. <b>Windows XP:  </b>The string is truncated to <i>nSize</i> characters and is not null-terminated. The string returned will use the same format that was specified when the module was loaded. Therefore, the path can be a long or short file name, and can use the prefix "\\?\". For more information, see <a href="https://docs.microsoft.com/windows/desktop/FileIO/naming-a-file">Naming a File</a>.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="nSize">The size of the <i>lpFilename</i> buffer, in <b>TCHARs</b>.</param>
		/// <returns>
		/// <para>If the function succeeds, the return value is the length of the string that is copied to the buffer, in characters, not including the terminating null character. If the buffer is too small to hold the module name, the string is truncated to <i>nSize</i> characters including the terminating null character, the function returns <i>nSize</i>, and the function sets the last error to <b>ERROR_INSUFFICIENT_BUFFER</b>. <b>Windows XP:  </b>If the buffer is too small to hold the module name, the function returns <i>nSize</i> and the last error code is not modified. If <i>nSize</i> is zero, the return value is zero and the last error code is not modified. If the function fails, the return value is 0 (zero). To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
		/// </returns>
		/// <remarks>
		/// <para>If a DLL is loaded in two processes, its file name in one process may differ in case from its file name in the other process. The global variable <c>_pgmptr</c> is automatically initialized to the full path of the executable file, and can be used to retrieve the full path name of an executable file.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static uint GetModuleFileName(winmdroot.Foundation.HMODULE hModule, winmdroot.Foundation.PWSTR lpFilename, uint nSize)
		{
			Marshal.SetLastSystemError(0);
			uint __retVal = LocalExternFunction(hModule, lpFilename, nSize);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "GetModuleFileNameW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern uint LocalExternFunction(winmdroot.Foundation.HMODULE hModule, winmdroot.Foundation.PWSTR lpFilename, uint nSize);
		}

		/// <inheritdoc cref="GetModuleHandle(winmdroot.Foundation.PCWSTR)"/>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe winmdroot.Foundation.HMODULE GetModuleHandle(string lpModuleName)
		{
			fixed (char* lpModuleNameLocal = lpModuleName)
			{
				winmdroot.Foundation.HMODULE __result = PInvoke.GetModuleHandle(lpModuleNameLocal);
				return __result;
			}
		}

		/// <summary>Retrieves a module handle for the specified module. The module must have been loaded by the calling process. (Unicode)</summary>
		/// <param name="lpModuleName">
		/// <para>The name of the loaded module (either a .dll or .exe file). If the file name extension is omitted, the default library extension .dll is appended. The file name string can include a trailing point character (.) to indicate that the module name has no extension. The string does not have to specify a path. When specifying a path, be sure to use backslashes (\\), not forward slashes (/). The name is compared (case independently) to the names of modules currently mapped into the address space of the calling process.</para>
		/// <para>If this parameter is NULL, <b>GetModuleHandle</b> returns a handle to the file used to create the calling process (.exe file). The <b>GetModuleHandle</b> function does not retrieve handles for modules that were loaded using the <b>LOAD_LIBRARY_AS_DATAFILE</b> flag. For more information, see <a href="https://docs.microsoft.com/windows/desktop/api/libloaderapi/nf-libloaderapi-loadlibraryexa">LoadLibraryEx</a>.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandlew#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <returns>
		/// <para>If the function succeeds, the return value is a handle to the specified module. If the function fails, the return value is NULL. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
		/// </returns>
		/// <remarks>
		/// <para>The returned handle is not global or inheritable. It cannot be duplicated or used by another process. If <i>lpModuleName</i> does not include a path and there is more than one loaded module with the same base name and extension, you cannot predict which module handle will be returned. To work around this problem, you could specify a path, use <a href="https://docs.microsoft.com/windows/desktop/Msi/side-by-side-assemblies">side-by-side assemblies</a>, or use <a href="https://docs.microsoft.com/windows/desktop/api/libloaderapi/nf-libloaderapi-getmodulehandleexa">GetModuleHandleEx</a> to specify a memory location rather than a DLL name. The <b>GetModuleHandle</b> function returns a handle to a mapped module without incrementing its reference count. However, if this handle is passed to the <a href="https://docs.microsoft.com/windows/desktop/api/libloaderapi/nf-libloaderapi-freelibrary">FreeLibrary</a> function, the reference count of the mapped module will be decremented. Therefore, do not pass a handle returned by <b>GetModuleHandle</b> to the <b>FreeLibrary</b> function. Doing so can cause a DLL module to be unmapped prematurely. This function must be used carefully in a multithreaded application. There is no guarantee that the module handle remains valid between the time this function returns the handle and the time it is used. For example, suppose that a thread retrieves a module handle, but before it uses the handle, a second thread frees the module. If the system loads another module, it could reuse the module handle that was recently freed. Therefore, the first thread would have a handle to a different module  than the one intended.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandlew#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static winmdroot.Foundation.HMODULE GetModuleHandle(winmdroot.Foundation.PCWSTR lpModuleName)
		{
			Marshal.SetLastSystemError(0);
			winmdroot.Foundation.HMODULE __retVal = LocalExternFunction(lpModuleName);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "GetModuleHandleW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern winmdroot.Foundation.HMODULE LocalExternFunction(winmdroot.Foundation.PCWSTR lpModuleName);
		}

		/// <inheritdoc cref="GetProcAddress(winmdroot.Foundation.HMODULE, winmdroot.Foundation.PCSTR)"/>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe winmdroot.Foundation.FARPROC GetProcAddress(winmdroot.Foundation.HMODULE hModule, string lpProcName)
		{
			fixed (byte* lpProcNameLocal = lpProcName is object ? global::System.Text.Encoding.Default.GetBytes(lpProcName) : null)
			{
				winmdroot.Foundation.FARPROC __result = PInvoke.GetProcAddress(hModule, new winmdroot.Foundation.PCSTR (lpProcNameLocal));
				return __result;
			}
		}

		/// <summary>Retrieves the address of an exported function or variable from the specified dynamic-link library (DLL).</summary>
		/// <param name="hModule">
		/// <para>A handle to the DLL module that contains the function or variable. The <a href="https://docs.microsoft.com/windows/desktop/api/libloaderapi/nf-libloaderapi-loadlibrarya">LoadLibrary</a>, <a href="https://docs.microsoft.com/windows/desktop/api/libloaderapi/nf-libloaderapi-loadlibraryexa">LoadLibraryEx</a>, <a href="https://docs.microsoft.com/windows/desktop/api/winbase/nf-winbase-loadpackagedlibrary">LoadPackagedLibrary</a>, or <a href="https://docs.microsoft.com/windows/desktop/api/libloaderapi/nf-libloaderapi-getmodulehandlea">GetModuleHandle</a> function returns this handle. The <b>GetProcAddress</b> function does not retrieve addresses from modules that were loaded using the <b>LOAD_LIBRARY_AS_DATAFILE</b> flag. For more information, see <a href="https://docs.microsoft.com/windows/desktop/api/libloaderapi/nf-libloaderapi-loadlibraryexa">LoadLibraryEx</a>.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-getprocaddress#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="lpProcName">The function or variable name, or the function's ordinal value. If this parameter is an ordinal value, it must be in the low-order word; the high-order word must be zero.</param>
		/// <returns>
		/// <para>If the function succeeds, the return value is the address of the exported function or variable. If the function fails, the return value is NULL. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
		/// </returns>
		/// <remarks>
		/// <para>The spelling and case of a function name pointed to by <i>lpProcName</i> must be identical to that in the <b>EXPORTS</b> statement of the source DLL's module-definition (.def) file. The exported names of functions may differ from the names you use when calling these functions in your code. This difference is hidden by macros used in the SDK header files. For more information, see <a href="https://docs.microsoft.com/windows/desktop/Intl/conventions-for-function-prototypes">Conventions for Function Prototypes</a>. The <i>lpProcName</i> parameter can identify the DLL function by specifying an ordinal value associated with the function in the <b>EXPORTS</b> statement. <b>GetProcAddress</b> verifies that the specified ordinal is in the range 1 through the highest ordinal value exported in the .def file. The function then uses the ordinal as an index to read the function's address from a function table. If the .def file does not number the functions consecutively from 1 to <i>N</i> (where <i>N</i> is the number of exported functions), an error can occur where <b>GetProcAddress</b> returns an invalid, non-NULL address, even though there is no function with the specified ordinal. If the function might not exist in the DLL module—for example, if the function  is available only on Windows Vista but the application  might be running on Windows XP—specify the function by name rather than by ordinal value and design your application to handle the case when the function is not available, as shown in the following code fragment.</para>
		/// <para></para>
		/// <para>This doc was truncated.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-getprocaddress#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static winmdroot.Foundation.FARPROC GetProcAddress(winmdroot.Foundation.HMODULE hModule, winmdroot.Foundation.PCSTR lpProcName)
		{
			Marshal.SetLastSystemError(0);
			winmdroot.Foundation.FARPROC __retVal = LocalExternFunction(hModule, lpProcName);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "GetProcAddress"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern winmdroot.Foundation.FARPROC LocalExternFunction(winmdroot.Foundation.HMODULE hModule, winmdroot.Foundation.PCSTR lpProcName);
		}

		/// <inheritdoc cref="GetShortPathName(winmdroot.Foundation.PCWSTR, winmdroot.Foundation.PWSTR, uint)"/>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe uint GetShortPathName(string lpszLongPath, winmdroot.Foundation.PWSTR lpszShortPath, uint cchBuffer)
		{
			fixed (char* lpszLongPathLocal = lpszLongPath)
			{
				uint __result = PInvoke.GetShortPathName(lpszLongPathLocal, lpszShortPath, cchBuffer);
				return __result;
			}
		}

		/// <summary>Retrieves the short path form of the specified path. (GetShortPathNameW)</summary>
		/// <param name="lpszLongPath">
		/// <para>The path string. In the ANSI version of this function, the name is limited to <b>MAX_PATH</b> characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\\\?\\" to the path. For more information, see <a href="https://docs.microsoft.com/windows/desktop/FileIO/naming-a-file">Naming Files, Paths, and Namespaces</a>.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-getshortpathnamew#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="lpszShortPath">
		/// <para>A pointer to a buffer to receive the null-terminated short form of the path that <i>lpszLongPath</i> specifies. Passing <b>NULL</b> for this parameter and zero for <i>cchBuffer</i> will always return the required buffer size for a specified <i>lpszLongPath</i>.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-getshortpathnamew#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="cchBuffer">
		/// <para>The size of the buffer  that <i>lpszShortPath</i> points to, in <b>TCHARs</b>. Set this parameter to zero if <i>lpszShortPath</i> is set to <b>NULL</b>.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-getshortpathnamew#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <returns>
		/// <para>If the function succeeds, the return value is the length, in <b>TCHARs</b>, of the string that is copied to <i>lpszShortPath</i>, not including the terminating null character. If the <i>lpszShortPath</i> buffer is too small to contain the path, the return value is the size of the buffer, in <b>TCHARs</b>, that is required to hold the path and the terminating null character. If the function fails for any other reason, the return value is zero. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
		/// </returns>
		/// <remarks>
		/// <para>The path that the <i>lpszLongPath</i> parameter specifies does not have to be a full or long path. The short form can be longer than the specified path. If the return value is greater than the value specified in the <i>cchBuffer</i> parameter, you can call the function again with a buffer that is large enough to hold the path. For an example of this case in addition to using zero-length buffer for dynamic allocation, see the Example Code section. <div class="alert"><b>Note</b>  Although the return value in this case is a length that includes the terminating null character, the return value on success does not include the terminating null character in the count.</div> <div> </div> If the specified path is already in its short form  and conversion is not needed, the function simply copies the specified path to the buffer specified by the <i>lpszShortPath</i> parameter. You can set the <i>lpszShortPath</i> parameter to the same value as the <i>lpszLongPath</i> parameter; in other words, you can set the output buffer for the short path to the address of the input path string. Always ensure that the <i>cchBuffer</i> parameter accurately represents the total size, in <b>TCHARs</b>, of this buffer. You can obtain the long name of a file from the short name by calling the <a href="https://docs.microsoft.com/windows/desktop/api/fileapi/nf-fileapi-getlongpathnamea">GetLongPathName</a> function. Alternatively, where <b>GetLongPathName</b> is not available, you can call <a href="https://docs.microsoft.com/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea">FindFirstFile</a> on each component of the path to get the corresponding long name. It is possible to have access to a file or directory but not have access to some of the parent directories of that file or directory. As a result, <b>GetShortPathName</b> may fail when it is unable to query the parent directory of a path component  to determine the short name for that component. This check can be skipped for directory components that already meet the requirements of a short name. For more information, see the <a href="https://docs.microsoft.com/windows/desktop/FileIO/naming-a-file">Short vs. Long Names</a> section of <a href="https://docs.microsoft.com/windows/desktop/FileIO/naming-a-file">Naming Files, Paths, and Namespaces</a>. In Windows 8 and Windows Server 2012, this function is supported by the following technologies. </para>
		/// <para>This doc was truncated.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-getshortpathnamew#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static uint GetShortPathName(winmdroot.Foundation.PCWSTR lpszLongPath, winmdroot.Foundation.PWSTR lpszShortPath, uint cchBuffer)
		{
			Marshal.SetLastSystemError(0);
			uint __retVal = LocalExternFunction(lpszLongPath, lpszShortPath, cchBuffer);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "GetShortPathNameW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern uint LocalExternFunction(winmdroot.Foundation.PCWSTR lpszLongPath, winmdroot.Foundation.PWSTR lpszShortPath, uint cchBuffer);
		}

		/// <inheritdoc cref="GetStartupInfo(winmdroot.System.Threading.STARTUPINFOW*)"/>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe void GetStartupInfo(out winmdroot.System.Threading.STARTUPINFOW lpStartupInfo)
		{
			fixed (winmdroot.System.Threading.STARTUPINFOW* lpStartupInfoLocal = &lpStartupInfo)
			{
				PInvoke.GetStartupInfo(lpStartupInfoLocal);
			}
		}

		/// <summary>Retrieves the contents of the STARTUPINFO structure that was specified when the calling process was created.</summary>
		/// <param name="lpStartupInfo">
		/// <para>A pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/ns-processthreadsapi-startupinfoa">STARTUPINFO</a> structure that receives the startup information.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-getstartupinfow#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <remarks>The <a href="https://docs.microsoft.com/windows/desktop/api/processthreadsapi/ns-processthreadsapi-startupinfoa">STARTUPINFO</a> structure was specified by the process that created the calling process. It can be used to specify properties associated with the main window of the calling process.</remarks>
		[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "GetStartupInfoW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		[SupportedOSPlatform("windows5.1.2600")]
		internal static extern unsafe void GetStartupInfo(winmdroot.System.Threading.STARTUPINFOW* lpStartupInfo);

		/// <inheritdoc cref="GetSystemPowerStatus(winmdroot.System.Power.SYSTEM_POWER_STATUS*)"/>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe winmdroot.Foundation.BOOL GetSystemPowerStatus(out winmdroot.System.Power.SYSTEM_POWER_STATUS lpSystemPowerStatus)
		{
			fixed (winmdroot.System.Power.SYSTEM_POWER_STATUS* lpSystemPowerStatusLocal = &lpSystemPowerStatus)
			{
				winmdroot.Foundation.BOOL __result = PInvoke.GetSystemPowerStatus(lpSystemPowerStatusLocal);
				return __result;
			}
		}

		/// <summary>Retrieves the power status of the system. The status indicates whether the system is running on AC or DC power, whether the battery is currently charging, how much battery life remains, and if battery saver is on or off.</summary>
		/// <param name="lpSystemPowerStatus">
		/// <para>A pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/winbase/ns-winbase-system_power_status">SYSTEM_POWER_STATUS</a> structure that receives status information.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-getsystempowerstatus#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <returns>
		/// <para>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
		/// </returns>
		/// <remarks>
		/// <para>To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0400 or later. For more information, see <a href="https://docs.microsoft.com/windows/desktop/WinProg/using-the-windows-headers">Using the Windows Headers</a>.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-getsystempowerstatus#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe winmdroot.Foundation.BOOL GetSystemPowerStatus(winmdroot.System.Power.SYSTEM_POWER_STATUS* lpSystemPowerStatus)
		{
			Marshal.SetLastSystemError(0);
			winmdroot.Foundation.BOOL __retVal = LocalExternFunction(lpSystemPowerStatus);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "GetSystemPowerStatus"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern unsafe winmdroot.Foundation.BOOL LocalExternFunction(winmdroot.System.Power.SYSTEM_POWER_STATUS* lpSystemPowerStatus);
		}

		/// <summary>Retrieves the number of milliseconds that have elapsed since the system was started, up to 49.7 days.</summary>
		/// <returns>The return value is the number of milliseconds that have elapsed since the system was started.</returns>
		/// <remarks>
		/// <para>The resolution of the <b>GetTickCount</b> function is limited to the resolution of the system timer, which is typically in the range of  10 milliseconds to 16 milliseconds. The resolution of the <b>GetTickCount</b> function is not affected by adjustments made by the <a href="https://docs.microsoft.com/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimeadjustment">GetSystemTimeAdjustment</a> function. The elapsed time is stored as a <b>DWORD</b> value. Therefore, the time will wrap around to zero if the system is run continuously for 49.7 days. To avoid this problem, use the <a href="https://docs.microsoft.com/windows/desktop/api/sysinfoapi/nf-sysinfoapi-gettickcount64">GetTickCount64</a> function. Otherwise, check for an overflow condition when comparing times. If you need a higher resolution timer, use a <a href="https://docs.microsoft.com/windows/desktop/Multimedia/multimedia-timers">multimedia timer</a> or a <a href="https://docs.microsoft.com/windows/desktop/winmsg/about-timers">high-resolution timer</a>. To obtain the time elapsed since the computer was started, retrieve the System Up Time counter in the performance data in the registry key <b>HKEY_PERFORMANCE_DATA</b>. The value returned is an 8-byte value. For more information, see <a href="https://docs.microsoft.com/windows/desktop/PerfCtrs/performance-counters-portal">Performance Counters</a>. To obtain the time the system has spent in the working state since it was started, use the <a href="https://docs.microsoft.com/windows/desktop/api/realtimeapiset/nf-realtimeapiset-queryunbiasedinterrupttime">QueryUnbiasedInterruptTime</a> function. <div class="alert"><b>Note</b>  The <a href="https://docs.microsoft.com/windows/desktop/api/realtimeapiset/nf-realtimeapiset-queryunbiasedinterrupttime">QueryUnbiasedInterruptTime</a> function produces different results on debug ("checked") builds of Windows, because the interrupt-time count and tick count are advanced by approximately 49 days. This helps to identify bugs that might not occur until the system has been running for a long time. The checked build is available to MSDN subscribers through the <a href="https://msdn.microsoft.com/default.aspx">Microsoft Developer Network (MSDN)</a> Web site.</div> <div> </div></para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/sysinfoapi/nf-sysinfoapi-gettickcount#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("KERNEL32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		[SupportedOSPlatform("windows5.0")]
		internal static extern uint GetTickCount();

		/// <inheritdoc cref="LoadLibraryEx(winmdroot.Foundation.PCWSTR, winmdroot.Foundation.HANDLE, winmdroot.System.LibraryLoader.LOAD_LIBRARY_FLAGS)"/>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static unsafe winmdroot.Foundation.HMODULE LoadLibraryEx(string lpLibFileName, winmdroot.System.LibraryLoader.LOAD_LIBRARY_FLAGS dwFlags)
		{
			fixed (char* lpLibFileNameLocal = lpLibFileName)
			{
				winmdroot.Foundation.HMODULE __result = PInvoke.LoadLibraryEx(lpLibFileNameLocal, default, dwFlags);
				return __result;
			}
		}

		/// <summary>Loads the specified module into the address space of the calling process. (LoadLibraryExW)</summary>
		/// <param name="lpLibFileName">
		/// <para>A string that specifies the file name of the module to load. This name is not related to the name stored in a library module itself, as specified by the <b>LIBRARY</b> keyword in the module-definition (.def) file. The module can be a library module (a .dll file) or an executable module (an .exe file). If the specified module is an executable module, static imports are not loaded; instead, the module is loaded as if <b>DONT_RESOLVE_DLL_REFERENCES</b> was specified. See the <i>dwFlags</i> parameter for more information. If the string specifies a module name without a path and the file name extension is omitted, and the module name does not contain any point character (.), then the function appends the default library extension ".DLL" to the module name. To prevent the function from appending ".DLL" to the module name, include a trailing point character (.) in the module name string. If the string specifies a fully qualified path, the function searches only that path for the module. When specifying a path, be sure to use backslashes (\\), not forward slashes (/). For more information about paths, see <a href="https://docs.microsoft.com/windows/desktop/FileIO/naming-a-file">Naming Files, Paths, and Namespaces</a>. If the string specifies a module name without a path and more than one loaded module has the same base name and extension, the function returns a handle to the module that was loaded first. If the string specifies a module name without a path and a module of the same name is not already loaded, or if the string specifies a module name with a relative path, the function searches for the specified module. The function also searches for modules if loading the specified module causes the system to load other associated modules (that is, if the module has dependencies). The directories that are searched and the order in which they are searched depend on the specified path and the <i>dwFlags</i> parameter. For more information, see Remarks. If the function cannot find the  module or one of its dependencies, the function fails.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="hFile">This parameter is reserved for future use. It must be <b>NULL</b>.</param>
		/// <param name="dwFlags">
		/// <para>The action to be taken when loading the module. If no flags are specified, the behavior of this function is identical to that of the <a href="https://docs.microsoft.com/windows/desktop/api/libloaderapi/nf-libloaderapi-loadlibrarya">LoadLibrary</a> function. This</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <returns>
		/// <para>If the function succeeds, the return value is a handle to the loaded module. If the function fails, the return value is <b>NULL</b>. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
		/// </returns>
		/// <remarks>
		/// <para>The <b>LoadLibraryEx</b> function is very similar to the <a href="https://docs.microsoft.com/windows/desktop/api/libloaderapi/nf-libloaderapi-loadlibrarya">LoadLibrary</a> function. The differences consist of a set of optional behaviors that <b>LoadLibraryEx</b> provides: </para>
		/// <para>This doc was truncated.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexw#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[SupportedOSPlatform("windows5.1.2600")]
		internal static winmdroot.Foundation.HMODULE LoadLibraryEx(winmdroot.Foundation.PCWSTR lpLibFileName, winmdroot.Foundation.HANDLE hFile, winmdroot.System.LibraryLoader.LOAD_LIBRARY_FLAGS dwFlags)
		{
			Marshal.SetLastSystemError(0);
			winmdroot.Foundation.HMODULE __retVal = LocalExternFunction(lpLibFileName, hFile, dwFlags);
			Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
			return __retVal;

			[DllImport("KERNEL32.dll", ExactSpelling = true, EntryPoint = "LoadLibraryExW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
			static extern winmdroot.Foundation.HMODULE LocalExternFunction(winmdroot.Foundation.PCWSTR lpLibFileName, winmdroot.Foundation.HANDLE hFile, winmdroot.System.LibraryLoader.LOAD_LIBRARY_FLAGS dwFlags);
		}
	}
}