/// Application-defined callback function used to save data and application state information in the event the application encounters an unhandled
/// exception or becomes unresponsive.
/// </summary>
/// <param name="pvParameter">Context information specified when you called the RegisterApplicationRecoveryCallback function to register for recovery.</param>
/// <returns>The return value is not used and should be 0.</returns>
/// QueryActCtxW queries the activation context active on the thread instead of the context specified by hActCtx. This is usually the last activation
/// context passed to ActivateActCtx. If ActivateActCtx has not been called, the active activation context can be the activation context used by the
/// executable of the current process. In other cases, the operating system determines the active activation context. For example, when the callback
/// function to a new thread is called, the active activation context may be the context that was active when you created the thread by calling CreateThread.
/// </summary>
QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX=0x00000004,
/// <summary>
/// QueryActCtxW interprets hActCtx as an HMODULE data type and queries an activation context that is associated with a DLL or EXE. When a DLL or EXE
/// is loaded, the loader checks for a manifest stored in a resource. If the loader finds an RT_MANIFEST resource with a resource identifier set to
/// ISOLATIONAWARE_MANIFEST_ RESOURCE_ID, the loader associates the resulting activation context with the DLL or EXE. This is the activation context
/// that QueryActCtxW queries when the QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE flag has been set.
/// </summary>
QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE=0x00000008,
/// <summary>
/// QueryActCtxW interprets hActCtx as an address within a DLL or EXE and queries an activation context that has been associated with the DLL or EXE.
/// This can be any address within the DLL or EXE. For example, the address of any function within a DLL or EXE or the address of any static data,
/// such as a constant string. When a DLL or EXE is loaded, the loader checks for a manifest stored in a resource in the same way as QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE.
/// The <c>ActivateActCtx</c> function activates the specified activation context. It does this by pushing the specified activation context to the top of
/// the activation stack. The specified activation context is thus associated with the current thread and any appropriate side-by-side API functions.
/// <param name="hActCtx">Handle to an <c>ACTCTX</c> structure that contains information on the activation context that is to be made active.</param>
/// <param name="lpCookie">Pointer to a <c>ULONG_PTR</c> that functions as a cookie, uniquely identifying a specific, activated activation context.</param>
/// <returns>
/// <para>If the function succeeds, it returns <c>TRUE</c>. Otherwise, it returns <c>FALSE</c>.</para>
/// <para>
/// This function sets errors that can be retrieved by calling <c>GetLastError</c>. For an example, see Retrieving the Last-Error Code. For a complete
/// <summary>The <c>DeactivateActCtx</c> 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>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>0</term>
/// <term>
/// If this value is set and the cookie specified in the ulCookie parameter is in the top frame of the activation stack, the activation context is popped
/// from the stack and thereby deactivated. If this value is set and the cookie specified in the ulCookie parameter is not in the top frame of the
/// activation stack, this function searches down the stack for the cookie.If the cookie is found, a STATUS_SXS_EARLY_DEACTIVATION exception is thrown.If
/// the cookie is not found, a STATUS_SXS_INVALID_DEACTIVATION exception is thrown.This value should be specified in most cases.
/// If this value is set and the cookie specified in the ulCookie parameter is in the top frame of the activation stack, the function returns an
/// ERROR_INVALID_PARAMETER error code. Call GetLastError to obtain this code. If this value is set and the cookie is not on the activation stack, a
/// STATUS_SXS_INVALID_DEACTIVATION exception will be thrown.If this value is set and the cookie is in a lower frame of the activation stack, all of the
/// frames down to and including the frame the cookie is in is popped from the stack.
/// The ULONG_PTR that was passed into the call to <c>ActivateActCtx</c>. This value is used as a cookie to identify a specific activated activation context.
/// </param>
/// <returns>
/// <para>If the function succeeds, it returns <c>TRUE</c>. Otherwise, it returns <c>FALSE</c>.</para>
/// <para>
/// This function sets errors that can be retrieved by calling <c>GetLastError</c>. For an example, see Retrieving the Last-Error Code. For a complete
/// This function returns the activation context handle where the redirection data was found in the hActCtx member of the ACTCTX_SECTION_KEYED_DATA
/// structure. The caller must use ReleaseActCtx to release this activation context.
/// </term>
/// </item>
/// </list>
/// </para>
/// </param>
/// <param name="lpExtensionGuid">Reserved; must be null.</param>
/// <param name="ulSectionId">
/// <para>Identifier of the string section of the activation context in which to search for the specific string.</para>
/// <para>The following are valid string section identifiers:</para>
/// </param>
/// <param name="lpStringToFind">Pointer to a null-terminated string to be used as the search criteria.</param>
/// <param name="ReturnedData">Pointer to an <c>ACTCTX_SECTION_KEYED_DATA</c> structure to be filled out with the requested string information.</param>
/// <returns>
/// <para>If the function succeeds, it returns <c>TRUE</c>. Otherwise, it returns <c>FALSE</c>.</para>
/// <para>
/// This function sets errors that can be retrieved by calling <c>GetLastError</c>. For an example, see Retrieving the Last-Error Code. For a complete
/// Retrieves a pointer to the callback routine registered for the specified process. The address returned is in the virtual address space of the process.
/// </summary>
/// <param name="hProcess">A handle to the process. This handle must have the PROCESS_VM_READ access right.</param>
/// The <c>QueryActCtxSettingsW</c> function specifies the activation context, and the namespace and name of the attribute that is to be queried.
/// </summary>
/// <param name="dwFlags">This value must be 0.</param>
/// <param name="hActCtx">A handle to the activation context that is being queried.</param>
/// <param name="settingsNameSpace">
/// <para>
/// A pointer to a string that contains the value <c>"http://schemas.microsoft.com/SMI/2005/WindowsSettings"</c> or <c>NULL</c>. These values are equivalent.
/// </para>
/// <para>
/// <c>Windows 8 and Windows Server 2012:</c> A pointer to a string that contains the value
/// <c>"http://schemas.microsoft.com/SMI/2011/WindowsSettings"</c> is also a valid parameter. A <c>NULL</c> is still equivalent to the previous value.
/// </para>
/// </param>
/// <param name="settingName">The name of the attribute to be queried.</param>
/// <param name="pvBuffer">A pointer to the buffer that receives the query result.</param>
/// <param name="dwBuffer">The size of the buffer in characters that receives the query result.</param>
/// <param name="pdwWrittenOrRequired">
/// A pointer to a value which is the number of characters written to the buffer specified by pvBuffer or that is required to hold the query result.
/// </param>
/// <returns>
/// <para>If the function succeeds, it returns <c>TRUE</c>. Otherwise, it returns <c>FALSE</c>.</para>
/// <para>
/// This function sets errors that can be retrieved by calling <c>GetLastError</c>. For an example, see Retrieving the Last-Error Code. For a complete
/// QueryActCtxW queries the activation context active on the thread instead of the context specified by hActCtx. This is usually the last activation
/// context passed to ActivateActCtx. If ActivateActCtx has not been called, the active activation context can be the activation context used by the
/// executable of the current process. In other cases, the operating system determines the active activation context. For example, when the callback
/// function to a new thread is called, the active activation context may be the context that was active when you created the thread by calling CreateThread.
/// QueryActCtxW interprets hActCtx as an HMODULE data type and queries an activation context that is associated with a DLL or EXE. When a DLL or EXE is
/// loaded, the loader checks for a manifest stored in a resource. If the loader finds an RT_MANIFEST resource with a resource identifier set to
/// ISOLATIONAWARE_MANIFEST_ RESOURCE_ID, the loader associates the resulting activation context with the DLL or EXE. This is the activation context that
/// QueryActCtxW queries when the QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE flag has been set.
/// QueryActCtxW interprets hActCtx as an address within a DLL or EXE and queries an activation context that has been associated with the DLL or EXE.
/// This can be any address within the DLL or EXE. For example, the address of any function within a DLL or EXE or the address of any static data, such
/// as a constant string. When a DLL or EXE is loaded, the loader checks for a manifest stored in a resource in the same way as QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE.
/// </term>
/// </item>
/// </list>
/// </para>
/// </param>
/// <param name="hActCtx">Handle to the activation context that is being queried.</param>
/// <param name="pvSubInstance">
/// <para>
/// Index of the assembly, or assembly and file combination, in the activation context. The meaning of the pvSubInstance depends on the option specified
/// by the value of the ulInfoClass parameter. This parameter may be null.
/// Pointer to a DWORD that specifies the index of the assembly within the activation context. This is the activation context that QueryActCtxW queries.
/// If QueryActCtxW is called with this option and the function succeeds, the returned buffer contains detailed information about the activation context.
/// This information is in the form of the ACTIVATION_CONTEXT_DETAILED_INFORMATION structure.
/// If QueryActCtxW is called with this option and the function succeeds, the buffer contains information about the assembly that has the index specified
/// in pvSubInstance. This information is in the form of the ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION structure.
/// Information about a file in one of the assemblies in Activation Context. The pvSubInstance parameter must point to an ACTIVATION_CONTEXT_QUERY_INDEX
/// structure. If QueryActCtxW is called with this option and the function succeeds, the returned buffer contains information for a file in the assembly.
/// This information is in the form of the ASSEMBLY_FILE_DETAILED_INFORMATION structure.
/// If QueryActCtxW is called with this option and the function succeeds, the buffer contains information about requested run level of the activation
/// context. This information is in the form of the ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION structure.Windows Server 2003 and Windows XP: This value is
/// If QueryActCtxW is called with this option and the function succeeds, the buffer contains information about requested compatibility context. This
/// information is in the form of the ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION structure.Windows Server 2008 and earlier, and Windows Vista and
/// earlier: This value is not available. This option is available beginning with Windows Server 2008 R2 and Windows 7.
/// </term>
/// </item>
/// </list>
/// </para>
/// </param>
/// <param name="pvBuffer">
/// Pointer to a buffer that holds the returned information. This parameter is optional. If pvBuffer is <c>null</c>, then cbBuffer must be zero. If the
/// size of the buffer pointed to by pvBuffer is too small, <c>QueryActCtxW</c> returns ERROR_INSUFFICIENT_BUFFER and no data is written into the buffer.
/// See the Remarks section for the method you can use to determine the required size of the buffer.
/// </param>
/// <param name="cbBuffer">Size of the buffer in bytes pointed to by pvBuffer. This parameter is optional.</param>
/// <param name="pcbWrittenOrRequired">
/// Number of bytes written or required. The parameter pcbWrittenOrRequired can only be <c>NULL</c> when pvBuffer is <c>NULL</c>. If pcbWrittenOrRequired
/// is non- <c>NULL</c>, it is filled with the number of bytes required to store the returned buffer.
/// </param>
/// <returns>
/// <para>If the function succeeds, it returns <c>TRUE</c>. Otherwise, it returns <c>FALSE</c>.</para>
/// <para>
/// This function sets errors that can be retrieved by calling <c>GetLastError</c>. For an example, see Retrieving the Last-Error Code. For a complete
/// You must call the <c>ApplicationRecoveryInProgress</c> function within the specified interval to indicate to ARR that you are still actively
/// recovering; otherwise, WER terminates recovery. Typically, you perform recovery in a loop with each iteration lasting no longer than the ping
/// interval. Each iteration performs a block of recovery work followed by a call to <c>ApplicationRecoveryInProgress</c>. Since you also use
/// <c>ApplicationRecoveryInProgress</c> to determine if the user wants to cancel recovery, you should consider a smaller interval, so you do not perform
/// A pointer to a Unicode string that specifies the command-line arguments for the application when it is restarted. The maximum size of the command
/// line that you can specify is RESTART_MAX_CMD_LINE characters. Do not include the name of the executable in the command line; this function adds it
/// for you.
/// </para>
/// <para>
/// If this parameter is <c>NULL</c> or an empty string, the previously registered command line is removed. If the argument contains spaces, use quotes
/// <summary>Removes the active instance of an application from the restart list.</summary>
/// <remarks>
/// You do not need to call this function before exiting. You need to remove the registration only if you choose to not restart the application. For
/// example, you could remove the registration if your application entered a corrupted state where a future restart would also fail. You must call this
/// function before the application fails abnormally.
/// </remarks>
/// <returns>This function returns S_OK on success</returns>
/// The name of the current application. If the value of this member is set to null, the name of the executable that launched the current process is used.
/// The <c>ACTCTX_SECTION_KEYED_DATA</c> structure is used by the <c>FindActCtxSectionString</c> and <c>FindActCtxSectionGuid</c> functions to return the
/// activation context information along with either the GUID or 32-bit integer-tagged activation context section.
/// <summary>Provides a <see cref="SafeHandle"/> to an account context that releases a created HACTCTX instance at disposal using ReleaseActCtx.</summary>
/// <summary>Initializes a new instance of the <see cref="HACTCTX"/> class and assigns an existing handle.</summary>
/// <param name="preexistingHandle">An <see cref="IntPtr"/> object that represents the pre-existing handle to use.</param>
/// <param name="ownsHandle"><see langword="true"/> to reliably release the handle during the finalization phase; otherwise, <see langword="false"/> (not recommended).</param>