if (freerdp_channels_disconnect(context->channels, context->instance) != CHANNEL_RC_OK)
return FALSE;
- freerdp_set_last_error(context, FREERDP_ERROR_SUCCESS);
+ return TRUE;
+}
+
+BOOL rdp_client_disconnect_and_clear(rdpRdp* rdp)
+{
+ rdpContext* context;
+
+ if (!rdp_client_disconnect(rdp))
+ return FALSE;
+
+ context = rdp->context;
+
+ context->LastError = FREERDP_ERROR_SUCCESS;
clearChannelError(context);
ResetEvent(context->abortEvent);
return TRUE;
rdpSettings* settings;
rdpContext* context;
- if (!rdp_client_disconnect(rdp))
+ if (!rdp_client_disconnect_and_clear(rdp))
return FALSE;
settings = rdp->settings;
rdpContext* context = rdp->context;
rdpChannels* channels = context->channels;
- if (!rdp_client_disconnect(rdp))
+ if (!rdp_client_disconnect_and_clear(rdp))
return FALSE;
status = rdp_client_connect(rdp);
FREERDP_LOCAL BOOL rdp_client_connect(rdpRdp* rdp);
FREERDP_LOCAL BOOL rdp_client_disconnect(rdpRdp* rdp);
+FREERDP_LOCAL BOOL rdp_client_disconnect_and_clear(rdpRdp* rdp);
FREERDP_LOCAL BOOL rdp_client_reconnect(rdpRdp* rdp);
FREERDP_LOCAL BOOL rdp_client_redirect(rdpRdp* rdp);
FREERDP_LOCAL BOOL rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp,
/* We always set the return code to 0 before we start the connect sequence*/
connectErrorCode = 0;
- freerdp_set_last_error(instance->context, FREERDP_ERROR_SUCCESS);
+ instance->context->LastError = FREERDP_ERROR_SUCCESS;
clearChannelError(instance->context);
ResetEvent(instance->context->abortEvent);
rdp = instance->context->rdp;
BOOL freerdp_disconnect_before_reconnect(freerdp* instance)
{
rdpRdp* rdp = instance->context->rdp;
- return rdp_client_disconnect(rdp);
+ return rdp_client_disconnect_and_clear(rdp);
}
BOOL freerdp_reconnect(freerdp* instance)