Set last error on activation timeout (#7502)

This commit is contained in:
akallabeth 2021-12-17 17:28:41 +01:00 committed by GitHub
parent 4a4d783d4f
commit feb6d9ae5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 4 deletions

View File

@ -269,6 +269,7 @@ extern "C"
#define ERRCONNECT_ACCOUNT_EXPIRED 0x00000019 #define ERRCONNECT_ACCOUNT_EXPIRED 0x00000019
#define ERRCONNECT_LOGON_TYPE_NOT_GRANTED 0x0000001A #define ERRCONNECT_LOGON_TYPE_NOT_GRANTED 0x0000001A
#define ERRCONNECT_NO_OR_MISSING_CREDENTIALS 0x0000001B #define ERRCONNECT_NO_OR_MISSING_CREDENTIALS 0x0000001B
#define ERRCONNECT_ACTIVATION_TIMEOUT 0x0000001C
#define ERRCONNECT_SUCCESS ERRINFO_SUCCESS #define ERRCONNECT_SUCCESS ERRINFO_SUCCESS
#define ERRCONNECT_NONE ERRINFO_NONE #define ERRCONNECT_NONE ERRINFO_NONE
@ -349,6 +350,9 @@ extern "C"
#define FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS \ #define FREERDP_ERROR_CONNECT_NO_OR_MISSING_CREDENTIALS \
MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_NO_OR_MISSING_CREDENTIALS) MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_NO_OR_MISSING_CREDENTIALS)
#define FREERDP_ERROR_CONNECT_ACTIVATION_TIMEOUT \
MAKE_FREERDP_ERROR(CONNECT, ERRCONNECT_ACTIVATION_TIMEOUT)
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -485,6 +485,7 @@ BOOL rdp_recv_deactivate_all(rdpRdp* rdp, wStream* s)
} }
WLog_ERR(TAG, "Timeout waiting for activation"); WLog_ERR(TAG, "Timeout waiting for activation");
freerdp_set_last_error_if_not(rdp->context, FREERDP_ERROR_CONNECT_ACTIVATION_TIMEOUT);
return FALSE; return FALSE;
} }

View File

@ -275,9 +275,9 @@ BOOL rdp_client_connect(rdpRdp* rdp)
char* user = NULL; char* user = NULL;
char* domain = NULL; char* domain = NULL;
char* cookie = NULL; char* cookie = NULL;
int user_length = 0; size_t user_length = 0;
int domain_length = 0; size_t domain_length = 0;
int cookie_length = 0; size_t cookie_length = 0;
if (settings->Username) if (settings->Username)
{ {
@ -392,6 +392,7 @@ BOOL rdp_client_connect(rdpRdp* rdp)
} }
WLog_ERR(TAG, "Timeout waiting for activation"); WLog_ERR(TAG, "Timeout waiting for activation");
freerdp_set_last_error_if_not(rdp->context, FREERDP_ERROR_CONNECT_ACTIVATION_TIMEOUT);
return FALSE; return FALSE;
} }
@ -1565,7 +1566,7 @@ BOOL rdp_set_state(rdpRdp* rdp, CONNECTION_STATE state)
const char* rdp_get_state_string(rdpRdp* rdp) const char* rdp_get_state_string(rdpRdp* rdp)
{ {
int state = rdp_get_state(rdp); CONNECTION_STATE state = rdp_get_state(rdp);
return rdp_state_string(state); return rdp_state_string(state);
} }

View File

@ -96,6 +96,8 @@
#define ERRCONNECT_NO_OR_MISSING_CREDENTIALS_STRING "Credentials invalid or missing." #define ERRCONNECT_NO_OR_MISSING_CREDENTIALS_STRING "Credentials invalid or missing."
#define ERRCONNECT_ACTIVATION_TIMEOUT_STRING "Timeout waiting for activation."
/* Special codes */ /* Special codes */
#define ERRCONNECT_SUCCESS_STRING "Success." #define ERRCONNECT_SUCCESS_STRING "Success."
#define ERRCONNECT_NONE_STRING "" #define ERRCONNECT_NONE_STRING ""
@ -130,6 +132,7 @@ static const ERRINFO ERRCONNECT_CODES[] = {
ERRCONNECT_DEFINE(ACCOUNT_EXPIRED, CAT_ADMIN), ERRCONNECT_DEFINE(ACCOUNT_EXPIRED, CAT_ADMIN),
ERRCONNECT_DEFINE(LOGON_TYPE_NOT_GRANTED, CAT_ADMIN), ERRCONNECT_DEFINE(LOGON_TYPE_NOT_GRANTED, CAT_ADMIN),
ERRCONNECT_DEFINE(NO_OR_MISSING_CREDENTIALS, CAT_USE), ERRCONNECT_DEFINE(NO_OR_MISSING_CREDENTIALS, CAT_USE),
ERRCONNECT_DEFINE(ACTIVATION_TIMEOUT, CAT_PROTOCOL),
ERRCONNECT_DEFINE(NONE, CAT_NONE) ERRCONNECT_DEFINE(NONE, CAT_NONE)
}; };