Edit

WinI3CGetStatus function (wini3c.h)

Retrieves the current status of a WinI3C-Target. This corresponds to the I3C GETSTATUS Direct CCC.

The WinI3C-Target shall support the GETSTATUS Direct CCC for this to succeed.

WinI3CGetStatus is a Library-managed WinI3C API (the recommended way to use WinI3C). For an overlapped equivalent that uses a client-supplied file handle, see WinI3CGetStatusWithFileHandle.

Syntax

_Must_inspect_result_
HRESULT WINAPI WinI3CGetStatus(
    _In_ WinI3CTarget target,
    _Out_ WINI3C_TARGET_STATUS* targetStatus);

Parameters

[in] target

The WinI3CTarget to query status for.

The handle shall have been created by WinI3CInitializeTarget.

[out] targetStatus

A pointer to a client-allocated WINI3C_TARGET_STATUS structure that receives the WinI3C-Target's status.

Valid only when the function returns S_OK.

Return value

On success this function returns S_OK.

On failure this function returns an appropriate HRESULT error code, including the following.

Return code Description
S_OK Successfully retrieved the WinI3C-Target status.
E_INVALIDARG One or more parameters are invalid.
E_OUTOFMEMORY Available memory is insufficient to execute this function.
HRESULT_FROM_WIN32(ERROR_DEVICE_NACKED) The WinI3C-Target (passively) NACKed the GETSTATUS CCC.
HRESULT_FROM_WIN32(ERROR_DEVICE_NOT_CONNECTED) The WinI3C-Target is not connected. Destroy the handle with WinI3CRelease.
HRESULT_FROM_WIN32(ERROR_DEVICE_HARDWARE_ERROR) A fatal hardware error occurred. Destroy the handle with WinI3CRelease.

Remarks

Vendors understand the capabilities of their devices, so there is no provided mechanism to determine if GETSTATUS CCC is supported.

GETSTATUS is often useful for diagnosing why another CCC or transfer was NACKed by the WinI3C-Target.

This function is thread-safe.

Example

#include <wini3c.h>

void main()
{
    ...

    WINI3C_TARGET_STATUS currentStatus{};
    if (FAILED(WinI3CGetStatus(target, &currentStatus)))
    {
        // Handle failure.
    }

    ...
}

Requirements

Requirement Value
Minimum supported client Windows 11 25H2 October update (build 26200)
Target Platform Windows
Header wini3c.h
DLL wini3c.dll

See also

WinI3CGetStatusWithFileHandle

WINI3C_TARGET_STATUS