From 1d4cdd2924f52207e791957cad1ea073ab72b019 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 2 Oct 2019 15:15:59 +0200 Subject: [PATCH 1/2] Added missing error codes. --- include/freerdp/error.h | 13 +++++++++++++ libfreerdp/core/errinfo.c | 25 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/include/freerdp/error.h b/include/freerdp/error.h index ead846ae2..78e1b3eb6 100644 --- a/include/freerdp/error.h +++ b/include/freerdp/error.h @@ -44,6 +44,12 @@ extern "C" { #define ERRINFO_SERVER_FRESH_CREDENTIALS_REQUIRED 0x0000000A #define ERRINFO_RPC_INITIATED_DISCONNECT_BY_USER 0x0000000B #define ERRINFO_LOGOFF_BY_USER 0x0000000C +#define ERRINFO_CLOSE_STACK_ON_DRIVER_NOT_READY 0x0000000F +#define ERRINFO_SERVER_DWM_CRASH 0x00000010 +#define ERRINFO_CLOSE_STACK_ON_DRIVER_FAILURE 0x00000011 +#define ERRINFO_CLOSE_STACK_ON_DRIVER_IFACE_FAILURE 0x00000012 +#define ERRINFO_SERVER_WINLOGON_CRASH 0x00000017 +#define ERRINFO_SERVER_CSRSS_CRASH 0x00000018 /* Protocol-independent licensing codes */ #define ERRINFO_LICENSE_INTERNAL 0x00000100 @@ -228,6 +234,13 @@ FREERDP_API const char* freerdp_get_error_base_name(UINT32 code); #define FREERDP_ERROR_RPC_INITIATED_DISCONNECT_BY_USER MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_RPC_INITIATED_DISCONNECT_BY_USER) #define FREERDP_ERROR_LOGOFF_BY_USER MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_LOGOFF_BY_USER) +#define FREERDP_ERROR_CLOSE_STACK_ON_DRIVER_NOT_READY MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_CLOSE_STACK_ON_DRIVER_NOT_READY) +#define FREERDP_ERROR_SERVER_DWM_CRASH MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_DWM_CRASH) +#define FREERDP_ERROR_CLOSE_STACK_ON_DRIVER_FAILURE MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_CLOSE_STACK_ON_DRIVER_FAILURE) +#define FREERDP_ERROR_CLOSE_STACK_ON_DRIVER_IFACE_FAILURE MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_CLOSE_STACK_ON_DRIVER_IFACE_FAILURE) +#define FREERDP_ERROR_SERVER_WINLOGON_CRASH MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_WINLOGON_CRASH) +#define FREERDP_ERROR_SERVER_CSRSS_CRASH MAKE_FREERDP_ERROR(ERRINFO, ERRINFO_SERVER_CSRSS_CRASH) + /* Connection Error Codes */ #define ERRCONNECT_PRE_CONNECT_FAILED 0x00000001 #define ERRCONNECT_CONNECT_UNDEFINED 0x00000002 diff --git a/libfreerdp/core/errinfo.c b/libfreerdp/core/errinfo.c index 8182df426..e0325f6b9 100644 --- a/libfreerdp/core/errinfo.c +++ b/libfreerdp/core/errinfo.c @@ -68,6 +68,25 @@ int connectErrorCode; #define ERRINFO_LOGOFF_BY_USER_STRING \ "The disconnection was initiated by the user logging off their session on the server." +#define ERRINFO_CLOSE_STACK_ON_DRIVER_NOT_READY_STRING \ + "The display driver in the remote session did not report any status within the time allotted for startup." + +#define ERRINFO_SERVER_DWM_CRASH_STRING \ + "The DWM process running in the remote session terminated unexpectedly." + +#define ERRINFO_CLOSE_STACK_ON_DRIVER_FAILURE_STRING \ + "The display driver in the remote session was unable to complete all the tasks required for startup." + +#define ERRINFO_CLOSE_STACK_ON_DRIVER_IFACE_FAILURE_STRING \ + "The display driver in the remote session started up successfully, but due to internal failures was not usable by the remoting stack." + +#define ERRINFO_SERVER_WINLOGON_CRASH_STRING \ + "The Winlogon process running in the remote session terminated unexpectedly." + +#define ERRINFO_SERVER_CSRSS_CRASH_STRING \ + "The CSRSS process running in the remote session terminated unexpectedly." + + /* Protocol-independent codes generated by the Connection Broker */ #define ERRINFO_CB_DESTINATION_NOT_FOUND_STRING \ @@ -427,6 +446,12 @@ static const ERRINFO ERRINFO_CODES[] = 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), /* Protocol-independent licensing codes */ ERRINFO_DEFINE(LICENSE_INTERNAL), From 134da33eb0ac7edc22a6df8ab6f0d307c2eaf54c Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 2 Oct 2019 16:01:36 +0200 Subject: [PATCH 2/2] Fixed format string. --- channels/printer/client/printer_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/printer/client/printer_main.c b/channels/printer/client/printer_main.c index b006a490e..a4c5f30ff 100644 --- a/channels/printer/client/printer_main.c +++ b/channels/printer/client/printer_main.c @@ -885,7 +885,7 @@ static UINT printer_register(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, if (!printer_dev->device.data) goto error_out; - sprintf_s(printer_dev->port, sizeof(printer_dev->port), "PRN%d", printer->id); + sprintf_s(printer_dev->port, sizeof(printer_dev->port), "PRN%"PRIdz, printer->id); printer_dev->device.type = RDPDR_DTYP_PRINT; printer_dev->device.name = printer_dev->port; printer_dev->device.IRPRequest = printer_irp_request;