Example #1
0
static void svc_plugin_process_terminated(rdpSvcPlugin* plugin)
{
	svc_data_in_item* item;

	freerdp_thread_stop(plugin->priv->thread);
	freerdp_thread_free(plugin->priv->thread);

	plugin->channel_entry_points.pVirtualChannelClose(plugin->priv->open_handle);
	xfree(plugin->channel_entry_points.pExtendedData);

	svc_plugin_remove(plugin);

	while ((item = list_dequeue(plugin->priv->data_in_list)) != NULL)
		svc_data_in_item_free(item);
	list_free(plugin->priv->data_in_list);

	if (plugin->priv->data_in != NULL)
	{
		stream_free(plugin->priv->data_in);
		plugin->priv->data_in = NULL;
	}
	xfree(plugin->priv);
	plugin->priv = NULL;

	IFCALL(plugin->terminate_callback, plugin);
}
Example #2
0
static void audin_alsa_free(IAudinDevice* device)
{
	AudinALSADevice* alsa = (AudinALSADevice*) device;

	freerdp_thread_free(alsa->thread);
	xfree(alsa);
}
Example #3
0
void test_peer_context_free(freerdp_peer* client, testPeerContext* context)
{
	if (context)
	{
		if (context->debug_channel_thread)
		{
			freerdp_thread_stop(context->debug_channel_thread);
			freerdp_thread_free(context->debug_channel_thread);
		}

		stream_free(context->s);
		free(context->icon_data);
		free(context->bg_data);

		rfx_context_free(context->rfx_context);
		nsc_context_free(context->nsc_context);

		if (context->debug_channel)
			WTSVirtualChannelClose(context->debug_channel);

		if (context->audin)
			audin_server_context_free(context->audin);

		if (context->rdpsnd)
			rdpsnd_server_context_free(context->rdpsnd);

		WTSDestroyVirtualChannelManager(context->vcm);
	}
}
Example #4
0
void rdpsnd_server_context_free(rdpsnd_server_context* context)
{
	rdpsnd_server* rdpsnd = (rdpsnd_server*) context;

	if (rdpsnd->rdpsnd_channel_thread)
	{
		freerdp_thread_stop(rdpsnd->rdpsnd_channel_thread);
		freerdp_thread_free(rdpsnd->rdpsnd_channel_thread);
	}

	if (rdpsnd->rdpsnd_channel)
		WTSVirtualChannelClose(rdpsnd->rdpsnd_channel);

	if (rdpsnd->rdpsnd_pdu)
		stream_free(rdpsnd->rdpsnd_pdu);

	if (rdpsnd->out_buffer)
		free(rdpsnd->out_buffer);

	if (rdpsnd->dsp_context)
		freerdp_dsp_context_free(rdpsnd->dsp_context);

	if (rdpsnd->context.client_formats)
		free(rdpsnd->context.client_formats);

	free(rdpsnd);
}
Example #5
0
static void
scard_process_irp_thread_func(struct scard_irp_thread_args* args)
{
	scard_process_irp(args->scard, args->irp);

	freerdp_thread_free(args->thread);
	xfree(args);
}
Example #6
0
static void parallel_free(DEVICE* device)
{
	IRP* irp;
	PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*) device;

	DEBUG_SVC("freeing device");

	freerdp_thread_stop(parallel->thread);
	freerdp_thread_free(parallel->thread);

	while ((irp = (IRP*) InterlockedPopEntrySList(parallel->pIrpList)) != NULL)
		irp->Discard(irp);

	_aligned_free(parallel->pIrpList);

	free(parallel);
}
Example #7
0
static void parallel_free(DEVICE* device)
{
    IRP* irp;
    PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*) device;

    DEBUG_SVC("freeing device");

    freerdp_thread_stop(parallel->thread);
    freerdp_thread_free(parallel->thread);

    while ((irp = (IRP*) list_dequeue(parallel->irp_list)) != NULL)
        irp->Discard(irp);

    list_free(parallel->irp_list);

    xfree(parallel);
}
Example #8
0
static void printer_free(DEVICE* device) {
	PRINTER_DEVICE* printer_dev = (PRINTER_DEVICE*) device;
	IRP* irp;

	freerdp_thread_stop(printer_dev->thread);
	freerdp_thread_free(printer_dev->thread);

	while ((irp = (IRP*) list_dequeue(printer_dev->irp_list)) != NULL)
		irp->Discard(irp);
	list_free(printer_dev->irp_list);

	if (printer_dev->printer)
		printer_dev->printer->Free(printer_dev->printer);

	xfree(printer_dev->device.name);

	xfree(printer_dev);
}
Example #9
0
static BOOL audin_server_close(audin_server_context* context)
{
	audin_server* audin = (audin_server*) context;

	if (audin->audin_channel_thread)
	{
		freerdp_thread_stop(audin->audin_channel_thread);
		freerdp_thread_free(audin->audin_channel_thread);
		audin->audin_channel_thread = NULL;
	}
	if (audin->audin_channel)
	{
		WTSVirtualChannelClose(audin->audin_channel);
		audin->audin_channel = NULL;
	}
	audin->context.selected_client_format = -1;

	return TRUE;
}
Example #10
0
static void printer_free(DEVICE* device)
{
    IRP* irp;
    PRINTER_DEVICE* printer_dev = (PRINTER_DEVICE*) device;

    freerdp_thread_stop(printer_dev->thread);
    freerdp_thread_free(printer_dev->thread);

    while ((irp = (IRP*) InterlockedPopEntrySList(printer_dev->pIrpList)) != NULL)
        irp->Discard(irp);

    _aligned_free(printer_dev->pIrpList);

    if (printer_dev->printer)
        printer_dev->printer->Free(printer_dev->printer);

    free(printer_dev->device.name);

    free(printer_dev);
}
Example #11
0
static void serial_free(DEVICE* device)
{
    SERIAL_DEVICE* serial = (SERIAL_DEVICE*)device;
    IRP* irp;

    DEBUG_SVC("freeing device");

    freerdp_thread_stop(serial->thread);
    freerdp_thread_free(serial->thread);

    while ((irp = (IRP*)list_dequeue(serial->irp_list)) != NULL)
        irp->Discard(irp);
    list_free(serial->irp_list);

    while ((irp = (IRP*)list_dequeue(serial->pending_irps)) != NULL)
        irp->Discard(irp);
    list_free(serial->pending_irps);

    xfree(serial);
}
Example #12
0
static void
scard_free(DEVICE* dev)
{
	SCARD_DEVICE* scard = (SCARD_DEVICE*)dev;
	IRP* irp;
	COMPLETIONIDINFO* CompletionIdInfo;

	freerdp_thread_stop(scard->thread);
	freerdp_thread_free(scard->thread);
	
	while ((irp = (IRP*)list_dequeue(scard->irp_list)) != NULL)
		irp->Discard(irp);
	list_free(scard->irp_list);

	/* Begin TS Client defect workaround. */
	while ((CompletionIdInfo = (COMPLETIONIDINFO*)list_dequeue(scard->CompletionIds)) != NULL)
	        xfree(CompletionIdInfo);
	list_free(scard->CompletionIds);
	/* End TS Client defect workaround. */

	xfree(dev);
	return;
}