TpWaitForWait - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTTP_H

// winbase:WaitForThreadpoolWaitCallbacks
/**
 * Waits for outstanding wait callbacks to complete and optionally cancels pending callbacks.
 *
 * \param[in,out] Wait A pointer to a TP_WAIT structure that defines the wait object.
 * \param[in] CancelPendingCallbacks If TRUE, pending callbacks that have not started are canceled.
 * \sa https://learn.microsoft.com/en-us/windows/win32/api/threadpoolapiset/nf-threadpoolapiset-waitforthreadpoolwaitcallbacks
 * \remarks Waits for the associated callback-object protocol, optionally canceling pending callbacks. Cancellation does not terminate executing callbacks.
 * First disarm a timer/wait if further dispatch is unwanted, and avoid self-deadlock by waiting on the callback object from inside its own associated callback.
 */
NTSYSAPI
VOID
NTAPI
TpWaitForWait(
    _Inout_ PTP_WAIT Wait,
    _In_ LOGICAL CancelPendingCallbacks
    );

#endif

View code on GitHub

NtDoc

Waits for outstanding wait callbacks to complete and optionally cancels pending callbacks that have not yet started to execute.

Related Win32 API

WaitForThreadpoolWaitCallbacks maps directly to this function.

See also