Skip to main content

XApuEnqueueCommand

Submits a single command to the XAPU command queue.

Syntax

Parameters

handle   _In_
Type: XApuHandle
Handle returned by calling XApuConnect. command   _In_
Type: XApuCommandId*
Command to submit to the XAPU input queue. totalCommandCount   _Out_opt_
Type: uint32_t*
Total command count, returned.

Return value

Type: HRESULT Returns S_OK if successful; otherwise, returns an error code.

Remarks

This call will be fast as it will not allocate resources or process data and just sends the command to the hardware server. This call will return XAPU_E_QUEUE_FULL if there are XApuConnectInputParameters::maxQueuedCommandsPerStream commands under processing. To avoid this error, the caller must retrieve one or more result(s) via XApuDequeueResult. This call is thread safe, i.e. it is possible to submit commands from multiple threads, however there is no performance advantage to call it from more than one thread. This call will also take a pointer to uint32_t to return the totalCommandCount for the current session. This number represents the total commands that have been submitted successfully since the session started and after XApuConnect was called. This number will not go back to zero. If the hardware server is in a bad state, XApuEnqueueCommand will return the XAPU_E_DEVICE_FATAL_ERROR error code. In this case, all XAPU clients should be disconnected and reconnected again. If this method fails, a descriptive error code will be returned. The following table maps each XApuCommandType to the struct type that should be passed to XApuEnqueueCommand:

Requirements

Header: xapu.h Library: xapu.lib Supported platforms: XBOX Series X|S

See also

XAPU
Last modified on August 20, 2026