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:
parent
e8562507e7
commit
b0813fa275
@ -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
|
||||
|
22
rdesktop.c
22
rdesktop.c
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user