NtSetDefaultHardErrorPort - NtDoc

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

//
// Misc.
//

/**
 * The NtSetDefaultHardErrorPort routine sets the system's default hard error
 * port, which is used by the kernel to deliver hard error notifications to a
 * user-mode process.
 *
 * \param DefaultHardErrorPort A handle to a port object that will receive
 * hard error messages generated by the system.
 * \return NTSTATUS Successful or errant status.
 */
NTSYSCALLAPI
NTSTATUS
NTAPI
NtSetDefaultHardErrorPort(
    _In_ HANDLE DefaultHardErrorPort
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwSetDefaultHardErrorPort(
    _In_ HANDLE DefaultHardErrorPort
    );

#endif

View code on GitHub

NtDoc

No description available.

NTinternals.net (undocumented.ntinternals.net)

NtSetDefaultHardErrorPort is typically called only once. After call, kernel set BOOLEAN flag named _ExReadyForErrors to TRUE, and all other tries to change default port are broken with STATUS_UNSUCCESSFUL error code.

PortHandle

HANDLE to named Port Object.


Listener of default HardError port receive HARDERROR_MSG LPC messages when any process call NtRaiseHardError function.

Documented by

Requirements

Privilege: SE_TCB_PRIVILEGE

See also