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

# RtlRegisterWait(3w)

## NAME

**RtlRegisterWait** (NTDLL.@)

## SYNOPSIS

NTSTATUS RtlRegisterWait\
  (\
   PHANDLE                     *NewWaitObject*,\
   HANDLE                      *Object*,\
   RTL\_WAITORTIMERCALLBACKFUNC *Callback*,\
   PVOID                       *Context*,\
   ULONG                       *Milliseconds*,\
   ULONG                       *Flags*\
  )

## DESCRIPTION

Registers a wait for a handle to become signaled.

## PARAMS

*NewWaitObject* **\[In\]**  Handle to the new wait object. Use **[RtlDeregisterWait(3w)](/RtlDeregisterWait/3w.md)** to free it.

*Object* **\[In\]**  *Object* to wait to become signaled.

*Callback* **\[In\]**  *Callback* function to execute when the wait times out or the handle is signaled.

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

*Milliseconds* **\[In\]**  Number of milliseconds to wait before timing out.

*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"**.
