#ifndef _NTTP_H
// winbase:CreateThreadpoolWork
/**
* Allocates a work object.
*
* \param[out] WorkReturn A pointer to a variable that receives the new work object.
* \param[in] Callback The callback function to execute.
* \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-createthreadpoolwork
*/
NTSYSAPI
NTSTATUS
NTAPI
TpAllocWork(
_Out_ PTP_WORK *WorkReturn,
_In_ PTP_WORK_CALLBACK Callback,
_Inout_opt_ PVOID Context,
_In_opt_ PTP_CALLBACK_ENVIRON CallbackEnviron
);
View code on GitHubCreates a new work object.
CreateThreadpoolWork is a thin wrapper around this function.