зеркало из https://github.com/microsoft/msquic.git
Add error code hex values to msquic public headers (#1583)
* Add error code hex values to msquic public headers Mapping an error code back to its macro is very difficult in some cases. Put their hex values directly in the header to make this easier on users * Add kernel
This commit is contained in:
Родитель
fd73bdfda8
Коммит
b73ea50bfc
|
@ -95,31 +95,31 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) throw() { return (ENUMTYP
|
|||
#define ERROR_SUCCESS 0
|
||||
#define ERROR_CONTINUE -1
|
||||
#define ERROR_NOT_READY -2
|
||||
#define ERROR_BASE 200000000
|
||||
#define ERROR_NOT_ENOUGH_MEMORY 1 + ERROR_BASE
|
||||
#define ERROR_INVALID_STATE 2 + ERROR_BASE
|
||||
#define ERROR_INVALID_PARAMETER 3 + ERROR_BASE
|
||||
#define ERROR_NOT_SUPPORTED 4 + ERROR_BASE
|
||||
#define ERROR_NOT_FOUND 5 + ERROR_BASE
|
||||
#define ERROR_BUFFER_OVERFLOW 6 + ERROR_BASE
|
||||
#define ERROR_CONNECTION_REFUSED 7 + ERROR_BASE
|
||||
#define ERROR_OPERATION_ABORTED 8 + ERROR_BASE
|
||||
#define ERROR_HANDSHAKE_FAILURE 9 + ERROR_BASE
|
||||
#define ERROR_NETWORK_UNREACHABLE 10 + ERROR_BASE
|
||||
#define ERROR_CONNECTION_IDLE 11 + ERROR_BASE
|
||||
#define ERROR_INTERNAL_ERROR 12 + ERROR_BASE
|
||||
#define ERROR_PROTOCOL_ERROR 13 + ERROR_BASE
|
||||
#define ERROR_VER_NEG_ERROR 14 + ERROR_BASE
|
||||
#define ERROR_EPOLL_ERROR 15 + ERROR_BASE
|
||||
#define ERROR_DNS_RESOLUTION_ERROR 16 + ERROR_BASE
|
||||
#define ERROR_SOCKET_ERROR 17 + ERROR_BASE
|
||||
#define ERROR_SSL_ERROR 18 + ERROR_BASE
|
||||
#define ERROR_USER_CANCELED 19 + ERROR_BASE
|
||||
#define ERROR_ALPN_NEG_FAILURE 20 + ERROR_BASE
|
||||
#define ERROR_STREAM_LIMIT_REACHED 21 + ERROR_BASE
|
||||
#define ERROR_BASE 200000000 // 0xBEBC200
|
||||
#define ERROR_NOT_ENOUGH_MEMORY 1 + ERROR_BASE // 0xBEBC201
|
||||
#define ERROR_INVALID_STATE 2 + ERROR_BASE // 0xBEBC202
|
||||
#define ERROR_INVALID_PARAMETER 3 + ERROR_BASE // 0xBEBC203
|
||||
#define ERROR_NOT_SUPPORTED 4 + ERROR_BASE // 0xBEBC204
|
||||
#define ERROR_NOT_FOUND 5 + ERROR_BASE // 0xBEBC205
|
||||
#define ERROR_BUFFER_OVERFLOW 6 + ERROR_BASE // 0xBEBC206
|
||||
#define ERROR_CONNECTION_REFUSED 7 + ERROR_BASE // 0xBEBC207
|
||||
#define ERROR_OPERATION_ABORTED 8 + ERROR_BASE // 0xBEBC208
|
||||
#define ERROR_HANDSHAKE_FAILURE 9 + ERROR_BASE // 0xBEBC209
|
||||
#define ERROR_NETWORK_UNREACHABLE 10 + ERROR_BASE // 0xBEBC20A
|
||||
#define ERROR_CONNECTION_IDLE 11 + ERROR_BASE // 0xBEBC20B
|
||||
#define ERROR_INTERNAL_ERROR 12 + ERROR_BASE // 0xBEBC20C
|
||||
#define ERROR_PROTOCOL_ERROR 13 + ERROR_BASE // 0xBEBC20D
|
||||
#define ERROR_VER_NEG_ERROR 14 + ERROR_BASE // 0xBEBC20E
|
||||
#define ERROR_EPOLL_ERROR 15 + ERROR_BASE // 0xBEBC20F
|
||||
#define ERROR_DNS_RESOLUTION_ERROR 16 + ERROR_BASE // 0xBEBC210
|
||||
#define ERROR_SOCKET_ERROR 17 + ERROR_BASE // 0xBEBC211
|
||||
#define ERROR_SSL_ERROR 18 + ERROR_BASE // 0xBEBC212
|
||||
#define ERROR_USER_CANCELED 19 + ERROR_BASE // 0xBEBC213
|
||||
#define ERROR_ALPN_NEG_FAILURE 20 + ERROR_BASE // 0xBEBC214
|
||||
#define ERROR_STREAM_LIMIT_REACHED 21 + ERROR_BASE // 0xBEBC215
|
||||
|
||||
#define TLS_ERROR_BASE 256 + ERROR_BASE
|
||||
#define CERT_ERROR_BASE 512 + ERROR_BASE
|
||||
#define TLS_ERROR_BASE 256 + ERROR_BASE // 0xBEBC300
|
||||
#define CERT_ERROR_BASE 512 + ERROR_BASE // 0xBEBC400
|
||||
|
||||
#define QUIC_STATUS_SUCCESS ((QUIC_STATUS)ERROR_SUCCESS)
|
||||
#define QUIC_STATUS_PENDING ((QUIC_STATUS)ERROR_NOT_READY)
|
||||
|
|
|
@ -85,28 +85,28 @@ typedef UINT64 uint64_t;
|
|||
#define QUIC_FAILED(X) (!NT_SUCCESS(X))
|
||||
#define QUIC_SUCCEEDED(X) NT_SUCCESS(X)
|
||||
|
||||
#define QUIC_STATUS_SUCCESS STATUS_SUCCESS
|
||||
#define QUIC_STATUS_PENDING STATUS_PENDING
|
||||
#define QUIC_STATUS_CONTINUE STATUS_REPARSE
|
||||
#define QUIC_STATUS_OUT_OF_MEMORY STATUS_NO_MEMORY
|
||||
#define QUIC_STATUS_INVALID_PARAMETER STATUS_INVALID_PARAMETER
|
||||
#define QUIC_STATUS_INVALID_STATE STATUS_INVALID_DEVICE_STATE
|
||||
#define QUIC_STATUS_NOT_SUPPORTED STATUS_NOT_SUPPORTED
|
||||
#define QUIC_STATUS_NOT_FOUND STATUS_NOT_FOUND
|
||||
#define QUIC_STATUS_BUFFER_TOO_SMALL STATUS_BUFFER_TOO_SMALL
|
||||
#define QUIC_STATUS_HANDSHAKE_FAILURE STATUS_QUIC_HANDSHAKE_FAILURE
|
||||
#define QUIC_STATUS_ABORTED STATUS_CANCELLED
|
||||
#define QUIC_STATUS_ADDRESS_IN_USE STATUS_ADDRESS_ALREADY_EXISTS
|
||||
#define QUIC_STATUS_CONNECTION_TIMEOUT STATUS_QUIC_CONNECTION_TIMEOUT
|
||||
#define QUIC_STATUS_CONNECTION_IDLE STATUS_QUIC_CONNECTION_IDLE
|
||||
#define QUIC_STATUS_UNREACHABLE STATUS_HOST_UNREACHABLE
|
||||
#define QUIC_STATUS_INTERNAL_ERROR STATUS_QUIC_INTERNAL_ERROR
|
||||
#define QUIC_STATUS_CONNECTION_REFUSED STATUS_CONNECTION_REFUSED
|
||||
#define QUIC_STATUS_PROTOCOL_ERROR STATUS_QUIC_PROTOCOL_VIOLATION
|
||||
#define QUIC_STATUS_VER_NEG_ERROR STATUS_QUIC_VER_NEG_FAILURE
|
||||
#define QUIC_STATUS_USER_CANCELED STATUS_QUIC_USER_CANCELED
|
||||
#define QUIC_STATUS_ALPN_NEG_FAILURE STATUS_QUIC_ALPN_NEG_FAILURE
|
||||
#define QUIC_STATUS_STREAM_LIMIT_REACHED STATUS_QUIC_STREAM_LIMIT_REACHED
|
||||
#define QUIC_STATUS_SUCCESS STATUS_SUCCESS // 0x0
|
||||
#define QUIC_STATUS_PENDING STATUS_PENDING // 0x103
|
||||
#define QUIC_STATUS_CONTINUE STATUS_REPARSE // 0x104
|
||||
#define QUIC_STATUS_OUT_OF_MEMORY STATUS_NO_MEMORY // 0xc0000017
|
||||
#define QUIC_STATUS_INVALID_PARAMETER STATUS_INVALID_PARAMETER // 0xc000000d
|
||||
#define QUIC_STATUS_INVALID_STATE STATUS_INVALID_DEVICE_STATE // 0xc0000184
|
||||
#define QUIC_STATUS_NOT_SUPPORTED STATUS_NOT_SUPPORTED // 0xc00000bb
|
||||
#define QUIC_STATUS_NOT_FOUND STATUS_NOT_FOUND // 0xc0000225
|
||||
#define QUIC_STATUS_BUFFER_TOO_SMALL STATUS_BUFFER_TOO_SMALL // 0xc0000023
|
||||
#define QUIC_STATUS_HANDSHAKE_FAILURE STATUS_QUIC_HANDSHAKE_FAILURE // 0xc0240000
|
||||
#define QUIC_STATUS_ABORTED STATUS_CANCELLED // 0xc0000120
|
||||
#define QUIC_STATUS_ADDRESS_IN_USE STATUS_ADDRESS_ALREADY_EXISTS // 0xc000020a
|
||||
#define QUIC_STATUS_CONNECTION_TIMEOUT STATUS_QUIC_CONNECTION_TIMEOUT // 0xc0240006
|
||||
#define QUIC_STATUS_CONNECTION_IDLE STATUS_QUIC_CONNECTION_IDLE // 0xc0240005
|
||||
#define QUIC_STATUS_UNREACHABLE STATUS_HOST_UNREACHABLE // 0xc000023d
|
||||
#define QUIC_STATUS_INTERNAL_ERROR STATUS_QUIC_INTERNAL_ERROR // 0xc0240003
|
||||
#define QUIC_STATUS_CONNECTION_REFUSED STATUS_CONNECTION_REFUSED // 0xc0000236
|
||||
#define QUIC_STATUS_PROTOCOL_ERROR STATUS_QUIC_PROTOCOL_VIOLATION // 0xc0240004
|
||||
#define QUIC_STATUS_VER_NEG_ERROR STATUS_QUIC_VER_NEG_FAILURE // 0xc0240001
|
||||
#define QUIC_STATUS_USER_CANCELED STATUS_QUIC_USER_CANCELED // 0xc0240002
|
||||
#define QUIC_STATUS_ALPN_NEG_FAILURE STATUS_QUIC_ALPN_NEG_FAILURE // 0xc0240007
|
||||
#define QUIC_STATUS_STREAM_LIMIT_REACHED STATUS_QUIC_STREAM_LIMIT_REACHED // 0xc0240008
|
||||
|
||||
#define QUIC_STATUS_TLS_ALERT(Alert) (QUIC_TLS_ALERT_NTSTATUS_PREFIX | (0xff & Alert))
|
||||
|
||||
|
|
|
@ -84,29 +84,29 @@ Environment:
|
|||
#define QUIC_FAILED(X) FAILED(X)
|
||||
#define QUIC_SUCCEEDED(X) SUCCEEDED(X)
|
||||
|
||||
#define QUIC_STATUS_SUCCESS S_OK
|
||||
#define QUIC_STATUS_PENDING SUCCESS_HRESULT_FROM_WIN32(ERROR_IO_PENDING)
|
||||
#define QUIC_STATUS_CONTINUE SUCCESS_HRESULT_FROM_WIN32(ERROR_CONTINUE)
|
||||
#define QUIC_STATUS_OUT_OF_MEMORY E_OUTOFMEMORY
|
||||
#define QUIC_STATUS_INVALID_PARAMETER E_INVALIDARG
|
||||
#define QUIC_STATUS_INVALID_STATE E_NOT_VALID_STATE
|
||||
#define QUIC_STATUS_NOT_SUPPORTED E_NOINTERFACE
|
||||
#define QUIC_STATUS_NOT_FOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)
|
||||
#define QUIC_STATUS_BUFFER_TOO_SMALL E_NOT_SUFFICIENT_BUFFER
|
||||
#define QUIC_STATUS_HANDSHAKE_FAILURE ERROR_QUIC_HANDSHAKE_FAILURE
|
||||
#define QUIC_STATUS_ABORTED E_ABORT
|
||||
#define QUIC_STATUS_ADDRESS_IN_USE HRESULT_FROM_WIN32(WSAEADDRINUSE)
|
||||
#define QUIC_STATUS_CONNECTION_TIMEOUT ERROR_QUIC_CONNECTION_TIMEOUT
|
||||
#define QUIC_STATUS_CONNECTION_IDLE ERROR_QUIC_CONNECTION_IDLE
|
||||
#define QUIC_STATUS_UNREACHABLE HRESULT_FROM_WIN32(ERROR_HOST_UNREACHABLE)
|
||||
#define QUIC_STATUS_INTERNAL_ERROR ERROR_QUIC_INTERNAL_ERROR
|
||||
#define QUIC_STATUS_CONNECTION_REFUSED HRESULT_FROM_WIN32(ERROR_CONNECTION_REFUSED)
|
||||
#define QUIC_STATUS_PROTOCOL_ERROR ERROR_QUIC_PROTOCOL_VIOLATION
|
||||
#define QUIC_STATUS_VER_NEG_ERROR ERROR_QUIC_VER_NEG_FAILURE
|
||||
#define QUIC_STATUS_TLS_ERROR HRESULT_FROM_WIN32(WSA_SECURE_HOST_NOT_FOUND)
|
||||
#define QUIC_STATUS_USER_CANCELED ERROR_QUIC_USER_CANCELED
|
||||
#define QUIC_STATUS_ALPN_NEG_FAILURE ERROR_QUIC_ALPN_NEG_FAILURE
|
||||
#define QUIC_STATUS_STREAM_LIMIT_REACHED ERROR_QUIC_STREAM_LIMIT_REACHED
|
||||
#define QUIC_STATUS_SUCCESS S_OK // 0x0
|
||||
#define QUIC_STATUS_PENDING SUCCESS_HRESULT_FROM_WIN32(ERROR_IO_PENDING) // 0x703e5
|
||||
#define QUIC_STATUS_CONTINUE SUCCESS_HRESULT_FROM_WIN32(ERROR_CONTINUE) // 0x704de
|
||||
#define QUIC_STATUS_OUT_OF_MEMORY E_OUTOFMEMORY // 0x8007000e
|
||||
#define QUIC_STATUS_INVALID_PARAMETER E_INVALIDARG // 0x80070057
|
||||
#define QUIC_STATUS_INVALID_STATE E_NOT_VALID_STATE // 0x8007139f
|
||||
#define QUIC_STATUS_NOT_SUPPORTED E_NOINTERFACE // 0x80004002
|
||||
#define QUIC_STATUS_NOT_FOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND) // 0x80070490
|
||||
#define QUIC_STATUS_BUFFER_TOO_SMALL E_NOT_SUFFICIENT_BUFFER // 0x8007007a
|
||||
#define QUIC_STATUS_HANDSHAKE_FAILURE ERROR_QUIC_HANDSHAKE_FAILURE // 0x80410000
|
||||
#define QUIC_STATUS_ABORTED E_ABORT // 0x80004004
|
||||
#define QUIC_STATUS_ADDRESS_IN_USE HRESULT_FROM_WIN32(WSAEADDRINUSE) // 0x80072740
|
||||
#define QUIC_STATUS_CONNECTION_TIMEOUT ERROR_QUIC_CONNECTION_TIMEOUT // 0x80410006
|
||||
#define QUIC_STATUS_CONNECTION_IDLE ERROR_QUIC_CONNECTION_IDLE // 0x80410005
|
||||
#define QUIC_STATUS_UNREACHABLE HRESULT_FROM_WIN32(ERROR_HOST_UNREACHABLE) // 0x800704d0
|
||||
#define QUIC_STATUS_INTERNAL_ERROR ERROR_QUIC_INTERNAL_ERROR // 0x80410003
|
||||
#define QUIC_STATUS_CONNECTION_REFUSED HRESULT_FROM_WIN32(ERROR_CONNECTION_REFUSED) // 0x800704c9
|
||||
#define QUIC_STATUS_PROTOCOL_ERROR ERROR_QUIC_PROTOCOL_VIOLATION // 0x80410004
|
||||
#define QUIC_STATUS_VER_NEG_ERROR ERROR_QUIC_VER_NEG_FAILURE // 0x80410001
|
||||
#define QUIC_STATUS_TLS_ERROR HRESULT_FROM_WIN32(WSA_SECURE_HOST_NOT_FOUND) // 0x80072b18
|
||||
#define QUIC_STATUS_USER_CANCELED ERROR_QUIC_USER_CANCELED // 0x80410002
|
||||
#define QUIC_STATUS_ALPN_NEG_FAILURE ERROR_QUIC_ALPN_NEG_FAILURE // 0x80410007
|
||||
#define QUIC_STATUS_STREAM_LIMIT_REACHED ERROR_QUIC_STREAM_LIMIT_REACHED // 0x80410008
|
||||
|
||||
#define QUIC_STATUS_TLS_ALERT(Alert) (QUIC_TLS_ALERT_HRESULT_PREFIX | (0xff & Alert))
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче