Skip to content

Latest commit

 

History

History
105 lines (74 loc) · 3.53 KB

nf-threadpoolapiset-createthreadpoolwork.md

File metadata and controls

105 lines (74 loc) · 3.53 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:threadpoolapiset.CreateThreadpoolWork
CreateThreadpoolWork function (threadpoolapiset.h)
Creates a new work object.
CreateThreadpoolWork
CreateThreadpoolWork function
base.createthreadpoolwork
threadpoolapiset/CreateThreadpoolWork
base\createthreadpoolwork.htm
backup
50647d87-1768-4918-8376-a6a04daca621
12/05/2018
CreateThreadpoolWork, CreateThreadpoolWork function, base.createthreadpoolwork, threadpoolapiset/CreateThreadpoolWork
threadpoolapiset.h
Windows.h
Windows
Windows Vista [desktop apps \| UWP apps]
Windows Server 2008 [desktop apps \| UWP apps]
Kernel32.lib
Kernel32.dll
Windows
19H1
CreateThreadpoolWork
threadpoolapiset/CreateThreadpoolWork
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
API-MS-Win-Core-threadpool-l1-1-0.dll
KernelBase.dll
API-MS-Win-Core-threadpool-l1-2-0.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
MinKernelBase.dll
CreateThreadpoolWork

CreateThreadpoolWork function

-description

Creates a new work object.

-parameters

-param pfnwk [in]

The callback function. A worker thread calls this callback each time you call SubmitThreadpoolWork to post the work object. For details, see WorkCallback.

-param pv [in, out, optional]

Optional application-defined data to pass to the callback function.

-param pcbe [in, optional]

A pointer to a TP_CALLBACK_ENVIRON structure that defines the environment in which to execute the callback. Use the InitializeThreadpoolEnvironment function to initialize the structure before calling this function.

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

-returns

If the function succeeds, it returns a pointer to a TP_WORK structure that defines the work object. Applications do not modify the members of this structure.

If the function fails, it returns NULL. To retrieve extended error information, call GetLastError.

-remarks

To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or higher.

Examples

For an example, see Using the Thread Pool Functions.

-see-also

CloseThreadpoolWork

SubmitThreadpoolWork

Thread Pools

WaitForThreadpoolWorkCallbacks