From a2cf4f591e917eb8ed2b83032b4d715920d7ea71 Mon Sep 17 00:00:00 2001 From: Ian Weir Date: Fri, 25 Jun 2021 12:35:54 -0600 Subject: [PATCH] Add exit codes for logon failure and account locked out --- client/X11/xf_client.c | 8 +++++++- client/X11/xfreerdp.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index ca75d79fe..4fd7a2b73 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -1512,6 +1512,12 @@ static DWORD WINAPI xf_client_thread(LPVOID param) else if (freerdp_get_last_error(instance->context) == FREERDP_ERROR_SECURITY_NEGO_CONNECT_FAILED) exit_code = XF_EXIT_NEGO_FAILURE; + else if (freerdp_get_last_error(instance->context) == + FREERDP_ERROR_CONNECT_LOGON_FAILURE) + exit_code = XF_EXIT_LOGON_FAILURE; + else if (freerdp_get_last_error(instance->context) == + FREERDP_ERROR_CONNECT_ACCOUNT_LOCKED_OUT) + exit_code = XF_EXIT_ACCOUNT_LOCKED_OUT; else exit_code = XF_EXIT_CONN_FAILED; } @@ -1676,7 +1682,7 @@ end: DWORD xf_exit_code_from_disconnect_reason(DWORD reason) { - if (reason == 0 || (reason >= XF_EXIT_PARSE_ARGUMENTS && reason <= XF_EXIT_NEGO_FAILURE)) + if (reason == 0 || (reason >= XF_EXIT_PARSE_ARGUMENTS && reason <= XF_EXIT_ACCOUNT_LOCKED_OUT)) return reason; /* License error set */ else if (reason >= 0x100 && reason <= 0x10A) diff --git a/client/X11/xfreerdp.h b/client/X11/xfreerdp.h index b086562ba..fe0d970b6 100644 --- a/client/X11/xfreerdp.h +++ b/client/X11/xfreerdp.h @@ -318,6 +318,8 @@ enum XF_EXIT_CODE XF_EXIT_CONN_FAILED = 131, XF_EXIT_AUTH_FAILURE = 132, XF_EXIT_NEGO_FAILURE = 133, + XF_EXIT_LOGON_FAILURE = 134, + XF_EXIT_ACCOUNT_LOCKED_OUT = 135, XF_EXIT_UNKNOWN = 255, };