#ifndef _NTTP_H
// winbase:SetThreadpoolWait
/**
* Sets the object to wait on and optional timeout for a wait object.
*
* \param[in,out] Wait A pointer to a TP_WAIT structure that defines the wait object.
* \param[in] Handle A handle to the object to wait on.
* \param[in] Timeout A pointer to a FILETIME-based timeout value.
* \sa https://learn.microsoft.com/en-us/windows/win32/api/threadpoolapiset/nf-threadpoolapiset-setthreadpoolwait
* \remarks Handle NULL disarms the association; a non-NULL Timeout uses LARGE_INTEGER native time units. The Ex Reserved argument must be NULL.
* The Ex result is a 32-bit LOGICAL prior-association cancellation result, not NTSTATUS; FALSE can accompany a valid new association. Rearming/disarming does not forcibly terminate a callback already running.
*/
NTSYSAPI
VOID
NTAPI
TpSetWait(
_Inout_ PTP_WAIT Wait,
_In_opt_ HANDLE Handle,
_In_opt_ PLARGE_INTEGER Timeout
);
View code on GitHubSets the wait object, replacing the previous wait object, if any. A worker thread calls the wait object's callback function after the handle becomes signaled or after the specified timeout expires.
SetThreadpoolWait maps directly to this function.