UINT16 lengthSourceDescriptor;
if (rdp->state == CONNECTION_STATE_ACTIVE)
- {
rdp->deactivation_reactivation = TRUE;
- }
else
- {
rdp->deactivation_reactivation = FALSE;
- }
+
/*
* Windows XP can send short DEACTIVATE_ALL PDU that doesn't contain
* the following fields.
#include <winpr/crt.h>
#include <freerdp/error.h>
+#include <freerdp/listener.h>
/**
* Connection Sequence\n
int rdp_server_transition_to_state(rdpRdp* rdp, int state)
{
int status = 0;
+ freerdp_peer* client = NULL;
+
+ if (rdp->state >= CONNECTION_STATE_RDP_SECURITY_COMMENCEMENT)
+ client = rdp->context->peer;
+
+ if (rdp->state < CONNECTION_STATE_ACTIVE)
+ {
+ if (client)
+ client->activated = FALSE;
+ }
switch (state)
{
case CONNECTION_STATE_ACTIVE:
rdp->state = CONNECTION_STATE_ACTIVE;
update_reset_state(rdp->update);
+
+ if (client)
+ {
+ if (!client->connected)
+ {
+ /**
+ * PostConnect should only be called once and should not
+ * be called after a reactivation sequence.
+ */
+
+ IFCALLRET(client->PostConnect, client->connected, client);
+
+ if (!client->connected)
+ return -1;
+ }
+
+ IFCALLRET(client->Activate, client->activated, client);
+
+ if (!client->activated)
+ return -1;
+ }
+
break;
default:
instance->context = (rdpContext*) malloc(instance->ContextSize);
ZeroMemory(instance->context, instance->ContextSize);
+
context = instance->context;
+ context->instance = instance;
context->pubSub = PubSub_New(TRUE);
PubSub_AddEventTypes(context->pubSub, FreeRDP_Events, sizeof(FreeRDP_Events) / sizeof(wEventType));
- rdp = rdp_new(instance);
+ rdp = rdp_new(context);
instance->input = rdp->input;
instance->update = rdp->update;
instance->settings = rdp->settings;
context->graphics = graphics_new(context);
- context->instance = instance;
context->rdp = rdp;
context->input = instance->input;
if (!rdp_server_accept_client_font_list_pdu(client->context->rdp, s))
return FALSE;
- if (!client->connected)
- {
- /**
- * PostConnect should only be called once and should not be called
- * after a reactivation sequence.
- */
-
- IFCALLRET(client->PostConnect, client->connected, client);
-
- if (!client->connected)
- return FALSE;
- }
-
- if (!client->activated)
- {
- /* Activate will be called everytime after the client is activated/reactivated. */
-
- IFCALLRET(client->Activate, client->activated, client);
-
- if (!client->activated)
- return FALSE;
- }
-
break;
case DATA_PDU_TYPE_SHUTDOWN_REQUEST:
{
rdpRdp* rdp;
- rdp = rdp_new(NULL);
+ client->context = (rdpContext*) malloc(client->ContextSize);
+ ZeroMemory(client->context, client->ContextSize);
+
+ rdp = rdp_new(client->context);
+
client->input = rdp->input;
client->update = rdp->update;
client->settings = rdp->settings;
- client->context = (rdpContext*) malloc(client->ContextSize);
- ZeroMemory(client->context, client->ContextSize);
-
client->context->rdp = rdp;
client->context->peer = client;
client->context->input = client->input;
* @return new RDP module
*/
-rdpRdp* rdp_new(freerdp* instance)
+rdpRdp* rdp_new(rdpContext* context)
{
rdpRdp* rdp;
rdp = (rdpRdp*) malloc(sizeof(rdpRdp));
- if (rdp != NULL)
+ if (rdp)
{
ZeroMemory(rdp, sizeof(rdpRdp));
- rdp->instance = instance;
- rdp->settings = freerdp_settings_new((void*) instance);
+ rdp->context = context;
+
+ rdp->instance = context->instance;
+ rdp->settings = freerdp_settings_new((void*) context->instance);
- if (instance != NULL)
- instance->settings = rdp->settings;
+ if (context->instance)
+ context->instance->settings = rdp->settings;
- rdp->extension = extension_new(instance);
+ rdp->extension = extension_new(context->instance);
rdp->transport = transport_new(rdp->settings);
rdp->license = license_new(rdp);
rdp->input = input_new(rdp);
{
int state;
freerdp* instance;
+ rdpContext* context;
struct rdp_mcs* mcs;
struct rdp_nego* nego;
struct rdp_input* input;
void rdp_set_blocking_mode(rdpRdp* rdp, BOOL blocking);
int rdp_check_fds(rdpRdp* rdp);
-rdpRdp* rdp_new(freerdp* instance);
+rdpRdp* rdp_new(rdpContext* context);
void rdp_free(rdpRdp* rdp);
#ifdef WITH_DEBUG_RDP
static void update_send_desktop_resize(rdpContext* context)
{
- if (context->peer)
- context->peer->activated = FALSE;
-
rdp_server_reactivate(context->rdp);
}