NtCreateWorkerFactory - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTEXAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)

/**
 * The NtCreateWorkerFactory routine creates a worker factory object that manages a pool of worker threads bound to an I/O completion port.
 *
 * \param WorkerFactoryHandleReturn A pointer to a variable that receives a handle to the new worker factory object.
 * \param DesiredAccess The access mask that specifies the requested access to the worker factory object.
 * \param ObjectAttributes A pointer to an OBJECT_ATTRIBUTES structure that specifies the object attributes. This parameter is optional.
 * \param CompletionPortHandle A handle to the I/O completion port that the worker factory is associated with.
 * \param WorkerProcessHandle A handle to the process in which the worker threads are created.
 * \param StartRoutine A pointer to the routine that is executed by each worker thread.
 * \param StartParameter A pointer to the parameter passed to the start routine. This parameter is optional.
 * \param MaxThreadCount The maximum number of worker threads that the factory can create. This parameter is optional.
 * \param StackReserve The amount of stack space to reserve for each worker thread, in bytes. This parameter is optional.
 * \param StackCommit The amount of stack space to commit for each worker thread, in bytes. This parameter is optional.
 * \return NTSTATUS Successful or errant status.
 */
_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
NtCreateWorkerFactory(
    _Out_ PHANDLE WorkerFactoryHandleReturn,
    _In_ ACCESS_MASK DesiredAccess,
    _In_opt_ PCOBJECT_ATTRIBUTES ObjectAttributes,
    _In_ HANDLE CompletionPortHandle,
    _In_ HANDLE WorkerProcessHandle,
    _In_ PVOID StartRoutine,
    _In_opt_ PVOID StartParameter,
    _In_opt_ ULONG MaxThreadCount,
    _In_opt_ SIZE_T StackReserve,
    _In_opt_ SIZE_T StackCommit
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwCreateWorkerFactory(
    _Out_ PHANDLE WorkerFactoryHandleReturn,
    _In_ ACCESS_MASK DesiredAccess,
    _In_opt_ PCOBJECT_ATTRIBUTES ObjectAttributes,
    _In_ HANDLE CompletionPortHandle,
    _In_ HANDLE WorkerProcessHandle,
    _In_ PVOID StartRoutine,
    _In_opt_ PVOID StartParameter,
    _In_opt_ ULONG MaxThreadCount,
    _In_opt_ SIZE_T StackReserve,
    _In_opt_ SIZE_T StackCommit
    );

#endif

View code on GitHub

NtDoc

No description available.