Skip to main content

XApuDisconnect

Disconnects from the hardware server and release all resources allocated during XApuConnect.

Syntax

Parameters

handle   _In_
Type: XApuHandle
Handle returned by calling XApuConnect.

Return value

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

Remarks

In addition to disconnecting from the hardware server, this call will also free XApuConnectOutputParameters::baseData and close the XApuConnectOutputParameters::resultReadyEvent handle. If XApuDisconnect is called before all the enqueued commands are processed, it will release all the resources and return this error code XAPU_E_PENDING_RESULTS. The caller must wait for the result of the last command being enqueued before calling XApuDisconnect, otherwise a catastrophic failure might happen in the hardware which will disable other active XAPU clients. It is not recommended to call XapuConnect and XApuDisconnect often to start and stop streams as those calls are time consuming and could also lead to resource losses due to memory fragmentation. Instead XapuConnect should be called once upon initialization of the streaming session, then XApuCommandType::Activate and XApuCommandType::Deactivate should be used to start and stop streams during streaming. At the end of the streaming session, XApuDisconnect should be called. This is true for all XAPU clients.

Requirements

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

Conceptual documentation

See also

XApuConnect
XAPU
Last modified on August 20, 2026