Add handling for a few special RDP error codes

Most of the RPD protocol errors (reason > 0x1000) would only be
triggered by coding errors in the client. A few of them can occur due
to server errors however. We should attempt to handle these cases.
This commit is contained in:
Samuel Mannehed 2017-10-04 16:27:34 +02:00
parent e8562507e7
commit b0813fa275
3 changed files with 30 additions and 1 deletions

View File

@ -580,6 +580,10 @@ enum RDP_INPUT_DEVICE
#define ERRINFO_CB_CONNECTION_ERROR_INVALID_SETTINGS 0x0410
#define ERRINFO_CB_SESSION_ONLINE_VM_BOOT_TIMEOUT 0x0411
#define ERRINFO_CB_SESSION_ONLINE_VM_SESSMON_FAILED 0x0412
#define ERRINFO_REMOTEAPPSNOTENABLED 0x10f3
#define ERRINFO_UPDATESESSIONKEYFAILED 0x1191
#define ERRINFO_DECRYPTFAILED 0x1192
#define ERRINFO_ENCRYPTFAILED 0x1193
/* SeamlessRDP constants */
#define SEAMLESSRDP_NOTYETMAPPED -1

View File

@ -444,12 +444,32 @@ handle_disconnect_reason(RD_BOOL deactivated, uint16 reason)
retval = EXRD_CB_VM_BOOT_SESSMON_FAILED;
break;
case ERRINFO_REMOTEAPPSNOTENABLED:
text = "The server can only host Remote Applications";
retval = EXRD_RDP_REMOTEAPPSNOTENABLED;
break;
case ERRINFO_UPDATESESSIONKEYFAILED:
text = "Update of session keys failed";
retval = EXRD_RDP_UPDATESESSIONKEYFAILED;
break;
case ERRINFO_DECRYPTFAILED:
text = "Decryption or session key creation failed";
retval = EXRD_RDP_DECRYPTFAILED;
break;
case ERRINFO_ENCRYPTFAILED:
text = "Encryption failed";
retval = EXRD_RDP_ENCRYPTFAILED;
break;
default:
text = "Unknown reason";
retval = EXRD_UNKNOWN;
}
if (reason > 0x1000 && reason < 0x7fff) {
if (reason > 0x1000 && reason < 0x7fff && retval == EXRD_UNKNOWN) {
fprintf(stderr, "Internal protocol error: %x", reason);
} else if (reason != ERRINFO_NO_INFO) {
fprintf(stderr, "disconnect: %s.\n", text);

View File

@ -129,6 +129,11 @@
#define EXRD_CB_VM_BOOT_TIMEOUT 41
#define EXRD_CB_VM_BOOT_SESSMON_FAILED 42
#define EXRD_RDP_REMOTEAPPSNOTENABLED 50
#define EXRD_RDP_UPDATESESSIONKEYFAILED 51
#define EXRD_RDP_DECRYPTFAILED 52
#define EXRD_RDP_ENCRYPTFAILED 53
/* other exit codes */
#define EXRD_WINDOW_CLOSED 62
#define EXRD_UNKNOWN 63