#ifndef _NTPSAPI_H
//
// Threads
//
#if (PHNT_MODE != PHNT_MODE_KERNEL)
#if (PHNT_VERSION >= PHNT_WINDOWS_8)
// 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
);
View code on GitHub#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwWaitForAlertByThreadId(
_In_opt_ PVOID Address,
_In_opt_ PLARGE_INTEGER Timeout
);
View code on GitHubWaits on the specified address to be alerted-by-ID by another thread.
Address - the user-provided value that serves as a key.Timeout - an optional pointer to a timeout for the wait. A negative value indicates relative timeout for the specified number of 100-nanosecond intervals. To wait for a specific number of milliseconds, multiply them by -10,000. Positive values indicate an absolute time.STATUS_ALERTED - the thread woke due to a call to NtAlertThreadByThreadId.STATUS_TIMEOUT - the thread woke due to the timeout.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.
This function was introduced in Windows 8.