TrySubmitThreadpoolCallback

Requests that a thread pool worker thread call the specified callback function.

Syntax

BOOL TrySubmitThreadpoolCallback(
         PTP_SIMPLE_CALLBACK pfns,
         PVOID pv,
         PTP_CALLBACK_ENVIRON pcbe
)  

Parameters

pfns
Type: PTP_SIMPLE_CALLBACK 

[in] The callback function. For details, see SimpleCallback.

pv
Type: PVOID 

[in, out, optional] Optional application-defined data to pass to the callback function.

pcbe
Type: PTP_CALLBACK_ENVIRON 

[in, optional] A TP_CALLBACK_ENVIRON structure that defines the environment in which to execute the callback function. The InitializeThreadpoolEnvironment function returns this structure.

If this parameter is NULL, the callback executes in the default callback environment. For more information, see InitializeThreadpoolEnvironment.

Return value

Type: BOOL 

If the function succeeds, it returns TRUE.If the function fails, it returns FALSE. To retrieve extended error information, call GetLastError.

Requirements

Header: Declared in threadpoolapiset.h.

Library: Use kernelx.lib.