NtWaitForAlertByThreadId - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTPSAPI_H
//
// Threads
//
#if (PHNT_MODE != PHNT_MODE_KERNEL)
#if (PHNT_VERSION >= PHNT_WIN8)

// rev
/**
 * Waits for an alert to be delivered to the specified thread.
 *
 * @param Address The address to wait for an alert on.
 * @param Timeout The timeout value for waiting, or NULL for no timeout.
 * @return NTSTATUS Successful or errant status.
 */
NTSYSCALLAPI
NTSTATUS
NTAPI
NtWaitForAlertByThreadId(
    _In_opt_ PVOID Address,
    _In_opt_ PLARGE_INTEGER Timeout
    );

#endif
#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwWaitForAlertByThreadId(
    _In_opt_ PVOID Address,
    _In_opt_ PLARGE_INTEGER Timeout
    );

#endif

View code on GitHub

Waits on the specified address to be alerted-by-ID by another thread.

Parameters

Notable return values

Remarks

Despite the name, the wait this function enters is not alertable and, thus, cannot be interrupted by APCs or NtAlertThread. Alertable waits via NtDelayExecution are unrelated to this functionality.

Related Win32 API

Required OS version

This function was introduced in Windows 8.

See also