NtRaiseHardError - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTEXAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)

/**
 * The NtRaiseHardError routine raises a hard error or serious error dialog box being displayed to the user.
 *
 * \param[in] ErrorStatus The NTSTATUS code that describes the error condition.
 * \param[in] NumberOfParameters The number of parameters in the Parameters array.
 * \param[in] UnicodeStringParameterMask A bitmask indicating which entries in the Parameters array are Unicode strings.
 * \param[in] Parameters An array of parameters to be used in the error message.
 * \param[in] ValidResponseOptions Specifies the valid responses that the user can select in the error dialog.
 * \param[out] Response Receives the user's response to the error dialog.
 * \return NTSTATUS Successful or errant status.
 */
_Analysis_noreturn_
DECLSPEC_NORETURN
NTSYSCALLAPI
NTSTATUS
NTAPI
NtRaiseHardError(
    _In_ NTSTATUS ErrorStatus,
    _In_ ULONG NumberOfParameters,
    _In_ ULONG UnicodeStringParameterMask,
    _In_reads_(NumberOfParameters) PULONG_PTR Parameters,
    _In_ ULONG ValidResponseOptions,
    _Out_ PULONG Response
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwRaiseHardError(
    _In_ NTSTATUS ErrorStatus,
    _In_ ULONG NumberOfParameters,
    _In_ ULONG UnicodeStringParameterMask,
    _In_reads_(NumberOfParameters) PULONG_PTR Parameters,
    _In_ ULONG ValidResponseOptions,
    _Out_ PULONG Response
    );

#endif

View code on GitHub

NtDoc

No description available.

NTinternals.net (undocumented.ntinternals.net)

This function sends HARDERROR_MSG LPC message to listener (typically CSRSS.EXE). See NtSetDefaultHardErrorPort for more information.

ErrorStatus

Error code.

NumberOfParameters

Number of optional parameters in Parameters array.

UnicodeStringParameterMask

Optional string parameter (can be only one per error code).

*Parameters

Array of DWORD parameters for use in error message string.

ResponseOption

See HARDERROR_RESPONSE_OPTION for possible values description.

Response

Pointer to HARDERROR_RESPONSE enumeration.


NtRaiseHardError is easy way to display message in GUI without loading Win32 API libraries.

Documented by

See also