Skip to main content

XTaskQueueGetPort

Returns the task queue port handle for the given port.

Syntax

Parameters

queue   _In_
Type: XTaskQueueHandle
The task queue to get the port from. port   _In_
Type: XTaskQueuePort
The port to get. portHandle   _Out_
Type: XTaskQueuePortHandle*
The task queue port handle for the given port.

Return value

Type: HRESULT HRESULT success or error code.

Remarks

This function isn’t safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.
Task queue port handles are owned by the task queue and do not have to be closed. They are used when creating composite task queues. The following example creates a composite queue whose work and completion ports both use the work port of the original queue. A composite task queue is a task queue that is composed of parts from other queues. Composite task queues are useful when one asynchronous task needs to call another, and the completion from that task is an intermediate step that should not waste cycles on the completion thread.
SubmitCallback is a helper function that is defined in the code example for the XTaskQueueSubmitCallback function.

Requirements

Header: XTaskQueue.h Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

Conceptual documentation

See also

XTaskQueue members
Asynchronous Programming Model
Async Task Queue Design
Last modified on August 20, 2026