---
name: "RtlQueueWorkItem"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/RtlQueueWorkItem"
---

# RtlQueueWorkItem(3w)

## NAME

**RtlQueueWorkItem** (NTDLL.@)

## SYNOPSIS

NTSTATUS RtlQueueWorkItem\
  (\
   PRTL\_WORK\_ITEM\_ROUTINE *Function*,\
   PVOID                  *Context*,\
   ULONG                  *Flags*\
  )

## DESCRIPTION

Queues a work item into a thread in the thread pool.

## PARAMS

*Function* **\[In\]**  Work function to execute.

*Context* **\[In\]**  *Context* to pass to the work function when it is executed.

*Flags* **\[In\]**  *Flags*. See notes.

## RETURNS

**Success:** **STATUS\_SUCCESS**.

**Failure:** Any **NTSTATUS** code.

## NOTES

*Flags* can be one or more of the following: \
 WT\_EXECUTEDEFAULT - Executes the work item in a non-I/O worker thread.\
 WT\_EXECUTEINIOTHREAD - Executes the work item in an I/O worker thread.\
 WT\_EXECUTEINPERSISTENTTHREAD - Executes the work item in a thread that is persistent.\
 WT\_EXECUTELONGFUNCTION - Hints that the execution can take a long time.\
 WT\_TRANSFER\_IMPERSONATION - Executes the function with the current access token.

## IMPLEMENTATION

Declared in **"winternl.h"**.

Implemented in **"dlls/ntdll/threadpool.c"**.

Debug channel **"threadpool"**.
