#ifndef _NTTP_H
// winbase:CreateThreadpoolWait
/**
* Allocates a wait object.
*
* \param[out] WaitReturn A pointer to a variable that receives the new wait object.
* \param[in] Callback The callback function to execute when the wait is satisfied or times out.
* \param[in,out] Context Optional application-defined data to pass to the callback function.
* \param[in] CallbackEnviron Optional callback environment for the callback.
* \return NTSTATUS Successful or errant status.
* \sa https://learn.microsoft.com/en-us/windows/win32/api/threadpoolapiset/nf-threadpoolapiset-createthreadpoolwait
*/
NTSYSAPI
NTSTATUS
NTAPI
TpAllocWait(
_Out_ PTP_WAIT *WaitReturn,
_In_ PTP_WAIT_CALLBACK Callback,
_Inout_opt_ PVOID Context,
_In_opt_ PTP_CALLBACK_ENVIRON CallbackEnviron
);
View code on GitHubCreates a new wait object.
CreateThreadpoolWait is a thin wrapper around this function.