From 8d088387dae2fee54b6cc49e19201588fb813b27 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 3 Oct 2019 10:59:45 +0200 Subject: [PATCH] Added function to get an error category for better error handling. --- include/freerdp/error.h | 14 ++ include/freerdp/freerdp.h | 1 + libfreerdp/core/errbase.c | 19 ++ libfreerdp/core/errconnect.c | 78 +++--- libfreerdp/core/errinfo.c | 260 +++++++++++--------- libfreerdp/core/errinfo.h | 5 +- libfreerdp/core/freerdp.c | 28 +++ libfreerdp/core/gateway/rpc.h | 5 +- libfreerdp/core/gateway/rpc_fault.c | 368 +++++++++++++++------------- libfreerdp/core/gateway/rpc_fault.h | 1 + 10 files changed, 449 insertions(+), 330 deletions(-) diff --git a/include/freerdp/error.h b/include/freerdp/error.h index 78e1b3eb6..89475faba 100644 --- a/include/freerdp/error.h +++ b/include/freerdp/error.h @@ -28,6 +28,17 @@ extern "C" { #endif +/* Error categories */ +#define CAT_NONE "success" +#define CAT_USE "use" +#define CAT_BROKER "broker" +#define CAT_GATEWAY "gateway" +#define CAT_LICENSING "licensing" +#define CAT_SERVER "server" +#define CAT_CONFIG "config" +#define CAT_PROTOCOL "protocol" +#define CAT_ADMIN "administrative" + /** * Error Info Codes (Error Info PDU) */ @@ -163,6 +174,7 @@ extern "C" { FREERDP_API const char* freerdp_get_error_info_string(UINT32 code); FREERDP_API const char* freerdp_get_error_info_name(UINT32 code); +FREERDP_API const char* freerdp_get_error_info_category(UINT32 code); /** * This static variable holds an error code if the return value from connect is FALSE. @@ -214,6 +226,7 @@ FREERDP_API extern int connectErrorCode; FREERDP_API const char* freerdp_get_error_base_string(UINT32 code); FREERDP_API const char* freerdp_get_error_base_name(UINT32 code); +FREERDP_API const char* freerdp_get_error_base_category(UINT32 code); #define FREERDP_ERROR_SUCCESS ERRINFO_SUCCESS #define FREERDP_ERROR_NONE ERRINFO_NONE @@ -278,6 +291,7 @@ FREERDP_API const char* freerdp_get_error_base_name(UINT32 code); FREERDP_API const char* freerdp_get_error_connect_string(UINT32 code); FREERDP_API const char* freerdp_get_error_connect_name(UINT32 code); +FREERDP_API const char* freerdp_get_error_connect_category(UINT32 code); #define FREERDP_ERROR_CONNECT_CLASS (FREERDP_ERROR_BASE + 2) diff --git a/include/freerdp/freerdp.h b/include/freerdp/freerdp.h index 461d8ae5f..8f81d0791 100644 --- a/include/freerdp/freerdp.h +++ b/include/freerdp/freerdp.h @@ -472,6 +472,7 @@ FREERDP_API int freerdp_get_disconnect_ultimatum(rdpContext* context); FREERDP_API UINT32 freerdp_get_last_error(rdpContext* context); FREERDP_API const char* freerdp_get_last_error_name(UINT32 error); FREERDP_API const char* freerdp_get_last_error_string(UINT32 error); +FREERDP_API const char* freerdp_get_last_error_category(UINT32 error); FREERDP_API void freerdp_set_last_error(rdpContext* context, UINT32 lastError); FREERDP_API const char* freerdp_get_logon_error_info_type(UINT32 type); diff --git a/libfreerdp/core/errbase.c b/libfreerdp/core/errbase.c index dc9ba331c..66afd00d8 100644 --- a/libfreerdp/core/errbase.c +++ b/libfreerdp/core/errbase.c @@ -64,6 +64,25 @@ const char* freerdp_get_error_base_string(UINT32 code) return "ERRBASE_UNKNOWN"; } +const char* freerdp_get_error_base_category(UINT32 code) +{ + const ERRINFO* errInfo; + + errInfo = &ERRBASE_CODES[0]; + + while (errInfo->code != ERRBASE_NONE) + { + if (code == errInfo->code) + { + return errInfo->category; + } + + errInfo++; + } + + return "ERRBASE_UNKNOWN"; +} + const char* freerdp_get_error_base_name(UINT32 code) { const ERRINFO* errInfo; diff --git a/libfreerdp/core/errconnect.c b/libfreerdp/core/errconnect.c index 1b5ae8358..e29f45135 100644 --- a/libfreerdp/core/errconnect.c +++ b/libfreerdp/core/errconnect.c @@ -30,7 +30,7 @@ #define TAG FREERDP_TAG("core") -#define ERRCONNECT_DEFINE(_code) { ERRCONNECT_##_code , "ERRCONNECT_" #_code , ERRCONNECT_##_code##_STRING } +#define ERRCONNECT_DEFINE(_code, category) { ERRCONNECT_##_code , "ERRCONNECT_" #_code , ERRCONNECT_##_code##_STRING, category } /* Protocol-independent codes */ @@ -121,37 +121,37 @@ static const ERRINFO ERRCONNECT_CODES[] = { - ERRCONNECT_DEFINE(SUCCESS), + ERRCONNECT_DEFINE(SUCCESS, CAT_NONE), - ERRCONNECT_DEFINE(PRE_CONNECT_FAILED), - ERRCONNECT_DEFINE(CONNECT_UNDEFINED), - ERRCONNECT_DEFINE(POST_CONNECT_FAILED), - ERRCONNECT_DEFINE(DNS_ERROR), - ERRCONNECT_DEFINE(DNS_NAME_NOT_FOUND), - ERRCONNECT_DEFINE(CONNECT_FAILED), - ERRCONNECT_DEFINE(MCS_CONNECT_INITIAL_ERROR), - ERRCONNECT_DEFINE(TLS_CONNECT_FAILED), - ERRCONNECT_DEFINE(AUTHENTICATION_FAILED), - ERRCONNECT_DEFINE(INSUFFICIENT_PRIVILEGES), - ERRCONNECT_DEFINE(CONNECT_CANCELLED), - ERRCONNECT_DEFINE(SECURITY_NEGO_CONNECT_FAILED), - ERRCONNECT_DEFINE(CONNECT_TRANSPORT_FAILED), - ERRCONNECT_DEFINE(PASSWORD_EXPIRED), - ERRCONNECT_DEFINE(PASSWORD_CERTAINLY_EXPIRED), - ERRCONNECT_DEFINE(CLIENT_REVOKED), - ERRCONNECT_DEFINE(KDC_UNREACHABLE), - ERRCONNECT_DEFINE(ACCOUNT_DISABLED), - ERRCONNECT_DEFINE(PASSWORD_MUST_CHANGE), - ERRCONNECT_DEFINE(LOGON_FAILURE), - ERRCONNECT_DEFINE(WRONG_PASSWORD), - ERRCONNECT_DEFINE(ACCESS_DENIED), - ERRCONNECT_DEFINE(ACCOUNT_RESTRICTION), - ERRCONNECT_DEFINE(ACCOUNT_LOCKED_OUT), - ERRCONNECT_DEFINE(ACCOUNT_EXPIRED), - ERRCONNECT_DEFINE(LOGON_TYPE_NOT_GRANTED), - ERRCONNECT_DEFINE(NO_OR_MISSING_CREDENTIALS), + ERRCONNECT_DEFINE(PRE_CONNECT_FAILED, CAT_CONFIG), + ERRCONNECT_DEFINE(CONNECT_UNDEFINED, CAT_USE), + ERRCONNECT_DEFINE(POST_CONNECT_FAILED, CAT_CONFIG), + ERRCONNECT_DEFINE(DNS_ERROR, CAT_USE), + ERRCONNECT_DEFINE(DNS_NAME_NOT_FOUND, CAT_CONFIG), + ERRCONNECT_DEFINE(CONNECT_FAILED, CAT_USE), + ERRCONNECT_DEFINE(MCS_CONNECT_INITIAL_ERROR, CAT_PROTOCOL), + ERRCONNECT_DEFINE(TLS_CONNECT_FAILED, CAT_USE), + ERRCONNECT_DEFINE(AUTHENTICATION_FAILED, CAT_USE), + ERRCONNECT_DEFINE(INSUFFICIENT_PRIVILEGES, CAT_ADMIN), + ERRCONNECT_DEFINE(CONNECT_CANCELLED, CAT_USE), + ERRCONNECT_DEFINE(SECURITY_NEGO_CONNECT_FAILED, CAT_USE), + ERRCONNECT_DEFINE(CONNECT_TRANSPORT_FAILED, CAT_USE), + ERRCONNECT_DEFINE(PASSWORD_EXPIRED, CAT_ADMIN), + ERRCONNECT_DEFINE(PASSWORD_CERTAINLY_EXPIRED, CAT_ADMIN), + ERRCONNECT_DEFINE(CLIENT_REVOKED, CAT_ADMIN), + ERRCONNECT_DEFINE(KDC_UNREACHABLE, CAT_ADMIN), + ERRCONNECT_DEFINE(ACCOUNT_DISABLED, CAT_ADMIN), + ERRCONNECT_DEFINE(PASSWORD_MUST_CHANGE, CAT_ADMIN), + ERRCONNECT_DEFINE(LOGON_FAILURE, CAT_USE), + ERRCONNECT_DEFINE(WRONG_PASSWORD, CAT_USE), + ERRCONNECT_DEFINE(ACCESS_DENIED, CAT_ADMIN), + ERRCONNECT_DEFINE(ACCOUNT_RESTRICTION, CAT_ADMIN), + ERRCONNECT_DEFINE(ACCOUNT_LOCKED_OUT, CAT_ADMIN), + ERRCONNECT_DEFINE(ACCOUNT_EXPIRED, CAT_ADMIN), + ERRCONNECT_DEFINE(LOGON_TYPE_NOT_GRANTED, CAT_ADMIN), + ERRCONNECT_DEFINE(NO_OR_MISSING_CREDENTIALS, CAT_USE), - ERRCONNECT_DEFINE(NONE) + ERRCONNECT_DEFINE(NONE, CAT_NONE) }; const char* freerdp_get_error_connect_string(UINT32 code) @@ -172,6 +172,24 @@ const char* freerdp_get_error_connect_string(UINT32 code) return "ERRCONNECT_UNKNOWN"; } +const char* freerdp_get_error_connect_category(UINT32 code) +{ + const ERRINFO* errInfo; + errInfo = &ERRCONNECT_CODES[0]; + + while (errInfo->code != ERRCONNECT_NONE) + { + if (code == errInfo->code) + { + return errInfo->category; + } + + errInfo++; + } + + return "ERRCONNECT_UNKNOWN"; +} + const char* freerdp_get_error_connect_name(UINT32 code) { const ERRINFO* errInfo; diff --git a/libfreerdp/core/errinfo.c b/libfreerdp/core/errinfo.c index e0325f6b9..bb3582505 100644 --- a/libfreerdp/core/errinfo.c +++ b/libfreerdp/core/errinfo.c @@ -29,7 +29,7 @@ #define TAG FREERDP_TAG("core") -#define ERRINFO_DEFINE(_code) { ERRINFO_##_code , "ERRINFO_" #_code , ERRINFO_##_code##_STRING } +#define ERRINFO_DEFINE(_code, category) { ERRINFO_##_code , "ERRINFO_" #_code , ERRINFO_##_code##_STRING, category } int connectErrorCode; @@ -432,135 +432,135 @@ int connectErrorCode; static const ERRINFO ERRINFO_CODES[] = { - ERRINFO_DEFINE(SUCCESS), + ERRINFO_DEFINE(SUCCESS, CAT_NONE), /* Protocol-independent codes */ - ERRINFO_DEFINE(RPC_INITIATED_DISCONNECT), - ERRINFO_DEFINE(RPC_INITIATED_LOGOFF), - ERRINFO_DEFINE(IDLE_TIMEOUT), - ERRINFO_DEFINE(LOGON_TIMEOUT), - ERRINFO_DEFINE(DISCONNECTED_BY_OTHER_CONNECTION), - ERRINFO_DEFINE(OUT_OF_MEMORY), - ERRINFO_DEFINE(SERVER_DENIED_CONNECTION), - ERRINFO_DEFINE(SERVER_INSUFFICIENT_PRIVILEGES), - ERRINFO_DEFINE(SERVER_FRESH_CREDENTIALS_REQUIRED), - ERRINFO_DEFINE(RPC_INITIATED_DISCONNECT_BY_USER), - ERRINFO_DEFINE(LOGOFF_BY_USER), - ERRINFO_DEFINE(CLOSE_STACK_ON_DRIVER_NOT_READY), - ERRINFO_DEFINE(SERVER_DWM_CRASH), - ERRINFO_DEFINE(CLOSE_STACK_ON_DRIVER_FAILURE), - ERRINFO_DEFINE(CLOSE_STACK_ON_DRIVER_IFACE_FAILURE), - ERRINFO_DEFINE(SERVER_WINLOGON_CRASH), - ERRINFO_DEFINE(SERVER_CSRSS_CRASH), + ERRINFO_DEFINE(RPC_INITIATED_DISCONNECT, CAT_ADMIN), + ERRINFO_DEFINE(RPC_INITIATED_LOGOFF, CAT_ADMIN), + ERRINFO_DEFINE(IDLE_TIMEOUT, CAT_ADMIN), + ERRINFO_DEFINE(LOGON_TIMEOUT, CAT_ADMIN), + ERRINFO_DEFINE(DISCONNECTED_BY_OTHER_CONNECTION, CAT_USE), + ERRINFO_DEFINE(OUT_OF_MEMORY, CAT_ADMIN), + ERRINFO_DEFINE(SERVER_DENIED_CONNECTION, CAT_ADMIN), + ERRINFO_DEFINE(SERVER_INSUFFICIENT_PRIVILEGES, CAT_ADMIN), + ERRINFO_DEFINE(SERVER_FRESH_CREDENTIALS_REQUIRED, CAT_ADMIN), + ERRINFO_DEFINE(RPC_INITIATED_DISCONNECT_BY_USER, CAT_ADMIN), + ERRINFO_DEFINE(LOGOFF_BY_USER, CAT_USE), + ERRINFO_DEFINE(CLOSE_STACK_ON_DRIVER_NOT_READY, CAT_SERVER), + ERRINFO_DEFINE(SERVER_DWM_CRASH, CAT_SERVER), + ERRINFO_DEFINE(CLOSE_STACK_ON_DRIVER_FAILURE, CAT_SERVER), + ERRINFO_DEFINE(CLOSE_STACK_ON_DRIVER_IFACE_FAILURE, CAT_SERVER), + ERRINFO_DEFINE(SERVER_WINLOGON_CRASH, CAT_SERVER), + ERRINFO_DEFINE(SERVER_CSRSS_CRASH, CAT_SERVER), /* Protocol-independent licensing codes */ - ERRINFO_DEFINE(LICENSE_INTERNAL), - ERRINFO_DEFINE(LICENSE_NO_LICENSE_SERVER), - ERRINFO_DEFINE(LICENSE_NO_LICENSE), - ERRINFO_DEFINE(LICENSE_BAD_CLIENT_MSG), - ERRINFO_DEFINE(LICENSE_HWID_DOESNT_MATCH_LICENSE), - ERRINFO_DEFINE(LICENSE_BAD_CLIENT_LICENSE), - ERRINFO_DEFINE(LICENSE_CANT_FINISH_PROTOCOL), - ERRINFO_DEFINE(LICENSE_CLIENT_ENDED_PROTOCOL), - ERRINFO_DEFINE(LICENSE_BAD_CLIENT_ENCRYPTION), - ERRINFO_DEFINE(LICENSE_CANT_UPGRADE_LICENSE), - ERRINFO_DEFINE(LICENSE_NO_REMOTE_CONNECTIONS), + ERRINFO_DEFINE(LICENSE_INTERNAL, CAT_LICENSING), + ERRINFO_DEFINE(LICENSE_NO_LICENSE_SERVER, CAT_LICENSING), + ERRINFO_DEFINE(LICENSE_NO_LICENSE, CAT_LICENSING), + ERRINFO_DEFINE(LICENSE_BAD_CLIENT_MSG, CAT_LICENSING), + ERRINFO_DEFINE(LICENSE_HWID_DOESNT_MATCH_LICENSE, CAT_LICENSING), + ERRINFO_DEFINE(LICENSE_BAD_CLIENT_LICENSE, CAT_LICENSING), + ERRINFO_DEFINE(LICENSE_CANT_FINISH_PROTOCOL, CAT_LICENSING), + ERRINFO_DEFINE(LICENSE_CLIENT_ENDED_PROTOCOL, CAT_LICENSING), + ERRINFO_DEFINE(LICENSE_BAD_CLIENT_ENCRYPTION, CAT_LICENSING), + ERRINFO_DEFINE(LICENSE_CANT_UPGRADE_LICENSE, CAT_LICENSING), + ERRINFO_DEFINE(LICENSE_NO_REMOTE_CONNECTIONS, CAT_LICENSING), /* Protocol-independent codes generated by the Connection Broker */ - ERRINFO_DEFINE(CB_DESTINATION_NOT_FOUND), - ERRINFO_DEFINE(CB_LOADING_DESTINATION), - ERRINFO_DEFINE(CB_REDIRECTING_TO_DESTINATION), - ERRINFO_DEFINE(CB_SESSION_ONLINE_VM_WAKE), - ERRINFO_DEFINE(CB_SESSION_ONLINE_VM_BOOT), - ERRINFO_DEFINE(CB_SESSION_ONLINE_VM_NO_DNS), - ERRINFO_DEFINE(CB_DESTINATION_POOL_NOT_FREE), - ERRINFO_DEFINE(CB_CONNECTION_CANCELLED), - ERRINFO_DEFINE(CB_CONNECTION_ERROR_INVALID_SETTINGS), - ERRINFO_DEFINE(CB_SESSION_ONLINE_VM_BOOT_TIMEOUT), - ERRINFO_DEFINE(CB_SESSION_ONLINE_VM_SESSMON_FAILED), + ERRINFO_DEFINE(CB_DESTINATION_NOT_FOUND, CAT_BROKER), + ERRINFO_DEFINE(CB_LOADING_DESTINATION, CAT_BROKER), + ERRINFO_DEFINE(CB_REDIRECTING_TO_DESTINATION, CAT_BROKER), + ERRINFO_DEFINE(CB_SESSION_ONLINE_VM_WAKE, CAT_BROKER), + ERRINFO_DEFINE(CB_SESSION_ONLINE_VM_BOOT, CAT_BROKER), + ERRINFO_DEFINE(CB_SESSION_ONLINE_VM_NO_DNS, CAT_BROKER), + ERRINFO_DEFINE(CB_DESTINATION_POOL_NOT_FREE, CAT_BROKER), + ERRINFO_DEFINE(CB_CONNECTION_CANCELLED, CAT_BROKER), + ERRINFO_DEFINE(CB_CONNECTION_ERROR_INVALID_SETTINGS, CAT_BROKER), + ERRINFO_DEFINE(CB_SESSION_ONLINE_VM_BOOT_TIMEOUT, CAT_BROKER), + ERRINFO_DEFINE(CB_SESSION_ONLINE_VM_SESSMON_FAILED, CAT_BROKER), /* RDP specific codes */ - ERRINFO_DEFINE(UNKNOWN_DATA_PDU_TYPE), - ERRINFO_DEFINE(UNKNOWN_PDU_TYPE), - ERRINFO_DEFINE(DATA_PDU_SEQUENCE), - ERRINFO_DEFINE(CONTROL_PDU_SEQUENCE), - ERRINFO_DEFINE(INVALID_CONTROL_PDU_ACTION), - ERRINFO_DEFINE(INVALID_INPUT_PDU_TYPE), - ERRINFO_DEFINE(INVALID_INPUT_PDU_MOUSE), - ERRINFO_DEFINE(INVALID_REFRESH_RECT_PDU), - ERRINFO_DEFINE(CREATE_USER_DATA_FAILED), - ERRINFO_DEFINE(CONNECT_FAILED), - ERRINFO_DEFINE(CONFIRM_ACTIVE_HAS_WRONG_SHAREID), - ERRINFO_DEFINE(CONFIRM_ACTIVE_HAS_WRONG_ORIGINATOR), - ERRINFO_DEFINE(PERSISTENT_KEY_PDU_BAD_LENGTH), - ERRINFO_DEFINE(PERSISTENT_KEY_PDU_ILLEGAL_FIRST), - ERRINFO_DEFINE(PERSISTENT_KEY_PDU_TOO_MANY_TOTAL_KEYS), - ERRINFO_DEFINE(PERSISTENT_KEY_PDU_TOO_MANY_CACHE_KEYS), - ERRINFO_DEFINE(INPUT_PDU_BAD_LENGTH), - ERRINFO_DEFINE(BITMAP_CACHE_ERROR_PDU_BAD_LENGTH), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT), - ERRINFO_DEFINE(VCHANNEL_DATA_TOO_SHORT), - ERRINFO_DEFINE(SHARE_DATA_TOO_SHORT), - ERRINFO_DEFINE(BAD_SUPPRESS_OUTPUT_PDU), - ERRINFO_DEFINE(CONFIRM_ACTIVE_PDU_TOO_SHORT), - ERRINFO_DEFINE(CAPABILITY_SET_TOO_SMALL), - ERRINFO_DEFINE(CAPABILITY_SET_TOO_LARGE), - ERRINFO_DEFINE(NO_CURSOR_CACHE), - ERRINFO_DEFINE(BAD_CAPABILITIES), - ERRINFO_DEFINE(VIRTUAL_CHANNEL_DECOMPRESSION), - ERRINFO_DEFINE(INVALID_VC_COMPRESSION_TYPE), - ERRINFO_DEFINE(INVALID_CHANNEL_ID), - ERRINFO_DEFINE(VCHANNELS_TOO_MANY), - ERRINFO_DEFINE(REMOTEAPP_NOT_ENABLED), - ERRINFO_DEFINE(CACHE_CAP_NOT_SET), - ERRINFO_DEFINE(BITMAP_CACHE_ERROR_PDU_BAD_LENGTH2), - ERRINFO_DEFINE(OFFSCREEN_CACHE_ERROR_PDU_BAD_LENGTH), - ERRINFO_DEFINE(DRAWNINEGRID_CACHE_ERROR_PDU_BAD_LENGTH), - ERRINFO_DEFINE(GDIPLUS_PDU_BAD_LENGTH), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT2), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT3), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT4), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT5), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT6), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT7), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT8), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT9), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT10), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT11), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT12), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT13), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT14), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT15), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT16), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT17), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT18), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT19), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT20), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT21), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT22), - ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT23), - ERRINFO_DEFINE(BAD_MONITOR_DATA), - ERRINFO_DEFINE(VC_DECOMPRESSED_REASSEMBLE_FAILED), - ERRINFO_DEFINE(VC_DATA_TOO_LONG), - ERRINFO_DEFINE(BAD_FRAME_ACK_DATA), - ERRINFO_DEFINE(GRAPHICS_MODE_NOT_SUPPORTED), - ERRINFO_DEFINE(GRAPHICS_SUBSYSTEM_RESET_FAILED), - ERRINFO_DEFINE(GRAPHICS_SUBSYSTEM_FAILED), - ERRINFO_DEFINE(TIMEZONE_KEY_NAME_LENGTH_TOO_SHORT), - ERRINFO_DEFINE(TIMEZONE_KEY_NAME_LENGTH_TOO_LONG), - ERRINFO_DEFINE(DYNAMIC_DST_DISABLED_FIELD_MISSING), - ERRINFO_DEFINE(VC_DECODING_ERROR), - ERRINFO_DEFINE(VIRTUALDESKTOPTOOLARGE), - ERRINFO_DEFINE(MONITORGEOMETRYVALIDATIONFAILED), - ERRINFO_DEFINE(INVALIDMONITORCOUNT), - ERRINFO_DEFINE(UPDATE_SESSION_KEY_FAILED), - ERRINFO_DEFINE(DECRYPT_FAILED), - ERRINFO_DEFINE(ENCRYPT_FAILED), - ERRINFO_DEFINE(ENCRYPTION_PACKAGE_MISMATCH), - ERRINFO_DEFINE(DECRYPT_FAILED2), - ERRINFO_DEFINE(PEER_DISCONNECTED), + ERRINFO_DEFINE(UNKNOWN_DATA_PDU_TYPE, CAT_PROTOCOL), + ERRINFO_DEFINE(UNKNOWN_PDU_TYPE, CAT_PROTOCOL), + ERRINFO_DEFINE(DATA_PDU_SEQUENCE, CAT_PROTOCOL), + ERRINFO_DEFINE(CONTROL_PDU_SEQUENCE, CAT_PROTOCOL), + ERRINFO_DEFINE(INVALID_CONTROL_PDU_ACTION, CAT_PROTOCOL), + ERRINFO_DEFINE(INVALID_INPUT_PDU_TYPE, CAT_PROTOCOL), + ERRINFO_DEFINE(INVALID_INPUT_PDU_MOUSE, CAT_PROTOCOL), + ERRINFO_DEFINE(INVALID_REFRESH_RECT_PDU, CAT_PROTOCOL), + ERRINFO_DEFINE(CREATE_USER_DATA_FAILED, CAT_PROTOCOL), + ERRINFO_DEFINE(CONNECT_FAILED, CAT_USE), + ERRINFO_DEFINE(CONFIRM_ACTIVE_HAS_WRONG_SHAREID, CAT_PROTOCOL), + ERRINFO_DEFINE(CONFIRM_ACTIVE_HAS_WRONG_ORIGINATOR, CAT_PROTOCOL), + ERRINFO_DEFINE(PERSISTENT_KEY_PDU_BAD_LENGTH, CAT_PROTOCOL), + ERRINFO_DEFINE(PERSISTENT_KEY_PDU_ILLEGAL_FIRST, CAT_PROTOCOL), + ERRINFO_DEFINE(PERSISTENT_KEY_PDU_TOO_MANY_TOTAL_KEYS, CAT_PROTOCOL), + ERRINFO_DEFINE(PERSISTENT_KEY_PDU_TOO_MANY_CACHE_KEYS, CAT_PROTOCOL), + ERRINFO_DEFINE(INPUT_PDU_BAD_LENGTH, CAT_PROTOCOL), + ERRINFO_DEFINE(BITMAP_CACHE_ERROR_PDU_BAD_LENGTH, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT, CAT_PROTOCOL), + ERRINFO_DEFINE(VCHANNEL_DATA_TOO_SHORT, CAT_PROTOCOL), + ERRINFO_DEFINE(SHARE_DATA_TOO_SHORT, CAT_PROTOCOL), + ERRINFO_DEFINE(BAD_SUPPRESS_OUTPUT_PDU, CAT_PROTOCOL), + ERRINFO_DEFINE(CONFIRM_ACTIVE_PDU_TOO_SHORT, CAT_PROTOCOL), + ERRINFO_DEFINE(CAPABILITY_SET_TOO_SMALL, CAT_PROTOCOL), + ERRINFO_DEFINE(CAPABILITY_SET_TOO_LARGE, CAT_PROTOCOL), + ERRINFO_DEFINE(NO_CURSOR_CACHE, CAT_PROTOCOL), + ERRINFO_DEFINE(BAD_CAPABILITIES, CAT_PROTOCOL), + ERRINFO_DEFINE(VIRTUAL_CHANNEL_DECOMPRESSION, CAT_PROTOCOL), + ERRINFO_DEFINE(INVALID_VC_COMPRESSION_TYPE, CAT_PROTOCOL), + ERRINFO_DEFINE(INVALID_CHANNEL_ID, CAT_PROTOCOL), + ERRINFO_DEFINE(VCHANNELS_TOO_MANY, CAT_PROTOCOL), + ERRINFO_DEFINE(REMOTEAPP_NOT_ENABLED, CAT_ADMIN), + ERRINFO_DEFINE(CACHE_CAP_NOT_SET, CAT_PROTOCOL), + ERRINFO_DEFINE(BITMAP_CACHE_ERROR_PDU_BAD_LENGTH2, CAT_PROTOCOL), + ERRINFO_DEFINE(OFFSCREEN_CACHE_ERROR_PDU_BAD_LENGTH, CAT_PROTOCOL), + ERRINFO_DEFINE(DRAWNINEGRID_CACHE_ERROR_PDU_BAD_LENGTH, CAT_PROTOCOL), + ERRINFO_DEFINE(GDIPLUS_PDU_BAD_LENGTH, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT2, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT3, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT4, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT5, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT6, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT7, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT8, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT9, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT10, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT11, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT12, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT13, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT14, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT15, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT16, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT17, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT18, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT19, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT20, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT21, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT22, CAT_PROTOCOL), + ERRINFO_DEFINE(SECURITY_DATA_TOO_SHORT23, CAT_PROTOCOL), + ERRINFO_DEFINE(BAD_MONITOR_DATA, CAT_PROTOCOL), + ERRINFO_DEFINE(VC_DECOMPRESSED_REASSEMBLE_FAILED, CAT_PROTOCOL), + ERRINFO_DEFINE(VC_DATA_TOO_LONG, CAT_PROTOCOL), + ERRINFO_DEFINE(BAD_FRAME_ACK_DATA, CAT_PROTOCOL), + ERRINFO_DEFINE(GRAPHICS_MODE_NOT_SUPPORTED, CAT_SERVER), + ERRINFO_DEFINE(GRAPHICS_SUBSYSTEM_RESET_FAILED, CAT_SERVER), + ERRINFO_DEFINE(GRAPHICS_SUBSYSTEM_FAILED, CAT_SERVER), + ERRINFO_DEFINE(TIMEZONE_KEY_NAME_LENGTH_TOO_SHORT, CAT_PROTOCOL), + ERRINFO_DEFINE(TIMEZONE_KEY_NAME_LENGTH_TOO_LONG, CAT_PROTOCOL), + ERRINFO_DEFINE(DYNAMIC_DST_DISABLED_FIELD_MISSING, CAT_PROTOCOL), + ERRINFO_DEFINE(VC_DECODING_ERROR, CAT_PROTOCOL), + ERRINFO_DEFINE(VIRTUALDESKTOPTOOLARGE, CAT_SERVER), + ERRINFO_DEFINE(MONITORGEOMETRYVALIDATIONFAILED, CAT_PROTOCOL), + ERRINFO_DEFINE(INVALIDMONITORCOUNT, CAT_PROTOCOL), + ERRINFO_DEFINE(UPDATE_SESSION_KEY_FAILED, CAT_PROTOCOL), + ERRINFO_DEFINE(DECRYPT_FAILED, CAT_PROTOCOL), + ERRINFO_DEFINE(ENCRYPT_FAILED, CAT_PROTOCOL), + ERRINFO_DEFINE(ENCRYPTION_PACKAGE_MISMATCH, CAT_PROTOCOL), + ERRINFO_DEFINE(DECRYPT_FAILED2, CAT_PROTOCOL), + ERRINFO_DEFINE(PEER_DISCONNECTED, CAT_USE), - ERRINFO_DEFINE(NONE) + ERRINFO_DEFINE(NONE, CAT_NONE) }; const char* freerdp_get_error_info_string(UINT32 code) @@ -581,6 +581,24 @@ const char* freerdp_get_error_info_string(UINT32 code) return "Unknown error."; } +const char* freerdp_get_error_info_category(UINT32 code) +{ + const ERRINFO* errInfo; + errInfo = &ERRINFO_CODES[0]; + + while (errInfo->code != ERRINFO_NONE) + { + if (code == errInfo->code) + { + return errInfo->category; + } + + errInfo++; + } + + return "ERRINFO_UNKNOWN"; +} + const char* freerdp_get_error_info_name(UINT32 code) { const ERRINFO* errInfo; diff --git a/libfreerdp/core/errinfo.h b/libfreerdp/core/errinfo.h index cc426f30e..852d3b089 100644 --- a/libfreerdp/core/errinfo.h +++ b/libfreerdp/core/errinfo.h @@ -26,8 +26,9 @@ struct _ERRINFO { UINT32 code; - char* name; - char* info; + const char* name; + const char* info; + const char* category; }; typedef struct _ERRINFO ERRINFO; diff --git a/libfreerdp/core/freerdp.c b/libfreerdp/core/freerdp.c index c9992464c..8271e322c 100644 --- a/libfreerdp/core/freerdp.c +++ b/libfreerdp/core/freerdp.c @@ -859,6 +859,34 @@ const char* freerdp_get_last_error_string(UINT32 code) return string; } +const char* freerdp_get_last_error_category(UINT32 code) +{ + const char* string = NULL; + const UINT32 cls = GET_FREERDP_ERROR_CLASS(code); + const UINT32 type = GET_FREERDP_ERROR_TYPE(code); + + switch (cls) + { + case FREERDP_ERROR_ERRBASE_CLASS: + string = freerdp_get_error_base_category(type); + break; + + case FREERDP_ERROR_ERRINFO_CLASS: + string = freerdp_get_error_info_category(type); + break; + + case FREERDP_ERROR_CONNECT_CLASS: + string = freerdp_get_error_connect_category(type); + break; + + default: + string = rpc_error_to_category(code); + break; + } + + return string; +} + void freerdp_set_last_error(rdpContext* context, UINT32 lastError) { if (lastError) diff --git a/libfreerdp/core/gateway/rpc.h b/libfreerdp/core/gateway/rpc.h index 49e8c0ded..e3f671e3c 100644 --- a/libfreerdp/core/gateway/rpc.h +++ b/libfreerdp/core/gateway/rpc.h @@ -405,11 +405,12 @@ typedef struct struct _RPC_FAULT_CODE { UINT32 code; - char* name; + const char* name; + const char* category; }; typedef struct _RPC_FAULT_CODE RPC_FAULT_CODE; -#define DEFINE_RPC_FAULT_CODE(_code) { _code , #_code }, +#define DEFINE_RPC_FAULT_CODE(_code, cat) { _code, #_code, cat }, #define nca_s_comm_failure 0x1C010001 #define nca_s_op_rng_error 0x1C010002 diff --git a/libfreerdp/core/gateway/rpc_fault.c b/libfreerdp/core/gateway/rpc_fault.c index 274f26821..eb1725404 100644 --- a/libfreerdp/core/gateway/rpc_fault.c +++ b/libfreerdp/core/gateway/rpc_fault.c @@ -31,188 +31,188 @@ static const RPC_FAULT_CODE RPC_FAULT_CODES[] = { - DEFINE_RPC_FAULT_CODE(nca_s_fault_object_not_found) - DEFINE_RPC_FAULT_CODE(nca_s_fault_cancel) - DEFINE_RPC_FAULT_CODE(nca_s_fault_addr_error) - DEFINE_RPC_FAULT_CODE(nca_s_fault_context_mismatch) - DEFINE_RPC_FAULT_CODE(nca_s_fault_fp_div_zero) - DEFINE_RPC_FAULT_CODE(nca_s_fault_fp_error) - DEFINE_RPC_FAULT_CODE(nca_s_fault_fp_overflow) - DEFINE_RPC_FAULT_CODE(nca_s_fault_fp_underflow) - DEFINE_RPC_FAULT_CODE(nca_s_fault_ill_inst) - DEFINE_RPC_FAULT_CODE(nca_s_fault_int_div_by_zero) - DEFINE_RPC_FAULT_CODE(nca_s_fault_int_overflow) - DEFINE_RPC_FAULT_CODE(nca_s_fault_invalid_bound) - DEFINE_RPC_FAULT_CODE(nca_s_fault_invalid_tag) - DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_closed) - DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_comm_error) - DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_discipline) - DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_empty) - DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_memory) - DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_order) - DEFINE_RPC_FAULT_CODE(nca_s_fault_remote_no_memory) - DEFINE_RPC_FAULT_CODE(nca_s_fault_user_defined) - DEFINE_RPC_FAULT_CODE(nca_s_fault_tx_open_failed) - DEFINE_RPC_FAULT_CODE(nca_s_fault_codeset_conv_error) - DEFINE_RPC_FAULT_CODE(nca_s_fault_no_client_stub) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_STRING_BINDING) - DEFINE_RPC_FAULT_CODE(RPC_S_WRONG_KIND_OF_BINDING) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_BINDING) - DEFINE_RPC_FAULT_CODE(RPC_S_PROTSEQ_NOT_SUPPORTED) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_RPC_PROTSEQ) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_STRING_UUID) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_ENDPOINT_FORMAT) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NET_ADDR) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_ENDPOINT_FOUND) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_TIMEOUT) - DEFINE_RPC_FAULT_CODE(RPC_S_OBJECT_NOT_FOUND) - DEFINE_RPC_FAULT_CODE(RPC_S_ALREADY_REGISTERED) - DEFINE_RPC_FAULT_CODE(RPC_S_TYPE_ALREADY_REGISTERED) - DEFINE_RPC_FAULT_CODE(RPC_S_ALREADY_LISTENING) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_PROTSEQS_REGISTERED) - DEFINE_RPC_FAULT_CODE(RPC_S_NOT_LISTENING) - DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_MGR_TYPE) - DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_IF) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_BINDINGS) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_PROTSEQS) - DEFINE_RPC_FAULT_CODE(RPC_S_CANT_CREATE_ENDPOINT) - DEFINE_RPC_FAULT_CODE(RPC_S_OUT_OF_RESOURCES) - DEFINE_RPC_FAULT_CODE(RPC_S_SERVER_UNAVAILABLE) - DEFINE_RPC_FAULT_CODE(RPC_S_SERVER_TOO_BUSY) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NETWORK_OPTIONS) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_CALL_ACTIVE) - DEFINE_RPC_FAULT_CODE(RPC_S_CALL_FAILED) - DEFINE_RPC_FAULT_CODE(RPC_S_CALL_FAILED_DNE) - DEFINE_RPC_FAULT_CODE(RPC_S_PROTOCOL_ERROR) - DEFINE_RPC_FAULT_CODE(RPC_S_PROXY_ACCESS_DENIED) - DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_TRANS_SYN) - DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_TYPE) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_TAG) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_BOUND) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_ENTRY_NAME) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NAME_SYNTAX) - DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_NAME_SYNTAX) - DEFINE_RPC_FAULT_CODE(RPC_S_UUID_NO_ADDRESS) - DEFINE_RPC_FAULT_CODE(RPC_S_DUPLICATE_ENDPOINT) - DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHN_TYPE) - DEFINE_RPC_FAULT_CODE(RPC_S_MAX_CALLS_TOO_SMALL) - DEFINE_RPC_FAULT_CODE(RPC_S_STRING_TOO_LONG) - DEFINE_RPC_FAULT_CODE(RPC_S_PROTSEQ_NOT_FOUND) - DEFINE_RPC_FAULT_CODE(RPC_S_PROCNUM_OUT_OF_RANGE) - DEFINE_RPC_FAULT_CODE(RPC_S_BINDING_HAS_NO_AUTH) - DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHN_SERVICE) - DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHN_LEVEL) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_AUTH_IDENTITY) - DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHZ_SERVICE) - DEFINE_RPC_FAULT_CODE(EPT_S_INVALID_ENTRY) - DEFINE_RPC_FAULT_CODE(EPT_S_CANT_PERFORM_OP) - DEFINE_RPC_FAULT_CODE(EPT_S_NOT_REGISTERED) - DEFINE_RPC_FAULT_CODE(RPC_S_NOTHING_TO_EXPORT) - DEFINE_RPC_FAULT_CODE(RPC_S_INCOMPLETE_NAME) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_VERS_OPTION) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_MORE_MEMBERS) - DEFINE_RPC_FAULT_CODE(RPC_S_NOT_ALL_OBJS_UNEXPORTED) - DEFINE_RPC_FAULT_CODE(RPC_S_INTERFACE_NOT_FOUND) - DEFINE_RPC_FAULT_CODE(RPC_S_ENTRY_ALREADY_EXISTS) - DEFINE_RPC_FAULT_CODE(RPC_S_ENTRY_NOT_FOUND) - DEFINE_RPC_FAULT_CODE(RPC_S_NAME_SERVICE_UNAVAILABLE) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NAF_ID) - DEFINE_RPC_FAULT_CODE(RPC_S_CANNOT_SUPPORT) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_CONTEXT_AVAILABLE) - DEFINE_RPC_FAULT_CODE(RPC_S_INTERNAL_ERROR) - DEFINE_RPC_FAULT_CODE(RPC_S_ZERO_DIVIDE) - DEFINE_RPC_FAULT_CODE(RPC_S_ADDRESS_ERROR) - DEFINE_RPC_FAULT_CODE(RPC_S_FP_DIV_ZERO) - DEFINE_RPC_FAULT_CODE(RPC_S_FP_UNDERFLOW) - DEFINE_RPC_FAULT_CODE(RPC_S_FP_OVERFLOW) - DEFINE_RPC_FAULT_CODE(RPC_X_NO_MORE_ENTRIES) - DEFINE_RPC_FAULT_CODE(RPC_X_SS_CHAR_TRANS_OPEN_FAIL) - DEFINE_RPC_FAULT_CODE(RPC_X_SS_CHAR_TRANS_SHORT_FILE) - DEFINE_RPC_FAULT_CODE(RPC_X_SS_IN_NULL_CONTEXT) - DEFINE_RPC_FAULT_CODE(RPC_X_SS_CONTEXT_DAMAGED) - DEFINE_RPC_FAULT_CODE(RPC_X_SS_HANDLES_MISMATCH) - DEFINE_RPC_FAULT_CODE(RPC_X_SS_CANNOT_GET_CALL_HANDLE) - DEFINE_RPC_FAULT_CODE(RPC_X_NULL_REF_POINTER) - DEFINE_RPC_FAULT_CODE(RPC_X_ENUM_VALUE_OUT_OF_RANGE) - DEFINE_RPC_FAULT_CODE(RPC_X_BYTE_COUNT_TOO_SMALL) - DEFINE_RPC_FAULT_CODE(RPC_X_BAD_STUB_DATA) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_INTERFACES) - DEFINE_RPC_FAULT_CODE(RPC_S_CALL_CANCELLED) - DEFINE_RPC_FAULT_CODE(RPC_S_BINDING_INCOMPLETE) - DEFINE_RPC_FAULT_CODE(RPC_S_COMM_FAILURE) - DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_AUTHN_LEVEL) - DEFINE_RPC_FAULT_CODE(RPC_S_NO_PRINC_NAME) - DEFINE_RPC_FAULT_CODE(RPC_S_NOT_RPC_ERROR) - DEFINE_RPC_FAULT_CODE(RPC_S_UUID_LOCAL_ONLY) - DEFINE_RPC_FAULT_CODE(RPC_S_SEC_PKG_ERROR) - DEFINE_RPC_FAULT_CODE(RPC_S_NOT_CANCELLED) - DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_ES_ACTION) - DEFINE_RPC_FAULT_CODE(RPC_X_WRONG_ES_VERSION) - DEFINE_RPC_FAULT_CODE(RPC_X_WRONG_STUB_VERSION) - DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_PIPE_OBJECT) - DEFINE_RPC_FAULT_CODE(RPC_X_WRONG_PIPE_ORDER) - DEFINE_RPC_FAULT_CODE(RPC_X_WRONG_PIPE_VERSION) - DEFINE_RPC_FAULT_CODE(RPC_S_COOKIE_AUTH_FAILED) - DEFINE_RPC_FAULT_CODE(RPC_S_GROUP_MEMBER_NOT_FOUND) - DEFINE_RPC_FAULT_CODE(EPT_S_CANT_CREATE) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_OBJECT) + DEFINE_RPC_FAULT_CODE(nca_s_fault_object_not_found, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_cancel, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_addr_error, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_context_mismatch, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_fp_div_zero, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_fp_error, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_fp_overflow, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_fp_underflow, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_ill_inst, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_int_div_by_zero, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_int_overflow, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_invalid_bound, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_invalid_tag, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_closed, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_comm_error, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_discipline, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_empty, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_memory, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_pipe_order, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_remote_no_memory, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_user_defined, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_tx_open_failed, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_codeset_conv_error, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(nca_s_fault_no_client_stub, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_STRING_BINDING, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_WRONG_KIND_OF_BINDING, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_BINDING, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_PROTSEQ_NOT_SUPPORTED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_RPC_PROTSEQ, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_STRING_UUID, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_ENDPOINT_FORMAT, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NET_ADDR, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NO_ENDPOINT_FOUND, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_TIMEOUT, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_OBJECT_NOT_FOUND, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_ALREADY_REGISTERED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_TYPE_ALREADY_REGISTERED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_ALREADY_LISTENING, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NO_PROTSEQS_REGISTERED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NOT_LISTENING, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_MGR_TYPE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_IF, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NO_BINDINGS, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NO_PROTSEQS, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_CANT_CREATE_ENDPOINT, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_OUT_OF_RESOURCES, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_SERVER_UNAVAILABLE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_SERVER_TOO_BUSY, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NETWORK_OPTIONS, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NO_CALL_ACTIVE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_CALL_FAILED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_CALL_FAILED_DNE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_PROTOCOL_ERROR, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_PROXY_ACCESS_DENIED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_TRANS_SYN, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_TYPE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_TAG, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_BOUND, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NO_ENTRY_NAME, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NAME_SYNTAX, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_NAME_SYNTAX, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_UUID_NO_ADDRESS, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_DUPLICATE_ENDPOINT, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHN_TYPE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_MAX_CALLS_TOO_SMALL, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_STRING_TOO_LONG, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_PROTSEQ_NOT_FOUND, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_PROCNUM_OUT_OF_RANGE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_BINDING_HAS_NO_AUTH, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHN_SERVICE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHN_LEVEL, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_AUTH_IDENTITY, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_AUTHZ_SERVICE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(EPT_S_INVALID_ENTRY, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(EPT_S_CANT_PERFORM_OP, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(EPT_S_NOT_REGISTERED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NOTHING_TO_EXPORT, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INCOMPLETE_NAME, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_VERS_OPTION, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NO_MORE_MEMBERS, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NOT_ALL_OBJS_UNEXPORTED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INTERFACE_NOT_FOUND, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_ENTRY_ALREADY_EXISTS, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_ENTRY_NOT_FOUND, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NAME_SERVICE_UNAVAILABLE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_NAF_ID, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_CANNOT_SUPPORT, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NO_CONTEXT_AVAILABLE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INTERNAL_ERROR, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_ZERO_DIVIDE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_ADDRESS_ERROR, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_FP_DIV_ZERO, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_FP_UNDERFLOW, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_FP_OVERFLOW, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_NO_MORE_ENTRIES, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_SS_CHAR_TRANS_OPEN_FAIL, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_SS_CHAR_TRANS_SHORT_FILE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_SS_IN_NULL_CONTEXT, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_SS_CONTEXT_DAMAGED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_SS_HANDLES_MISMATCH, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_SS_CANNOT_GET_CALL_HANDLE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_NULL_REF_POINTER, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_ENUM_VALUE_OUT_OF_RANGE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_BYTE_COUNT_TOO_SMALL, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_BAD_STUB_DATA, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NO_INTERFACES, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_CALL_CANCELLED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_BINDING_INCOMPLETE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_COMM_FAILURE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_UNSUPPORTED_AUTHN_LEVEL, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NO_PRINC_NAME, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NOT_RPC_ERROR, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_UUID_LOCAL_ONLY, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_SEC_PKG_ERROR, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_NOT_CANCELLED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_ES_ACTION, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_WRONG_ES_VERSION, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_WRONG_STUB_VERSION, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_PIPE_OBJECT, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_WRONG_PIPE_ORDER, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_WRONG_PIPE_VERSION, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_COOKIE_AUTH_FAILED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_GROUP_MEMBER_NOT_FOUND, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(EPT_S_CANT_CREATE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_OBJECT, CAT_GATEWAY) { - 0, NULL + 0, NULL, NULL } }; static const RPC_FAULT_CODE RPC_TSG_FAULT_CODES[] = { - DEFINE_RPC_FAULT_CODE(RPC_S_OK) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_ARG) - DEFINE_RPC_FAULT_CODE(RPC_S_OUT_OF_MEMORY) - DEFINE_RPC_FAULT_CODE(RPC_S_OUT_OF_THREADS) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_LEVEL) - DEFINE_RPC_FAULT_CODE(RPC_S_BUFFER_TOO_SMALL) - DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_SECURITY_DESC) - DEFINE_RPC_FAULT_CODE(RPC_S_ACCESS_DENIED) - DEFINE_RPC_FAULT_CODE(RPC_S_SERVER_OUT_OF_MEMORY) - DEFINE_RPC_FAULT_CODE(RPC_S_ASYNC_CALL_PENDING) - DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_PRINCIPAL) - DEFINE_RPC_FAULT_CODE(RPC_S_TIMEOUT) - DEFINE_RPC_FAULT_CODE(RPC_X_NO_MEMORY) - DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_BOUND) - DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_TAG) - DEFINE_RPC_FAULT_CODE(RPC_X_ENUM_VALUE_TOO_LARGE) - DEFINE_RPC_FAULT_CODE(RPC_X_SS_CONTEXT_MISMATCH) - DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_BUFFER) - DEFINE_RPC_FAULT_CODE(RPC_X_PIPE_APP_MEMORY) - DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_PIPE_OPERATION) - DEFINE_RPC_FAULT_CODE(ERROR_ONLY_IF_CONNECTED) - DEFINE_RPC_FAULT_CODE(ERROR_GRACEFUL_DISCONNECT) - DEFINE_RPC_FAULT_CODE(ERROR_OPERATION_ABORTED) - DEFINE_RPC_FAULT_CODE(ERROR_BAD_ARGUMENTS) - DEFINE_RPC_FAULT_CODE(E_PROXY_INTERNALERROR) - DEFINE_RPC_FAULT_CODE(E_PROXY_RAP_ACCESSDENIED) - DEFINE_RPC_FAULT_CODE(E_PROXY_NAP_ACCESSDENIED) - DEFINE_RPC_FAULT_CODE(E_PROXY_TS_CONNECTFAILED) - DEFINE_RPC_FAULT_CODE(E_PROXY_ALREADYDISCONNECTED) - DEFINE_RPC_FAULT_CODE(E_PROXY_QUARANTINE_ACCESSDENIED) - DEFINE_RPC_FAULT_CODE(E_PROXY_NOCERTAVAILABLE) - DEFINE_RPC_FAULT_CODE(E_PROXY_COOKIE_BADPACKET) - DEFINE_RPC_FAULT_CODE(E_PROXY_COOKIE_AUTHENTICATION_ACCESS_DENIED) - DEFINE_RPC_FAULT_CODE(E_PROXY_UNSUPPORTED_AUTHENTICATION_METHOD) - DEFINE_RPC_FAULT_CODE(E_PROXY_CAPABILITYMISMATCH) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_NOTSUPPORTED)) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_TS_CONNECTFAILED)) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_MAXCONNECTIONSREACHED)) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_INTERNALERROR)) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_SESSIONTIMEOUT)) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_REAUTH_AUTHN_FAILED)) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_REAUTH_CAP_FAILED)) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_REAUTH_RAP_FAILED)) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_SDR_NOT_SUPPORTED_BY_TS)) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_REAUTH_NAP_FAILED)) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_CONNECTIONABORTED)) - DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_NOCERTAVAILABLE)) - DEFINE_RPC_FAULT_CODE(__HRESULT_FROM_WIN32(RPC_S_CALL_CANCELLED)) + DEFINE_RPC_FAULT_CODE(RPC_S_OK, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_ARG, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_OUT_OF_MEMORY, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_OUT_OF_THREADS, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_LEVEL, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_BUFFER_TOO_SMALL, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_INVALID_SECURITY_DESC, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_ACCESS_DENIED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_SERVER_OUT_OF_MEMORY, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_ASYNC_CALL_PENDING, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_UNKNOWN_PRINCIPAL, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_S_TIMEOUT, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_NO_MEMORY, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_BOUND, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_TAG, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_ENUM_VALUE_TOO_LARGE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_SS_CONTEXT_MISMATCH, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_BUFFER, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_PIPE_APP_MEMORY, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(RPC_X_INVALID_PIPE_OPERATION, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(ERROR_ONLY_IF_CONNECTED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(ERROR_GRACEFUL_DISCONNECT, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(ERROR_OPERATION_ABORTED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(ERROR_BAD_ARGUMENTS, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_INTERNALERROR, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_RAP_ACCESSDENIED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_NAP_ACCESSDENIED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_TS_CONNECTFAILED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_ALREADYDISCONNECTED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_QUARANTINE_ACCESSDENIED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_NOCERTAVAILABLE, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_COOKIE_BADPACKET, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_COOKIE_AUTHENTICATION_ACCESS_DENIED, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_UNSUPPORTED_AUTHENTICATION_METHOD, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(E_PROXY_CAPABILITYMISMATCH, CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_NOTSUPPORTED), CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_TS_CONNECTFAILED), CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_MAXCONNECTIONSREACHED), CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_INTERNALERROR), CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_SESSIONTIMEOUT), CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_REAUTH_AUTHN_FAILED), CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_REAUTH_CAP_FAILED), CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_REAUTH_RAP_FAILED), CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_SDR_NOT_SUPPORTED_BY_TS), CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_REAUTH_NAP_FAILED), CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_CONNECTIONABORTED), CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(HRESULT_CODE(E_PROXY_NOCERTAVAILABLE), CAT_GATEWAY) + DEFINE_RPC_FAULT_CODE(HRESULT_CODE(RPC_S_CALL_CANCELLED), CAT_GATEWAY) { - 0, NULL + 0, NULL, NULL } }; @@ -389,6 +389,24 @@ out: return buffer; } +const char* rpc_error_to_category(UINT32 code) +{ + size_t index; + + for (index = 0; RPC_FAULT_CODES[index].category != NULL; index++) + { + if (RPC_FAULT_CODES[index].code == code) + return RPC_FAULT_CODES[index].category; + } + + for (index = 0; RPC_TSG_FAULT_CODES[index].category != NULL; index++) + { + if (RPC_TSG_FAULT_CODES[index].code == code) + return RPC_TSG_FAULT_CODES[index].category; + } + + return "UNKNOWN"; +} int rpc_recv_fault_pdu(UINT32 status) { diff --git a/libfreerdp/core/gateway/rpc_fault.h b/libfreerdp/core/gateway/rpc_fault.h index bfdc0889c..802a40ef6 100644 --- a/libfreerdp/core/gateway/rpc_fault.h +++ b/libfreerdp/core/gateway/rpc_fault.h @@ -25,5 +25,6 @@ FREERDP_LOCAL int rpc_recv_fault_pdu(UINT32 status); FREERDP_LOCAL const char* rpc_error_to_string(UINT32 error); +FREERDP_LOCAL const char* rpc_error_to_category(UINT32 error); #endif /* FREERDP_LIB_CORE_GATEWAY_RPC_FAULT_H */