Syntax

September 28, 2021 ยท View on GitHub

The status type MsQuic uses for all API return codes.

Syntax

Windows (User Mode)

#define QUIC_STATUS                     HRESULT
#define QUIC_FAILED(X)                  FAILED(X)
#define QUIC_SUCCEEDED(X)               SUCCEEDED(X)

Linux

#define QUIC_STATUS                     unsigned long
#define QUIC_FAILED(X)                  ((int)(X) > 0)
#define QUIC_SUCCEEDED(X)               ((int)(X) <= 0)

Remarks

The QUIC_STATUS type is a cross platform abstraction of the current platform's error code space. It allows for both success and failure values, which can be easily determined by the QUIC_SUCCEEDED and QUIC_FAILED macros.

The MsQuic headers define a number of different possible values for this (see below) but this list is not exhaustive. The platform specific functionality (for example UDP sockets) may also return platform specific error codes up to the app.

Well-Known Status Codes

ValueMeaning
QUIC_STATUS_SUCCESSThe operation completed successfully.
QUIC_STATUS_PENDINGThe operation is pending.
QUIC_STATUS_CONTINUEThe operation will continue.
QUIC_STATUS_OUT_OF_MEMORYAllocation of memory failed.
QUIC_STATUS_INVALID_PARAMETERAn invalid parameter was encountered.
QUIC_STATUS_INVALID_STATEThe current state was not valid for this operation.
QUIC_STATUS_NOT_SUPPORTEDThe operation was not supported.
QUIC_STATUS_NOT_FOUNDThe object was not found.
QUIC_STATUS_BUFFER_TOO_SMALLThe buffer was too small for the operation.
QUIC_STATUS_HANDSHAKE_FAILUREThe connection handshake failed.
QUIC_STATUS_ABORTEDThe connection or stream was aborted.
QUIC_STATUS_ADDRESS_IN_USEThe local address is already in use.
QUIC_STATUS_INVALID_ADDRESSBinding to socket failed, likely caused by a family mismatch between local and remote address.
QUIC_STATUS_CONNECTION_TIMEOUTThe connection timed out waiting for a response from the peer.
QUIC_STATUS_CONNECTION_IDLEThe connection timed out from inactivity.
QUIC_STATUS_INTERNAL_ERRORAn internal error was encountered.
QUIC_STATUS_UNREACHABLEThe server is currently unreachable.
QUIC_STATUS_CONNECTION_REFUSEDThe server refused the connection.
QUIC_STATUS_PROTOCOL_ERRORA protocol error was encountered.
QUIC_STATUS_VER_NEG_ERRORA version negotiation error was encountered.
QUIC_STATUS_USER_CANCELEDThe peer app/user canceled the connection during the handshake.
QUIC_STATUS_ALPN_NEG_FAILUREThe connection handshake failed to negotiate a common ALPN.
QUIC_STATUS_STREAM_LIMIT_REACHEDA stream failed to start because the peer doesn't allow any more to be open at this time.